Example #1
0
        private void FillBranchData()
        {
            IndentDB objIndent = new IndentDB();

            try
            {
                DataTable dtBranch = objIndent.IndentStockPointList_Get(CommonData.CompanyCode.ToString()).Tables[0];
                if (dtBranch.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dtBranch.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["branch_code"].ToString();
                        oclBox.Text = dataRow["branch_name"].ToString();
                        cbBranches.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (cbBranches.SelectedIndex > -1)
                {
                    strBranchCode = ((System.Data.DataRowView)(cbBranches.SelectedItem)).Row.ItemArray[0].ToString();
                    FillBranchGroupData();
                }
                objIndent = null;
            }
        }
Example #2
0
        private void FillBranchData()
        {
            IndentDB objIndent = new IndentDB();

            try
            {
                DataTable dtBranch = objIndent.IndentStockPointList_Get(CommonData.CompanyCode.ToString()).Tables[0];
                DataRow   dr       = dtBranch.NewRow();
                dr[0] = "0";
                dr[1] = "Select";
                dtBranch.Rows.InsertAt(dr, 0);
                dr = null;
                if (dtBranch.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dtBranch.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["branch_code"].ToString();
                        oclBox.Text = dataRow["branch_name"].ToString();
                        cbBranches.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objIndent = null;
            }
        }