Example #1
0
        private void BindBranchDropdown()
        {
            string    branchId = string.Empty;
            string    moduleId = string.Empty;
            DataTable dtab     = spManager.GetAllBranch(branchId, moduleId);

            if (Session["BranchId"] != null)
            {
                if (!Session["BranchId"].ToString().Equals("0001"))
                {
                    dtab = dtab.AsEnumerable()
                           .Where(r => r.Field <string>("BRANCH_ID") == Session["BranchID"].ToString())
                           .CopyToDataTable();
                }
            }
            branchDropDownListChosen.DataSource     = dtab;
            branchDropDownListChosen.DataTextField  = "BRANCH_NM";
            branchDropDownListChosen.DataValueField = "BRANCH_ID";
            branchDropDownListChosen.DataBind();
            if (Session["BranchId"] != null)
            {
                if (!Session["BranchId"].ToString().Equals("0001"))
                {
                    branchDropDownListChosen.SelectedValue = Session["BranchId"].ToString();
                }
            }
        }