Esempio n. 1
0
 private void InitialData()
 {
     var cmd = new StoreService();
     DataSouce = cmd.GetALL();
     gridStore.DataSource = DataSouce;
     gridStore.DataBind();
 }
Esempio n. 2
0
        private void InitialData()
        {
            Session["lstOrderDetail"] = null;
            var cmdStore = new StoreService();
            //DataSouce = cmdStore.GetALL();
            DataSouce = new List<STORE>();
            USER user = Session["user"] as USER;
            if (user == null) Response.Redirect("MainAdmin.aspx");
            var cmdZone = new ZoneDetailService();
            foreach (ZONE_DETAIL zoneId in cmdZone.GetALLByUser(user.EMPLOYEE_ID))
            {
                List<STORE> tmp = cmdStore.GetALL().Where(x => x.ZONE_ID == zoneId.ZONE_ID).ToList();
                DataSouce.AddRange(tmp);
            }

            var cmd = new SectorService();
            var list = cmd.GetALL();
            foreach (var item in list)
            {
                ddlSector.Items.Add(new ListItem(item.SECTOR_NAME, item.SECTOR_ID.ToString()));
            }
            var cmdPro = new ProvinceService();
            ViewState["listProvince"] = cmdPro.GetALL();
            foreach (var item in (List<PROVINCE>)ViewState["listProvince"])
            {
                ddlProvince.Items.Add(new ListItem(item.PROVINCE_NAME, item.PROVINCE_ID.ToString()));
            }

            var cmdRoad = new RoadService();
            ViewState["listRoad"] = cmdRoad.GetALL();
            foreach (var item in (List<ROAD>)ViewState["listRoad"])
            {
                ddlRoad.Items.Add(new ListItem(item.ROAD_NAME, item.ROAD_ID.ToString()));
            }

            gridStore.DataSource = null;
            gridStore.DataBind();
        }
Esempio n. 3
0
        private void InitialData()
        {
            var cmdPro = new ProvinceService();
            ViewState["listProvince"] = cmdPro.GetALL();
            foreach (var item in (List<PROVINCE>)ViewState["listProvince"])
            {
                ddlProvince.Items.Add(new ListItem(item.PROVINCE_NAME, item.PROVINCE_ID.ToString()));
            }

            var cmdStore = new StoreService();
            ViewState["listStore"] = cmdStore.GetALL();
            foreach (var item in (List<STORE>)ViewState["listStore"])
            {
                ddlStore.Items.Add(new ListItem(item.STORE_NAME, item.STORE_ID.ToString()));
            }

            var cmdOrder = new OrderService();
            DataSouce = cmdOrder.GetALLIncludeStore();
            grideInOrder.DataSource = DataSouce;
            grideInOrder.DataBind();
        }