コード例 #1
0
        private void FillUserBranch()
        {
            objUtil = new UtilityDB();
            try
            {
                DataTable dtUB = objUtil.dtUserBranch(txtUserId.Text.ToString());
                //if (dtUB.Rows.Count == 0)
                dtUB.Rows.Add(CommonData.BranchCode + '@' + CommonData.CompanyCode + '@' + CommonData.BranchName + '@' + CommonData.CompanyName + '@' + CommonData.StateCode, CommonData.BranchName);


                cbUserBranch.DisplayMember = "branch_name";
                cbUserBranch.ValueMember   = "branch_Code";
                cbUserBranch.DataSource    = dtUB;

                //cbUserBranch.SelectedValue = CommonData.BranchCode + '@' + CommonData.CompanyCode + '@' + CommonData.BranchName + '@' + CommonData.CompanyName + '@' + CommonData.StateCode;

                dtUB = null;
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objUtil = null;
            }
        }
コード例 #2
0
        private void FillBranchData()
        {
            objUtil = new UtilityDB();
            DataTable dtUB = new DataTable();

            try
            {
                dtUB = objUtil.dtUserBranch(CommonData.LogUserId);
                //if (dtUB.Rows.Count == 0)
                //dtUB.Rows.Add(CommonData.BranchCode + '@' + CommonData.CompanyCode + '@' + CommonData.BranchName + '@' + CommonData.CompanyName, CommonData.BranchName);

                cbUserBranch.DisplayMember = "branch_name";
                cbUserBranch.ValueMember   = "branch_Code";
                cbUserBranch.DataSource    = dtUB;
                cbUserBranch.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objUtil = null;
                dtUB    = null;
            }
        }
コード例 #3
0
        private void FillBranchList()
        {
            objUtil = new UtilityDB();
            DataTable dt = null;

            //string sqlText = "";
            try
            {
                if (strRep == "STOCKPOINT_DC" || strRep == "STOCKPOINT_DCST" || strRep == "STOCKPOINT_GRN" || strRep == "STOCK_REC" || strRep == "STOCK_SUMMARY" || strRep == "STOCK_LEDGER" || strRep == "STOCKPOINT_RECONSILATION" || strRep == "SP_PENDING_DC")
                {
                    dt = objUtil.UserBranch(CommonData.LogUserId, "SP");
                }
                else if (strRep == "VEHICLE_LOAN" || strRep == "VEHICLE_INFO" || strRep == "SALES_STAFF_ALL" || strRep == "SaleSummaryBulletin" || strRep == "SERVICE_CONSOLIDATION")
                {
                    dt = objUtil.UserBranch(CommonData.LogUserId, "BR");
                }
                else
                {
                    dt = objUtil.dtUserBranch(CommonData.LogUserId);
                }
                clbGLList.Items.Clear();
                foreach (DataRow dataRow in dt.Rows)
                {
                    if (dataRow["branch_Code"] + "" != "")
                    {
                        NewCheckboxListItem oclBox = new NewCheckboxListItem();
                        oclBox.Tag  = dataRow["branch_Code"].ToString();
                        oclBox.Text = dataRow["branch_name"].ToString();
                        clbGLList.Items.Add(oclBox);
                        oclBox = null;
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                objStfLvl = null;
            }
        }