private void FormDepRegisterInput_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.ComboBoxBindDataSource(cbxAgentLevelCode, "AgentLevelCode", "AgentLevelName", "Select * from AgentLevel", "AgentLevel");
            formDepRegister = (FormDepRegister)this.Owner;
            if (this.Tag.ToString() == "Add")
            {
                txtCustomerName.Text            = formDepRegister.tvAgentRecord.SelectedNode.Text;
                cbxAgentLevelCode.SelectedIndex = -1;
                txtYears.Text      = "1";
                dtpBeginDate.Value = DateTime.Today;
                dtpEndDate.Value   = dtpBeginDate.Value.AddYears(Convert.ToInt32(txtYears.Text));
            }
            if (this.Tag.ToString() == "Edit")
            {
                txtCustomerName.Text            = formDepRegister.tvAgentRecord.SelectedNode.Text;
                cbxAgentLevelCode.SelectedValue = formDepRegister.dgvDepRegister.CurrentRow.Cells["AgentLevelCode"].Value.ToString();
                txtLeastMoney.Text = formDepRegister.dgvDepRegister.CurrentRow.Cells["LeastMoney"].Value.ToString();
                txtDiscount.Text   = formDepRegister.dgvDepRegister.CurrentRow.Cells["Discount"].Value.ToString();
                txtYears.Text      = formDepRegister.dgvDepRegister.CurrentRow.Cells["Years"].Value.ToString();
                dtpBeginDate.Value = Convert.ToDateTime(formDepRegister.dgvDepRegister.CurrentRow.Cells["BeginDate"].Value);
                dtpEndDate.Value   = Convert.ToDateTime(formDepRegister.dgvDepRegister.CurrentRow.Cells["EndDate"].Value);
                txtRemark.Text     = formDepRegister.dgvDepRegister.CurrentRow.Cells["Remark"].Value.ToString();
            }
        }
