コード例 #1
0
    protected void loadLocation()
    {
        ddlLoction.Items.Clear();
        ListItem li = new ListItem("Select Loction", "0");

        ddlLoction.Items.Add(li);


        List <LOCATION> lOCATIONS = new List <LOCATION>();

        lOCATIONS = LOCATIONManager.GetAllLOCATIONsFood().FindAll(x => x.AGENTID == ((AGENT)Session["aGENT"]).AGENTID);

        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 = Session["snFoodlocationID"].ToString();
    }