Exemple #1
0
    private void BindBranchs(int ProvinceId, int CitiesId)
    {
        try
        {
            ddlBranch.Items.Clear();
            if (ProvinceId == 0 || CitiesId == 0)
            {
                ddlBranch.Items.Insert(0, new ListItem("Select", "0"));
                return;
            }

            DataSet objDs = _objBalUser.GetBranchs(ProvinceId, CitiesId);
            if (objDs.Tables[0].Rows.Count > 0)
            {
                ddlBranch.DataSource     = objDs;
                ddlBranch.DataValueField = "BranchId";
                ddlBranch.DataTextField  = "BranchName";
                ddlBranch.DataBind();
                ddlBranch.Items.Insert(0, new ListItem("Select", "0"));
            }
            else
            {
                ddlBranch.Items.Insert(0, new ListItem("Select", "0"));
            }
        }
        catch (Exception ex)
        {
            labelError.Text = _objBOUtiltiy.ShowMessage("danger", "Error", ex.Message);
        }
    }