コード例 #1
0
        private void FillBranchGroupData()
        {
            IndentDB objIndent = new IndentDB();

            try
            {
                cbGroup.DataSource = null;
                cbGroup.Items.Clear();
                DataTable dtGroup = objIndent.IndentGroupList_Get(CommonData.CompanyCode.ToString(), CommonData.BranchCode, CommonData.DocMonth).Tables[0];
                if (dtGroup.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dtGroup.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        string[]            ename  = dataRow["ENAME"].ToString().Split('~');
                        oclBox.Tag  = dataRow["ENAME"].ToString();
                        oclBox.Text = dataRow["GroupName"].ToString();
                        cbGroup.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
                dtGroup = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objIndent = null;
            }
        }
コード例 #2
0
        private void FillBranchGroupData()
        {
            IndentDB objIndent         = new IndentDB();
            string   strStockPointCode = string.Empty;

            try
            {
                if (cbBranches.SelectedIndex > -1)
                {
                    strStockPointCode = ((NewCheckboxListItem)(cbBranches.SelectedItem)).Tag.ToString();
                }

                cbGroup.DataSource = null;
                cbGroup.Items.Clear();
                DataTable dtGroup = objIndent.IndentGroupList_Get(CommonData.CompanyCode.ToString(), strStockPointCode, CommonData.DocMonth).Tables[0];
                DataRow   dr      = dtGroup.NewRow();
                dr[0] = "0";
                dr[1] = "Select";
                dtGroup.Rows.InsertAt(dr, 0);
                dr = null;
                if (dtGroup.Rows.Count > 0)
                {
                    foreach (DataRow dataRow in dtGroup.Rows)
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["ENAME"].ToString();
                        oclBox.Text = dataRow["GroupName"].ToString();
                        cbGroup.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
                dtGroup = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objIndent = null;
            }
        }