Ejemplo n.º 1
0
        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"));
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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"));
        }