Beispiel #1
0
        void Application_Start(object sender, EventArgs e)
        {
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            BundleConfig.RegisterBundles(BundleTable.Bundles);
            //загружаем роли в оперативную память
            var roles = new DAL.DataBaseObjects.Roles();

            Application["RolesList"] = roles.GetAllItemsToList();

            //загружаем backend в оперативную память
            var districts = new DAL.DataBaseObjects.Districts();

            Application["Districts"] = districts.GetAllItemsToList();

            //загружаем города в оперативную память
            var city = new DAL.DataBaseObjects.City();

            Application["CityList"] = city.GetAllItemsToList();

            //загружаем backend в оперативную память
            var backend = new DAL.DataBaseObjects.Backend();

            Application["BackendList"] = backend.GetAllItemsToList();

            new TicketStatisticTimerModule().Init();
        }
Beispiel #2
0
        public List <Districts> GetAllItemsToList()
        {
            var ds           = DM.GetAllData(this, null, null, null);
            var districtList = new List <Districts>();

            foreach (DataRow district in ds.Tables[0].Rows)
            {
                var districtToList = new Districts()
                {
                    ID            = Convert.ToInt32(district["ID"].ToString()),
                    Name          = district["Name"].ToString(),
                    DeliveryTerms = Convert.ToInt32(district["DeliveryTerms"].ToString()),
                    Monday        = Convert.ToInt32(district["Monday"].ToString()),
                    Tuesday       = Convert.ToInt32(district["Tuesday"].ToString()),
                    Wednesday     = Convert.ToInt32(district["Wednesday"].ToString()),
                    Thursday      = Convert.ToInt32(district["Thursday"].ToString()),
                    Friday        = Convert.ToInt32(district["Friday"].ToString()),
                    Saturday      = Convert.ToInt32(district["Saturday"].ToString()),
                    Sunday        = Convert.ToInt32(district["Sunday"].ToString()),
                    TrackID       = Convert.ToInt32(district["TrackID"].ToString()),
                };
                districtList.Add(districtToList);
            }
            return(districtList);
        }