protected void loadLocation(int locationID) { ddlLoction.Items.Clear(); ListItem li = new ListItem("Select Loction", "0"); ddlLoction.Items.Add(li); List <LOCATION> lOCATIONS = new List <LOCATION>(); if (Session["aGENT"] != null) { lOCATIONS = LOCATIONManager.GetAllLOCATIONs().FindAll(x => x.AGENTID == ((AGENT)Session["aGENT"]).AGENTID); } else { lOCATIONS = LOCATIONManager.GetAllLOCATIONs(); } foreach (LOCATION location in lOCATIONS) { if (location.SEQUENCE == 0) { ListItem listItems = new ListItem(location.COUNTRY.ToString() + "--" + location.CITY.ToString() + "--" + location.BRANCH.ToString(), location.LOCATIONID.ToString()); ddlLoction.Items.Add(listItems); } } ddlLoction.DataBind(); ddlLoction.SelectedValue = locationID.ToString(); }
protected void loadCityByCountry() { ddlCity.Items.Clear(); ListItem li = new ListItem("-Select-", "0"); ddlCity.Items.Add(li); List <LOCATION> LOCATIONs = new List <LOCATION>(); LOCATIONs = LOCATIONManager.GetAllLOCATIONs().FindAll(x => x.COUNTRY == ddlCountry.SelectedItem.Value); List <string> onlyCity = new List <string>(); foreach (LOCATION location in LOCATIONs) { onlyCity.Add(location.CITY); } List <string> distinctCity = new List <string>(); distinctCity = onlyCity.Distinct().ToList(); for (int i = 0; i < distinctCity.Count; i++) { ListItem litems = new ListItem(distinctCity[i].ToString(), distinctCity[i].ToString()); ddlCity.Items.Add(litems); } ddlCity.DataBind(); }
private void loadLocation() { List <LOCATION> locations = new List <LOCATION>(); locations = LOCATIONManager.GetAllLOCATIONs(); dlLocation.DataSource = locations; dlLocation.DataBind(); }
private void loadLocation() { List <LOCATION> locations = new List <LOCATION>(); if (Session["userType"] != null && (Session["lOCATION"] != null || Session["aGENT"] != null)) { if (Session["userType"].ToString() == "Location") { LOCATIONGROUP lOCATIONGROUP = new LOCATIONGROUP(); lOCATIONGROUP = (LOCATIONGROUP)Session["lOCATION"]; hfLoggedinLocationID.Value = lOCATIONGROUP.LOCATIONGROUPID.ToString(); if (ddlAgent.SelectedItem.Text != "All Agents") { locations = LOCATIONManager.GetAllLOCATIONsByAgentIDnGroupID(int.Parse(ddlAgent.SelectedItem.Value), int.Parse(hfLoggedinLocationID.Value)); } else { locations = LOCATIONManager.GetAllLOCATIONsByGroupID(int.Parse(hfLoggedinLocationID.Value)); } //locations = LOCATIONManager.GetAllLOCATIONsByGroupID(int.Parse(hfLoggedinLocationID.Value)); //trLocation.Visible = false; } else if (Session["userType"].ToString() == "Agent") { AGENT aGENT = (AGENT)Session["aGENT"]; hfAgentID.Value = aGENT.AGENTID.ToString(); trLocation.Visible = true; if (hfAgentID.Value == "4") { if (ddlAgent.SelectedItem.Text != "All Agents") { locations = LOCATIONManager.GetAllLOCATIONsByAgentID(int.Parse(ddlAgent.SelectedItem.Value)); } else { locations = LOCATIONManager.GetAllLOCATIONs(); } } else { locations = LOCATIONManager.GetAllLOCATIONsByAgentID(int.Parse(hfAgentID.Value)); } } dlLocation.DataSource = locations; dlLocation.DataBind(); tblSearchByRefCode.Visible = false; } else { Session.RemoveAll(); Response.Redirect("LogInPage.aspx"); } }
private void loadLOCATION() { ListItem li = new ListItem("Select LOCATION...", "0"); ddlLOCATION.Items.Add(li); List <LOCATION> lOCATIONs = new List <LOCATION>(); lOCATIONs = LOCATIONManager.GetAllLOCATIONs(); foreach (LOCATION lOCATION in lOCATIONs) { ListItem item = new ListItem(lOCATION.BRANCH.ToString(), lOCATION.LOCATIONID.ToString()); ddlLOCATION.Items.Add(item); } }
private void loadLOCATIONAll() { ListItem li = new ListItem("Select LOCATION...", "0"); ddlLOCATION.Items.Add(li); List <LOCATION> lOCATIONs = new List <LOCATION>(); lOCATIONs = LOCATIONManager.GetAllLOCATIONs(); foreach (LOCATION lOCATION in lOCATIONs) { string loc = lOCATION.COUNTRY + " > " + lOCATION.CITY + " > " + lOCATION.BRANCH; ListItem item = new ListItem(loc, lOCATION.LOCATIONID.ToString()); ddlLOCATION.Items.Add(item); } }
private void loadLocation() { List <LOCATION> locations = new List <LOCATION>(); if (hfAgentID.Value == "4")//main office will c all the report { locations = LOCATIONManager.GetAllLOCATIONs(); } else { locations = LOCATIONManager.GetAllLOCATIONsByAgentID(int.Parse(hfAgentID.Value)); } dlLocation.DataSource = locations; dlLocation.DataBind(); }
protected void LoadAllLocation() { gvLocationInfo.DataSource = LOCATIONManager.GetAllLOCATIONs(); gvLocationInfo.DataBind(); txtNumberOfBranch.Text = gvLocationInfo.Rows.Count.ToString(); }
private void showLOCATIONGrid() { GridView1.DataSource = LOCATIONManager.GetAllLOCATIONs().FindAll(x => x.COUNTRY == "GUINEA"); GridView1.DataBind(); }
protected void LoadLocationByBranchID() { gvLocationInfo.DataSource = LOCATIONManager.GetAllLOCATIONs().FindAll(x => x.BRANCH == ddlBranch.SelectedItem.Value); gvLocationInfo.DataBind(); }