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(); }