Beispiel #2
0
        private void FormAgentRecordInput_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.ComboBoxBindDataSource(cbxProvinceCode, "ProvinceCode", "ProvinceName", "Select * From Province", "Province");
            formAgentRecord = (FormAgentRecord)this.Owner;
            if (this.Tag.ToString() == "Add")
            {
                cbxProvinceCode.SelectedIndex = -1;
                cbIsCancel.Checked            = false; //添加是默认未取消
            }
            else
            {
                txtCustomerName.Text          = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["CustomerName"].Value.ToString();
                txtJuridicalPerson.Text       = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["JuridicalPerson"].Value.ToString();
                txtPhoneNumber.Text           = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["PhoneNumber"].Value.ToString();
                cbxProvinceCode.SelectedValue = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["ProvinceCode"].Value;
                txtAddress.Text           = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["Address"].Value.ToString();
                txtPostalCode.Text        = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["PostalCode"].Value.ToString();
                txtURL.Text               = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["URL"].Value.ToString();
                txtOpenAccBankName.Text   = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["OpenAccBankName"].Value.ToString();
                txtAccountNumber.Text     = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["AccountNumber"].Value.ToString();
                txtCertificateNumber.Text = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["CertificateNumber"].Value.ToString();
                cbIsCancel.Checked        = useful.GetCheckedValue(formAgentRecord.dgvAgentRecord.CurrentRow.Cells["IsCancel"].Value.ToString());
                txtRemark.Text            = formAgentRecord.dgvAgentRecord.CurrentRow.Cells["Remark"].Value.ToString();
            }
        }
        private void btnQuery_Click(object sender, EventArgs e)
        {
            DifferentMonth.DifferentMonthDataTable dmdt = null;
            ControlBindDataSource cbds = new ControlBindDataSource();

            //判断月份是否合理
            if (dtpStartMonth.Value >= dtpEndMonth.Value)
            {
                MessageBox.Show("开始月份不许大于或等于结束月份!", "软件提示");
                return;
            }
            string strWhere = " Where 1 = 1 ";

            dmdt = this.GetDifferentMonthInfo(strWhere) as DifferentMonth.DifferentMonthDataTable;
            ReportDocument rd = cbds.CrystalReports(@"\UI\ChartAnalyse\CryReprot\CryDifferentMonthSaleAnalyse.rpt", dmdt);

            crvCollect.ReportSource = rd;
            TextObject txtNumValue = rd.ReportDefinition.ReportObjects["txtNumValue"] as TextObject;

            if (rbQuantity.Checked)
            {
                txtNumValue.Text = "销售数量(套)";
            }
            else
            {
                txtNumValue.Text = "销售金额(元)";
            }
            TextObject toDateRange = rd.ReportDefinition.ReportObjects["itoDateRange"] as TextObject;

            toDateRange.Text = "( " + dtpStartMonth.Value.Year.ToString() + "-" + dtpStartMonth.Value.Month.ToString() + " 至 "
                               + dtpEndMonth.Value.Year.ToString() + "-" + dtpEndMonth.Value.Month.ToString() + " )";
        }
        private void FormRetailUntreadBaseBillInput_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.BindDataSource(this);
            useful.InitFormContros(groupBox1, null);
            formRetailUntreadBaseBill = (FormRetailUntreadBaseBill)this.Owner;
            if (this.Tag.ToString() == "Add")
            {
                this.Text             = "添加单据";
                btnCD.Enabled         = false;
                txtUntreadBillNo.Text = useful.BuildCode("UntreadBaseBill", "Where OperatorCode = '" + GlobalProperty.OperatorCode + "'", "UntreadBillNo", "TH" + GlobalProperty.DBTime.Year.ToString(), 7);
            }
            if (this.Tag.ToString() == "Edit")
            {
                this.Text     = "修改单据";
                btnCD.Enabled = true;
                //chbIsAmendBillNo.Enabled = false;
                txtSaleBillNo.Text    = formRetailUntreadBaseBill.dgvUntreadBaseBill.CurrentRow.Cells["SaleBillNo"].Value.ToString();
                txtUntreadBillNo.Text = formRetailUntreadBaseBill.dgvUntreadBaseBill.CurrentRow.Cells["UntreadBillNo"].Value.ToString();
                RetrieveOrderBillInfo(txtSaleBillNo.Text.Trim());
                GetUntreadBillInfo(txtSaleBillNo.Text.Trim());
                txtSaleBillNo.ReadOnly = true;
                txtSaleBillNo.Enabled  = false;
                btnBrowse.Enabled      = false;
            }
        }
        private void FormRetailSaleTradeBillInput_Load(object sender, EventArgs e)
        {
            formRetailSaleTradeBill = (FormRetailSaleTradeBill)this.Owner;
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.ComboBoxBindDataSource(cbxBankCode, "BankCode", "BankName", "Select * From Bank", "Bank");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode1, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode2, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode3, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxGoodsSeriesCode, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.ComboBoxBindDataSource(cbxGoodsTypeCode, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.ComboBoxBindDataSource(cbxPayTypeCode, "PayTypeCode", "PayTypeName", "Select * From PayType", "PayType");
            InitOrderBillControls();
            InitTradeBillControls();
            if (this.Tag.ToString() == "Add")
            {
                this.Text = "添加单据";
            }
            if (this.Tag.ToString() == "Edit")
            {
                this.Text              = "修改单据";
                txtSaleBillNo.Text     = formRetailSaleTradeBill.dgvSaleTradeBill.CurrentRow.Cells["SaleBillNo"].Value.ToString();
                txtSaleBillNo.ReadOnly = true;
                btnBrowse.Enabled      = false;
                SetOrderBillInfo(txtSaleBillNo.Text.Trim());
                SetTradeBillInfo(txtSaleBillNo.Text.Trim());  //是否可以取消检索交易单,直接赋值来提高速度
            }
        }
        private void btnQuery_Click(object sender, EventArgs e)
        {
            AllKinds.AllKindsDataTable akdt = null;
            ControlBindDataSource      cbds = new ControlBindDataSource();

            //判断日期是否合理
            if (dtpStartDate.Value.Date > dtpEndDate.Value.Date)
            {
                MessageBox.Show("开始日期不许大于结束日期!", "软件提示");
                return;
            }
            string strWhere = " Where 1 = 1 ";

            akdt = this.GetAllKindsInfo(strWhere) as AllKinds.AllKindsDataTable;
            ReportDocument rd = cbds.CrystalReports(@"\UI\ChartAnalyse\CryReprot\CryAllkindsSometimeSaleAnalyse.rpt", akdt);

            crvCollect.ReportSource = rd;
            TextObject txtNumValue = rd.ReportDefinition.ReportObjects["txtNumValue"] as TextObject;

            if (rbQuantity.Checked)
            {
                txtNumValue.Text = "销售数量(套)";
            }
            else
            {
                txtNumValue.Text = "销售金额(元)";
            }
            TextObject toDateRange = rd.ReportDefinition.ReportObjects["itoDateRange"] as TextObject;

            toDateRange.Text = "( " + dtpStartDate.Value.Year.ToString() + "-" + dtpStartDate.Value.Month.ToString() + "-" + dtpStartDate.Value.Day.ToString() + " 至 "
                               + dtpEndDate.Value.Year.ToString() + "-" + dtpEndDate.Value.Month.ToString() + "-" + dtpEndDate.Value.Day.ToString() + " )";
        }
Beispiel #7
0
        private void FormAgentRecord_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.DataGridViewComboBoxColumnBindDataSource(ProvinceCode, "ProvinceCode", "ProvinceName", "Select * From Province", "Province");
            bsAgentRecord.DataSource  = ar.GetDataTable("Customer", "Where CustomerType = '1' ");
            dgvAgentRecord.DataSource = bsAgentRecord;
        }
        private void FormRetailUntreadGatherBill_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsTypeCode, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsSeriesCode, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.DataGridViewComboBoxColumnBindDataSource(EmployeeCode2, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.DataGridViewComboBoxColumnBindDataSource(OperatorCode, "OperatorCode", "OperatorName", "Select * From Operator", "Operator");
        }
