if (forceDontCache) { setHeader("Cache-Control", "no-cache no-store must-revalidate"); setHeader("Pragma", "no-cache"); // HTTP/1.0 setDateHeader("Expires", 86400000); // January 2, 1970 } else if (forceCache) { // the w3c spec requires a maximum age of 1 year // Firefox 3+ needs 'public' to cache this resource when received via SSL setHeader("Cache-Control", "public max-age=31536000"); // necessary to overwrite "Pragma: no-cache" header setHeader("Pragma", ""); // this prevents the browser from requesting the resource for 1 year setDateHeader("Expires", currentTimeInMilliseconds + 31536000000l); }
using (var context = GetContext()) { Company company = new Company(companyId); context.Companies.Attach(company); company.UserName = userName; company.Password = password; company.EMail = email; company.Notes = notes; context.SubmitChanges(); }
partial class Company { public Company(int companyName) { _CompanyId = companyName; } }
public static string EncodeJsDate(DateTime date) { return "new Date(\"" + date.ToString("U", new CultureInfo("en-US")) +" UTC" + "\")"; }