View uiLayoutHtml.html
<div class="ui-layout-center">
merkez yani esas olayın döndüğü kısım (iframe,partial vs)
</div>
<div class="ui-layout-north">
üst kısım (başlık vs)
</div>
<div class="ui-layout-west">
sol kısım (menu,treeview vs)
</div>
<div class="ui-layout-south">
View mvcExcelExportAction.cs
[HttpPost]
public ActionResult Export(string module)
{
SiteEntities db = new SiteEntities();
WebGrid grid = null;
if(module == "Tercümeler")
grid = new WebGrid(db.Tercume,,columnNames:new []{"Id", "Kod", "Tr", "En"}, canPage: false, canSort: false);
else if (module == "Listeler")
grid = new WebGrid(db.Liste, canPage: false, canSort: false);
View LinqRandom.cs
//file system
var files = (from file in new DirectoryInfo("c:\windows").GetFiles()
let tempName = Path.GetRandomFileName()
orderby tempName
select new
{
Name = file.Name
}).Take(10);
//DbContext Server
View postal.cshtml
//bu kısım mail message için gerekli parametleri teşkil ediyor.
Content-Type: text/html charset=utf-8//tr karakterler için
To: @ViewBag.To
Subject: @ViewBag.Subject
//bir satır boşluk bırakarak içeriği oluşturmaya başlıyoruz.
<h2>Kullanıcı Bilgileriniz</h2>
<p><strong>Kullanıcı Adı :</strong>@ViewBag.Username</p>
<p><strong>Parola :</strong>@ViewBag.Password</p>
View CreateSequence.sql
CREATE SEQUENCE dbo.seqTeklif
AS int --tip
START WITH 1 --başlangıç değeri
INCREMENT BY 1 --artış değeri
MINVALUE 1
MAXVALUE 1000000
View BiggestSol1.cs
int a = 10;
int b = 1;
int c = 9;
int biggest = a;
if (biggest < b)
biggest = b;
if (biggest < c)
biggest = c;
View AddProduct.cs
static int AddProduct(string name, int amount)
{
return Db.ExecuteNonQuery("insert Product values(@Name,@Amount)", name, amount);
}
View ExceptionHelper.cs
public static class ExceptionHelper
{
public static string GetMessage(this Exception ex)
{
StringBuilder expS = new StringBuilder();
expS.Append(ex.Message);
Exception inner = ex.InnerException;
while (inner != null)
{
expS.AppendFormat("{0}-{1}", Environment.NewLine, inner.Message);
View psIPAddress.ps1
$serviceSite = wget -Uri http://ip-api.com/xml
[xml] $xml = $serviceSite.Content
$ipAddress = $xml.query.query.'#cdata-section'
$ipAddress
View jsonAdoNetResult.cs
SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=Northwind;Integrated Security=True");
SqlCommand com = new SqlCommand(@";with data as(
select
P.ProductID,
p.ProductName,
p.UnitPrice,
p.UnitsInStock
from Products P
)
select @current as [current],