Beispiel #9
0
        private void FormRetailBarterExchangeBill_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.DataGridViewComboBoxColumnBindDataSource(PayTypeCode, "PayTypeCode", "PayTypeName", "Select * From PayType", "PayType");
            cbds.DataGridViewComboBoxColumnBindDataSource(BankCode, "BankCode", "BankName", "Select * From Bank", "Bank");
            cbds.DataGridViewComboBoxColumnBindDataSource(EmployeeCode2, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.DataGridViewComboBoxColumnBindDataSource(OperatorCode, "OperatorCode", "OperatorName", "Select * From Operator", "Operator");
        }
        private void btnQuery_Click(object sender, EventArgs e)
        {
            string strWhere = String.Empty;

            OperationCollect.OperationCollectDataTable dtCollect = null;
            ControlBindDataSource cbds = new ControlBindDataSource();

            //判断日期是否合理
            if (dtpStartDate.Value.Date > dtpEndDate.Value.Date)
            {
                MessageBox.Show("开始日期不许大于结束日期!", "软件提示");
                return;
            }
            //判断是否选择用户类型
            if (!chbAgent.Checked && !chbNoAgent.Checked)
            {
                MessageBox.Show("请选择一种用户类型!", "软件提示");
                return;
            }
            //只选择代理
            if (chbAgent.Checked && !chbNoAgent.Checked)
            {
                strWhere = " Where Customer.CustomerType = '1' ";
            }
            //只选择普通
            if (!chbAgent.Checked && chbNoAgent.Checked)
            {
                strWhere = " Where (Customer.CustomerType = '2' or Customer.CustomerType = '3') ";
            }
            //同时选中代理和普通
            if (chbAgent.Checked && chbNoAgent.Checked)
            {
                strWhere = " Where (Customer.CustomerType = '1' or Customer.CustomerType = '2' or Customer.CustomerType = '3') ";
            }
            dtCollect = this.GetCollectInfo(strWhere) as OperationCollect.OperationCollectDataTable;
            ReportDocument rd = cbds.CrystalReports(@"\UI\DataReport\CryReprot\CryOperationCollect.rpt", dtCollect);

            crvCollect.ReportSource = rd;
            TextObject toDateRange = rd.ReportDefinition.ReportObjects["itoDateRange"] as TextObject;
            TextObject toPrintDate = rd.ReportDefinition.ReportObjects["itoPrintDate"] as TextObject;
            TextObject toTile      = rd.ReportDefinition.ReportObjects["itoTitle"] as TextObject;

            toDateRange.Text = "( " + dtpStartDate.Value.Year.ToString() + "-" + dtpStartDate.Value.Month.ToString() + "-" + dtpStartDate.Value.Day.ToString() + " 至 "
                               + dtpEndDate.Value.Year.ToString() + "-" + dtpEndDate.Value.Month.ToString() + "-" + dtpEndDate.Value.Day.ToString() + " )";
            toPrintDate.Text = GlobalProperty.DBTime.Date.ToString("yyy-MM-dd");
            foreach (Control con in gbCollectType.Controls)
            {
                if (con.GetType() == typeof(RadioButton))
                {
                    if (((RadioButton)con).Checked)
                    {
                        toTile.Text = "编程词典" + ((RadioButton)con).Text + "表";
                    }
                }
            }
        }
        private void FormBrowseRetailCustomer_Load(object sender, EventArgs e)
        {
            formRetailOperation = (FormRetailSaleOrderBill)this.Owner;
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.ComboBoxBindDataSource(cbxProvinceCode, "ProvinceCode", "ProvinceName", "Select * From Province", "Province");
            cbds.DataGridViewComboBoxColumnBindDataSource(ProvinceCode, "ProvinceCode", "ProvinceName", "Select * From Province", "Province");
            cbds.DataGridViewComboBoxColumnBindDataSource(CustomerType, "CustomerType", "Remark", "Select * From SysCustomerType", "SysCustomerType");
            cbxProvinceCode.SelectedIndex = -1;
        }
Beispiel #12
0
        private void FormBrowseRetailUntreadRefundBill_Load(object sender, EventArgs e)
        {
            formRetailUntreadRefundBill = (FormRetailUntreadRefundBill)this.Owner;
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.BindDataSource(this);
            useful.InitFormContros(this, null);
            dtpAppendDate.Checked       = false;
            dtpUntreadMoneyDate.Checked = false;
        }
        private void FormBrowseRetailBarterExchangeBill_Load(object sender, EventArgs e)
        {
            formRetailBarterExchangeBill = (FormRetailBarterExchangeBill)this.Owner;
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.BindDataSource(this);
            useful.InitFormContros(this, null);
            dtpAppendDate.Checked = false;
            dtpTradeDate.Checked  = false;
        }
