Esempio n. 1
0
        public List <TimeOfUse> GetTimeOfUses(string name)
        {
            List <TimeOfUse> list;

            using (var db = new ProductConfigurationDBContext()
            {
                Database = { Connection = { ConnectionString = _connectionStringName } }
            })
            {
                var sqlParams = new List <SqlParameter>
                {
                    new SqlParameter("@Name", name),
                };
                list = db.Database.SqlQuery <TimeOfUse>("GetTimeOfUses @Name", sqlParams.ToArray()).ToList();
            }
            return(list);
        }
Esempio n. 2
0
        public List <TimeOfUseViewModel> GetTimeOfUseNames()
        {
            List <TimeOfUseViewModel> list;

            using (var db = new ProductConfigurationDBContext()
            {
                Database = { Connection = { ConnectionString = _connectionStringName } }
            })
            {
                //var sqlParams = new List<SqlParameter>
                //    {
                //        new SqlParameter("@Type",type),
                //        new SqlParameter("@PlanCode",planCode)
                //    };
                list = db.Database.SqlQuery <TimeOfUseViewModel>("GetTimeOfUseNames").ToList();
            }
            return(list);
        }
Esempio n. 3
0
        public List <string> GetEffectiveDates(string type, string planCode)
        {
            List <string> list;

            using (var db = new ProductConfigurationDBContext()
            {
                Database = { Connection = { ConnectionString = _connectionStringName } }
            })
            {
                var sqlParams = new List <SqlParameter>
                {
                    new SqlParameter("@Type", type),
                    new SqlParameter("@PlanCode", planCode)
                };
                list = db.Database.SqlQuery <string>("GetEffectiveDates @Type,@PlanCode", sqlParams.ToArray()).ToList();
            }
            return(list);
        }
Esempio n. 4
0
        //type:Dolar,Percentage
        public List <OfferPriceMapViewModel> GetOfferPriceMaps(string type, DateTime?effectiveDate, string planCode)
        {
            List <OfferPriceMapViewModel> list;

            using (var db = new ProductConfigurationDBContext()
            {
                Database = { Connection = { ConnectionString = _connectionStringName } }
            })
            {
                var sqlParams = new List <SqlParameter>
                {
                    new SqlParameter("@Type", type),
                    new SqlParameter("@EffectiveDate", effectiveDate),
                    new SqlParameter("@PlanCode", planCode),
                };

                list = db.Database.SqlQuery <OfferPriceMapViewModel>("GetOfferPriceMaps @Type,@EffectiveDate,@PlanCode", sqlParams.ToArray()).ToList();
            }
            return(list);
        }