private void cbCompany_SelectedIndexChanged(object sender, EventArgs e) { if (cbCompany.SelectedIndex > 0) { //if (CommonData.LogUserId.ToUpper() != "ADMIN") //{ objHrInfo = new HRInfo(); DataTable dtBranch = objHrInfo.GetUserBranchList(CommonData.LogUserId, cbCompany.SelectedValue.ToString(), "BR", "").Tables[0]; UtilityLibrary.PopulateControl(cbUserBranch, dtBranch.DefaultView, 1, 0, "--PLEASE SELECT--", 0); objHrInfo = null; //} //else //{ // objHrInfo = new HRInfo(); // DataTable dtBranch = objHrInfo.GetAllBranchList(cbCompany.SelectedValue.ToString(), "BR", "").Tables[0]; // UtilityLibrary.PopulateControl(cbUserBranch, dtBranch.DefaultView, 1, 0, "--PLEASE SELECT--", 0); // objHrInfo = null; //} } else { cbUserBranch.Items.Clear(); } FillDataToGrid(); }