Beispiel #14
0
        private void FormBrowseRetailSaleTradeBill_Load(object sender, EventArgs e)
        {
            formRetailSaleTradeBill = (FormRetailSaleTradeBill)this.Owner;
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.ComboBoxBindDataSource(cbxProvinceCode, "ProvinceCode", "ProvinceName", "Select * From Province", "Province");
            cbds.ComboBoxBindDataSource(cbxPayTypeCode, "PayTypeCode", "PayTypeName", "Select * From PayType", "PayType");
            cbds.ComboBoxBindDataSource(cbxBankCode, "BankCode", "BankName", "Select * From Bank", "Bank");
            cbxBankCode.SelectedIndex     = -1;
            cbxPayTypeCode.SelectedIndex  = -1;
            cbxProvinceCode.SelectedIndex = -1;
        }
        private void FormRetailUntreadBaseBill_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsSeriesCode, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsTypeCode, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.DataGridViewComboBoxColumnBindDataSource(EmployeeCode1, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.DataGridViewComboBoxColumnBindDataSource(OperatorCode, "OperatorCode", "OperatorName", "Select * From Operator", "Operator");
            bsUntreadBaseBill.DataSource  = rubb.GetDataTable("UntreadBaseBill", "Where UntreadBillNo is null");
            dgvUntreadBaseBill.DataSource = bsUntreadBaseBill;
            toolStrip1.Tag = "";
        }
Beispiel #16
0
        private void FormBrowseRetailSaleConsignBill_Load(object sender, EventArgs e)
        {
            formRetailSaleConsignBill = (FormRetailSaleConsignBill)this.Owner;
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.ComboBoxBindDataSource(cbxConsignCorpCode, "ConsignCorpCode", "ConsignCorpName", "Select * From ConsignCorp", "ConsignCorp");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode4, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxProvinceCode, "ProvinceCode", "ProvinceName", "Select * From Province", "Province");
            cbxConsignCorpCode.SelectedIndex = -1;
            cbxEmployeeCode4.SelectedIndex   = -1;
            cbxProvinceCode.SelectedIndex    = -1;
            dtpConsignDate.Value             = GlobalProperty.DBTime;
            dtpConsignDate.Checked           = false;
        }
