Beispiel #1
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;
        }
Beispiel #2
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;
        }
        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 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 #5
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 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 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;
        }
        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")
            //{

            //}
        }
        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();
            }
        }