public static SelectList GetSelectList() { var db = new SinExDatabaseContext(); var query = from model in db.Shipments select new { Text = model.WaybillId.ToString() }; return(new SelectList(query.ToList(), "Text", "Text")); }
public static List <ShippingAccount> getCachedList() { Cache Cache = HttpRuntime.Cache; List <ShippingAccount> shippingAccountList = Cache["shippingAccountList"] as List <ShippingAccount>; if (shippingAccountList == null) { SinExDatabaseContext db = new SinExDatabaseContext(); shippingAccountList = db.ShippingAccounts.ToList(); } return(shippingAccountList); }
public static List <Currency> getCachedList() { Cache Cache = HttpRuntime.Cache; List <Currency> currencyList = Cache["currencyList"] as List <Currency>; if (currencyList == null) { SinExDatabaseContext db = new SinExDatabaseContext(); currencyList = db.Currencies.ToList(); } return(currencyList); }
public static List <ServiceType> getCachedList() { Cache Cache = HttpRuntime.Cache; SinExDatabaseContext db = new SinExDatabaseContext(); List <ServiceType> serviceTypeList = Cache["serviceTypeList"] as List <ServiceType>; if (serviceTypeList == null) { serviceTypeList = db.ServiceTypes.ToList(); } return(serviceTypeList); }
public static List <PackageType> getCachedList() { Cache Cache = HttpRuntime.Cache; SinExDatabaseContext db = new SinExDatabaseContext(); List <PackageType> packageTypeList = Cache["packageTypeList"] as List <PackageType>; if (packageTypeList == null) { packageTypeList = db.PackageTypes.ToList(); } return(packageTypeList); }
public static SelectList GetSelectList(int shippingAccountId, bool isRecipientAddress) { var db = new SinExDatabaseContext(); var addressListQuery = from s in db.Addresses where s.ShippingAccountId == shippingAccountId where s.isRecipientAddress == isRecipientAddress select new SelectListItem { Value = s.AddressId.ToString(), Text = s.AddressName, Selected = false, }; return(new SelectList(addressListQuery.ToList(), "Value", "Text")); }