Beispiel #17
0
        private void FormRetailSaleConsignBill_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            //销售订单
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsTypeCode1, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsSeriesCode1, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.DataGridViewComboBoxColumnBindDataSource(ConsignCorpCode, "ConsignCorpCode", "ConsignCorpName", "Select * From ConsignCorp", "ConsignCorp");
            cbds.DataGridViewComboBoxColumnBindDataSource(EmployeeCode4, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.DataGridViewComboBoxColumnBindDataSource(OperatorCode, "OperatorCode", "OperatorName", "Select * From Operator", "Operator");
            //空绑定
            bsSaleConsignBill.DataSource  = rscb.GetDataTable("SaleConsignBill", "Where SaleBillNo is null");
            dgvSaleConsignBill.DataSource = bsSaleConsignBill;
            toolStrip1.Tag = "";
        }
        private void FormRetailOperation_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            //用户的基本信息
            cbds.ComboBoxBindDataSource(cbxProvinceCode, "ProvinceCode", "ProvinceName", "Select * From Province", "Province");
            cbds.ComboBoxBindDataSource(cbxCustomerId, "CustomerId", "CustomerName", "Select * From V_AgentRecord", "V_AgentRecord");
            //销售订单
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsTypeCode, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsSeriesCode, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.DataGridViewComboBoxColumnBindDataSource(OperatorCode, "OperatorCode", "OperatorName", "Select * From Operator", "Operator");
            //空绑定
            bsSaleOrderBill.DataSource  = rsb.GetDataTable("SaleOrderBill", "Where CustomerId = 0");
            dgvSaleOrderBill.DataSource = bsSaleOrderBill;
            toolStrip1.Tag = "";
        }
        private void FormRetailSaleTradeBill_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            //销售订单
            cbds.DataGridViewComboBoxColumnBindDataSource(PayTypeCode, "PayTypeCode", "PayTypeName", "Select * From PayType", "PayType");
            cbds.DataGridViewComboBoxColumnBindDataSource(BankCode, "BankCode", "BankName", "Select * From Bank", "Bank");
            cbds.DataGridViewComboBoxColumnBindDataSource(EmployeeCode1, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.DataGridViewComboBoxColumnBindDataSource(EmployeeCode2, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.DataGridViewComboBoxColumnBindDataSource(EmployeeCode3, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.DataGridViewComboBoxColumnBindDataSource(OperatorCode, "OperatorCode", "OperatorName", "Select * From Operator", "Operator");
            //空绑定
            bsSaleTradeBill.DataSource  = rstb.GetDataTable("SaleTradeBill", "Where SaleBillNo is null");
            dgvSaleTradeBill.DataSource = bsSaleTradeBill;
            toolStrip1.Tag = "";
        }
Beispiel #20
0
        public fmStudent()
        {
            InitializeComponent();
            this.SetDefaultSetting();
            cbxCourse.SetDefaultSetting();
            cbxGrade.SetDefaultSetting();
            cbxYear.SetDefaultSetting();
            cbxStates.SetDefaultSetting();

            ControlBindDataSource.BindCourse(cbxCourse);
            ControlBindDataSource.BindGrade(cbxGrade);
            ControlBindDataSource.BindYear(cbxYear, false, 1);
            ControlBindDataSource.BindStates(cbxStates);

            txtMoney.KeyPress += new KeyPressEventHandler(EventHelper.TextBox_FilterString_KeyPress);
        }
Beispiel #21
0
        private void Form1_Load(object sender, EventArgs e)
        {
            this.SetDefaultSetting();
            this.ShowInTaskbar = true;
            cbxCourse.SetDefaultSetting();
            cbxGrade.SetDefaultSetting();
            cbxYear.SetDefaultSetting();
            cbxStates.SetDefaultSetting();
            dataGridView1.SetDefaultSetting();
            dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;
            ControlBindDataSource.BindCourse(cbxCourse);
            ControlBindDataSource.BindGrade(cbxGrade);
            ControlBindDataSource.BindYear(cbxYear);
            ControlBindDataSource.BindStates(cbxStates);

            BindRegisterList();
        }
        private void FormBrowseRetailSaleOrderBill_Load(object sender, EventArgs e)
        {
            if (this.Owner.GetType() == typeof(FormRetailSaleTradeBillInput))
            {
                formRetailSaleTradeBillInput = (FormRetailSaleTradeBillInput)this.Owner;
                chbIsTrade.Visible           = true;
                strJoinTag = "Inner";
            }
            if (this.Owner.GetType() == typeof(FormRetailSaleOrderBill))
            {
                lbSaleBillNo.Visible    = true;
                txtSaleBillNo.Visible   = true;
                formRetailSaleOrderBill = (FormRetailSaleOrderBill)this.Owner;
                strJoinTag = "Left";
                this.Text  = "用户和订单信息";
            }
            if (this.Owner.GetType() == typeof(FormRetailSaleConsignBillInput))
            {
                chbConsign.Visible             = true;
                formRetailSaleConsignBillInput = (FormRetailSaleConsignBillInput)this.Owner;
                strJoinTag = "Inner";
            }
            if (this.Owner.GetType() == typeof(FormRetailUntreadBaseBillInput))
            {
                txtSaleBillNo.Visible          = true;
                lbSaleBillNo.Visible           = true;
                formRetailUntreadBaseBillInput = (FormRetailUntreadBaseBillInput)this.Owner;
                strJoinTag = "Inner";
            }
            if (this.Owner.GetType() == typeof(FormRetailBarterBaseBillInput))
            {
                formRetailBarterBaseBillInput = (FormRetailBarterBaseBillInput)this.Owner;
                strJoinTag = "Left";
                this.Text  = "用户和订单信息";
            }


            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.ComboBoxBindDataSource(cbxProvinceCode, "ProvinceCode", "ProvinceName", "Select * From Province", "Province");
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsTypeCode, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsSeriesCode, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.DataGridViewComboBoxColumnBindDataSource(EmployeeCode, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbxProvinceCode.SelectedIndex = -1;
        }
        private void FormRetailSaleBill_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.ComboBoxBindDataSource(cbxBankCode, "BankCode", "BankName", "Select * From Bank", "Bank");
            cbds.ComboBoxBindDataSource(cbxConsignCorpCode, "ConsignCorpCode", "ConsignCorpName", "Select * From ConsignCorp", "ConsignCorp");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode1, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode2, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode3, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode4, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode5, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.ComboBoxBindDataSource(cbxGoodsSeriesCode, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.ComboBoxBindDataSource(cbxGoodsSeriesCode1, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.ComboBoxBindDataSource(cbxGoodsTypeCode, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.ComboBoxBindDataSource(cbxGoodsTypeCode1, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.ComboBoxBindDataSource(cbxPayTypeCode, "PayTypeCode", "PayTypeName", "Select * From PayType", "PayType");
            //formRetailOperation = (FormRetailSaleOrderBill)this.Owner;
            //txtCustomerName.Text = formRetailOperation.txtCustomerName.Text;
            //txtPhoneNumber.Text = formRetailOperation.txtPhoneNumber.Text;
            //txtPostalCode.Text = formRetailOperation.txtPostalCode.Text;
            //if (this.Tag.ToString() == "Add")
            //{
            //    cbxGoodsTypeCode.SelectedIndex = -1;
            //    cbxGoodsTypeCode1.SelectedIndex = -1;
            //    cbxGoodsSeriesCode.SelectedIndex = -1;
            //    cbxGoodsSeriesCode1.SelectedIndex = -1;
            //    cbxEmployeeCode1.SelectedIndex = -1;
            //    cbxEmployeeCode2.SelectedIndex = -1;
            //    cbxEmployeeCode3.SelectedIndex = -1;
            //    cbxEmployeeCode4.SelectedIndex = -1;
            //    cbxEmployeeCode5.SelectedIndex = -1;
            //    cbxBankCode.SelectedIndex = -1;
            //    cbxConsignCorpCode.SelectedIndex = -1;
            //    cbxPayTypeCode.SelectedIndex = -1;
            //    txtDiscount.Text = "1";
            //}
            //if (this.Tag.ToString() == "Edit")
            //{

            //}
        }
Beispiel #24
0
        private void FormRetailBarterExchangeBillInput_Load(object sender, EventArgs e)
        {
            formRetailBarterExchangeBill = (FormRetailBarterExchangeBill)this.Owner;
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.BindDataSource(this);
            useful.InitFormContros(this, null);
            if (this.Tag.ToString() == "Add")
            {
                this.Text = "添加单据";
            }
            if (this.Tag.ToString() == "Edit")
            {
                this.Text            = "修改单据";
                txtBarterBillNo.Text = formRetailBarterExchangeBill.dgvBarterExchangeBill.CurrentRow.Cells["BarterBillNo"].Value.ToString();
                RetrieveBarterBaseInfo(txtBarterBillNo.Text);
                GetBarterExchangeInfo(txtBarterBillNo.Text);
                txtBarterBillNo.Enabled = false;
                btnBrowse.Enabled       = false;
            }
        }
Beispiel #25
0
        private void FormBrowseRetailUntreadBaseBillOther_Load(object sender, EventArgs e)
        {
            if (this.Owner.GetType() == typeof(FormRetailUntreadGatherBillInput))
            {
                formRetailUntreadGatherBillInput = (FormRetailUntreadGatherBillInput)this.Owner;
                chbIsGather.Visible = true;
            }
            if (this.Owner.GetType() == typeof(FormRetailUntreadRefundBillInput))
            {
                formRetailUntreadRefundBillInput = (FormRetailUntreadRefundBillInput)this.Owner;
                chbIsRefund.Visible = true;
            }
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.BindDataSource(this);
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsTypeCode, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.DataGridViewComboBoxColumnBindDataSource(GoodsSeriesCode, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.DataGridViewComboBoxColumnBindDataSource(EmployeeCode1, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            cbds.DataGridViewComboBoxColumnBindDataSource(OperatorCode, "OperatorCode", "OperatorName", "Select * From Operator", "Operator");
            useful.InitFormContros(this, null);
            dtpUntreadBillDate.Checked = false;
        }
Beispiel #26
0
        private void FormRetailBarterBaseBillInput_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.BindDataSource(this);
            useful.InitFormContros(groupBox1, null);
            formRetailBarterBaseBill = (FormRetailBarterBaseBill)this.Owner;
            if (this.Tag.ToString() == "Add")
            {
                btnCD.Enabled        = false;
                this.Text            = "添加单据";
                txtBarterBillNo.Text = useful.BuildCode("BarterBaseBill", "Where OperatorCode = '" + GlobalProperty.OperatorCode + "'", "BarterBillNo", "HH" + GlobalProperty.DBTime.Year.ToString(), 7);
            }
            else
            {
                btnCD.Enabled = true;
                this.Text     = "修改单据";
                //chbIsAmendBillNo.Enabled = false;
                txtBarterBillNo.Text = formRetailBarterBaseBill.dgvBarterBaseBill.CurrentRow.Cells["BarterBillNo"].Value.ToString();
                GetBarterBaseBillInfo(txtBarterBillNo.Text);
            }
        }
Beispiel #27
0
        private void FormRetailUntreadGatherBillInput_Load(object sender, EventArgs e)
        {
            formRetailUntreadGatherBill = (FormRetailUntreadGatherBill)this.Owner;
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.BindDataSource(this);
            if (this.Tag.ToString() == "Add")
            {
                this.Text = "添加单据";
                useful.InitFormContros(this, null);
            }
            if (this.Tag.ToString() == "Edit")
            {
                this.Text = "修改单据";
                useful.SetControlsState(groupBox1, false);
                txtUntreadBillNo.Enabled = false;
                btnBrowse.Enabled        = false;
                txtUntreadBillNo.Text    = formRetailUntreadGatherBill.dgvUntreadGatherBill.CurrentRow.Cells["UntreadBillNo"].Value.ToString();
                RetrieveUntreadBaseBillInfo(txtUntreadBillNo.Text.Trim());
                GetUntreadGatherBillInfo(txtUntreadBillNo.Text.Trim());
            }
        }
        private void FormRetailSaleConsignBillInput_Load(object sender, EventArgs e)
        {
            formRetailSaleConsignBill = (FormRetailSaleConsignBill)this.Owner;
            ControlBindDataSource cbds = new ControlBindDataSource();

            //cbds.BindDataSource(gbOrder);
            //cbds.BindDataSource(gbTrade);
            //cbds.BindDataSource(gbConsign);
            cbds.BindDataSource(this);
            useful.InitFormContros(this, null);
            //useful.InitFormContros(gbOrder);
            //useful.InitFormContros(gbTrade);
            //useful.InitFormContros(gbConsign);
            if (this.Tag.ToString() == "Add")
            {
                this.Text     = "添加单据";
                btnCD.Enabled = false;
            }
            if (this.Tag.ToString() == "Edit")
            {
                this.Text              = "修改单据";
                m_SaleConsignBillId    = Convert.ToInt32(formRetailSaleConsignBill.dgvSaleConsignBill.CurrentRow.Cells["Id"].Value);
                btnCD.Enabled          = true;
                txtSaleBillNo.Text     = formRetailSaleConsignBill.dgvSaleConsignBill.CurrentRow.Cells["SaleBillNo"].Value.ToString();
                txtSaleBillNo.ReadOnly = true;
                btnBrowse.Enabled      = false;
                //检索并设置订货单信息
                RetrieveOrderBillInfo(txtSaleBillNo.Text.Trim());
                //检索并设置交易单信息
                RetrieveTradeBillInfo(txtSaleBillNo.Text.Trim());
                //设置发货单信息
                DataTable dt    = formRetailSaleConsignBill.bsSaleConsignBill.DataSource as DataTable;
                Int32     intId = Convert.ToInt32(formRetailSaleConsignBill.dgvSaleConsignBill.CurrentRow.Cells["Id"].Value);
                DataRow   dr    = dt.AsEnumerable().FirstOrDefault(itm => itm.Field <int>("Id") == intId);
                SetConsignBillInfo(dr);
            }
        }
        private void FormRetailSaleOrderBillInput_Load(object sender, EventArgs e)
        {
            ControlBindDataSource cbds = new ControlBindDataSource();

            cbds.ComboBoxBindDataSource(cbxGoodsTypeCode, "GoodsTypeCode", "GoodsTypeName", "Select * From GoodsType", "GoodsType");
            cbds.ComboBoxBindDataSource(cbxGoodsSeriesCode, "GoodsSeriesCode", "GoodsSeriesName", "Select * From GoodsSeries", "GoodsSeries");
            cbds.ComboBoxBindDataSource(cbxEmployeeCode, "EmployeeCode", "EmployeeName", "Select * From Employee", "Employee");
            formRetailSaleOrderBill = (FormRetailSaleOrderBill)this.Owner;
            if (formRetailSaleOrderBill.chbIsAgent.Checked)
            {
                txtCustomerName.Text = formRetailSaleOrderBill.cbxCustomerId.Text;
            }
            else
            {
                txtCustomerName.Text = formRetailSaleOrderBill.txtCustomerName.Text;
            }
            txtPhoneNumber.Text = formRetailSaleOrderBill.txtPhoneNumber.Text;
            txtPostalCode.Text  = formRetailSaleOrderBill.txtPostalCode.Text;
            txtAddress.Text     = formRetailSaleOrderBill.txtAddress.Text;
            if (this.Tag.ToString() == "Add")
            {
                dtpBillDate.Value = GlobalProperty.DBTime;
                dtpSignDate.Value = GlobalProperty.DBTime;
                cbxGoodsTypeCode.SelectedIndex   = -1;
                cbxGoodsSeriesCode.SelectedIndex = -1;
                cbxEmployeeCode.SelectedIndex    = -1;
                txtDiscount.Text   = "1"; //若是代理商的话,默认值为代理的折扣系数。
                txtSaleBillNo.Text = useful.BuildCode("SaleOrderBill", "Where OperatorCode = '" + GlobalProperty.OperatorCode + "'", "SaleBillNo", "XS" + GlobalProperty.DBTime.Year.ToString(), 7);
            }
            if (this.Tag.ToString() == "Edit")
            {
                if (GlobalProperty.OperatorCode != formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["OperatorCode"].Value.ToString())
                {
                    btnSave.Enabled = false; //非本人录入的记录,不允许修改。
                }
                //chbIsAmendBillNo.Enabled = false;
                txtSaleBillNo.Text               = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["SaleBillNo"].Value.ToString();
                dtpBillDate.Value                = Convert.ToDateTime(formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["BillDate"].Value);
                cbxGoodsTypeCode.SelectedValue   = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["GoodsTypeCode"].Value;
                cbxGoodsSeriesCode.SelectedValue = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["GoodsSeriesCode"].Value;
                txtUnitPrice.Text                = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["UnitPrice"].Value.ToString();
                txtDiscount.Text = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["Discount"].Value.ToString();
                txtQuantity.Text = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["Quantity"].Value.ToString();
                if (formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["IsNeedInvoice"].Value.ToString() == "1")  //需要发票
                {
                    rbIsNeedInvoice1.Checked = true;
                    if (formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["WriteOffType"].Value.ToString() == "1")  //个人
                    {
                        chbWriteOffType1.Checked   = true;
                        txtWriteOffName1.Text      = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["WriteOffName"].Value.ToString();
                        txtCertificateNumber1.Text = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["CertificateNumber"].Value.ToString();
                    }
                    else  //单位
                    {
                        chbWriteOffType2.Checked   = true;
                        txtWriteOffName2.Text      = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["WriteOffName"].Value.ToString();
                        txtCertificateNumber2.Text = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["CertificateNumber"].Value.ToString();
                    }
                }
                else  //不需要发票
                {
                    rbIsNeedInvoice0.Checked = true;
                }
                cbxEmployeeCode.SelectedValue = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["EmployeeCode"].Value;

                if (formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["SignDate"].Value == DBNull.Value)
                {
                    dtpSignDate.Checked = false;
                }
                else
                {
                    dtpSignDate.Value = Convert.ToDateTime(formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["SignDate"].Value);
                }
                txtRemark.Text = formRetailSaleOrderBill.dgvSaleOrderBill.CurrentRow.Cells["Remark"].Value.ToString();
            }
        }
        private void btnQuery_Click(object sender, EventArgs e)
        {
            string strCondition        = null;
            string strWhere            = null;
            string strReportFileName   = null;
            string strTableName        = null;
            ControlBindDataSource cbds = new ControlBindDataSource();

            //判断日期是否合理
            if (dtpStartDate.Value.Date > dtpEndDate.Value.Date)
            {
                MessageBox.Show("开始日期不许大于结束日期!", "软件提示");
                return;
            }
            //判断是否选择用户类型
            if (!chbAgent.Checked && !chbNoAgent.Checked)
            {
                MessageBox.Show("请选择一种用户类型!", "软件提示");
                return;
            }
            //只选择代理
            if (chbAgent.Checked && !chbNoAgent.Checked)
            {
                strWhere = " Where Customer.CustomerType = '1' ";
            }
            //只选择普通
            if (!chbAgent.Checked && chbNoAgent.Checked)
            {
                strWhere = " Where (Customer.CustomerType = '2' or Customer.CustomerType = '3') ";
            }
            //同时选中代理和普通
            if (chbAgent.Checked && chbNoAgent.Checked)
            {
                strWhere = " Where (Customer.CustomerType = '1' or Customer.CustomerType = '2' or Customer.CustomerType = '3') ";
            }
            //销售
            if (rbSale.Checked)
            {
                strCondition = "Select SaleOrderBill.* From SaleOrderBill,Customer " + strWhere + " and SaleOrderBill.CustomerId = Customer.CustomerId and SaleOrderBill.SaleBillNo in (Select SaleTradeBill.SaleBillNo From SaleTradeBill) ";
                if (dtpStartDate.Checked)
                {
                    strCondition += " and SaleOrderBill.BillDate >= '" + dtpStartDate.Value.ToString("yyyy-MM-dd") + "' ";
                }
                if (dtpStartDate.Checked)
                {
                    strCondition += " and SaleOrderBill.BillDate <= '" + dtpEndDate.Value.ToString("yyyy-MM-dd") + "' ";
                }
                strReportFileName = "CrySaleList.rpt";
                strTableName      = "SaleOrderBill";
            }
            //退货
            if (rbUntread.Checked)
            {
                strCondition = "Select UntreadBaseBill.* From UntreadBaseBill,Customer " + strWhere + " and UntreadBaseBill.CustomerId = Customer.CustomerId ";
                if (dtpStartDate.Checked)
                {
                    strCondition += " and UntreadBaseBill.UntreadBillDate >= '" + dtpStartDate.Value.ToString("yyyy-MM-dd") + "' ";
                }
                if (dtpStartDate.Checked)
                {
                    strCondition += " and UntreadBaseBill.UntreadBillDate <= '" + dtpEndDate.Value.ToString("yyyy-MM-dd") + "' ";
                }
                strReportFileName = "CryUntreadList.rpt";
                strTableName      = "UntreadBaseBill";
            }
            //调货
            if (rbBarter.Checked)
            {
                strCondition = "Select BarterBaseBill.* From BarterBaseBill,Customer " + strWhere + " and BarterBaseBill.CustomerId = Customer.CustomerId ";
                if (dtpStartDate.Checked)
                {
                    strCondition += " and BarterBaseBill.BarterBillDate >= '" + dtpStartDate.Value.ToString("yyyy-MM-dd") + "' ";
                }
                if (dtpStartDate.Checked)
                {
                    strCondition += " and BarterBaseBill.BarterBillDate <= '" + dtpEndDate.Value.ToString("yyyy-MM-dd") + "' ";
                }
                strReportFileName = "CryBarterList.rpt";
                strTableName      = "BarterBaseBill";
            }


            ReportDocument rd = cbds.CrystalReports(@"\UI\DataReport\CryReprot\" + strReportFileName, strCondition, strTableName);

            crvList.ReportSource = rd;  //显示数据
            TextObject toDateRange = rd.ReportDefinition.ReportObjects["itoDateRange"] as TextObject;
            TextObject toPrintDate = rd.ReportDefinition.ReportObjects["itoPrintDate"] as TextObject;

            toDateRange.Text = "( " + dtpStartDate.Value.Year.ToString() + "-" + dtpStartDate.Value.Month.ToString() + "-" + dtpStartDate.Value.Day.ToString() + " 至 "
                               + dtpEndDate.Value.Year.ToString() + "-" + dtpEndDate.Value.Month.ToString() + "-" + dtpEndDate.Value.Day.ToString() + " )";
            toPrintDate.Text = GlobalProperty.DBTime.Date.ToString("yyy-MM-dd");
        }