示例#1
0
        protected void GridBranch_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    Button      btn             = (e.Row.FindControl("btnAdd") as Button);
                    HiddenField HfId            = (e.Row.FindControl("HfBranch_Code") as HiddenField);
                    CheckBox    CheckBoxCompany = (e.Row.FindControl("chkBranch") as CheckBox);

                    DataTable Dt          = new DataTable();
                    string    USERCODE    = DdlUser.SelectedValue;
                    string    COMPANYCODE = DdlCompany.SelectedValue;
                    // string brachCode = HfBranch_Code.Value;
                    Dt = BRANCH_MASLogicLayer.GetBranchDetailCompanyWise(COMPANYCODE, USERCODE);
                    for (int i = 0; i < Dt.Rows.Count; i++)
                    {
                        if (HfId.Value == Dt.Rows[i]["BRANCH_CODE"].ToString())
                        {
                            btn.Enabled             = false;
                            CheckBoxCompany.Checked = true;
                        }
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
 public void FillGridBranch()
 {
     try
     {
         DataTable Dt          = new DataTable();
         string    COMPANYCODE = DdlCompany.SelectedValue;
         Dt = BRANCH_MASLogicLayer.GetBranchDetailCompanyWise(COMPANYCODE);
         GridBranch.DataSource = Dt;
         GridBranch.DataBind();
     }
     catch (Exception)
     {
         throw;
     }
 }