123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.MainBusiness.CameraControlBook.SuperSmallForm
- {
- public partial class ServicePaymentSuperSmallForm : LYFZ.Software.UI.CameraControlBook.SuperSmallForm.ServicePaymentSuperSmallForm
- {
- public ServicePaymentSuperSmallForm()
- {
- this.btnSelect2.Click += btnSelect2_Click;
- this.btnSet2.Click += btnSet2_Click;
- }
- public string StrServerText = "";
- public decimal IntAmount = 0;
- public decimal OutAmount = 0;
- public string OutRemark = "";
- public string OutName = "";
- public string SaleMan = "";
- public string TwoSaleCategory = "";
- public bool IsSave = false;
- /// <summary>
- /// 窗体加载事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void ServicePaymentSuperSmallForm_Load(object sender, EventArgs e)
- {
- this.txtName.Text = this.StrServerText.Trim();
- this.BindPay_TwoPinsCategory();
- if (this.IntAmount > 0)
- { this.txtAmount.Text = this.IntAmount.ToString().Trim(); }
- }
- /// <summary>
- /// 输入事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void txtAmount_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (Convert.ToString(e.KeyChar) == ".")
- { }
- else if (!Char.IsNumber(e.KeyChar) && !Char.IsControl(e.KeyChar))
- { e.Handled = true; }
- }
- /// <summary>
- /// 确定
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnOK_Click(object sender, EventArgs e)
- {
- if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
- {
- if (!string.IsNullOrEmpty(this.txtAmount.Text.Trim()))
- {
- if (!string.IsNullOrEmpty(this.txtPay_OpenSingle.Text.Trim()))
- {
- if (!string.IsNullOrEmpty(this.cmbPay_TwoPinsCategory.Text.Trim()))
- {
- if (LYFZ.Command.Command_Validate.IsNumeric(this.txtAmount.Text.Trim()))
- {
- this.TwoSaleCategory = this.cmbPay_TwoPinsCategory.SelectedValue.ToString();
- this.SaleMan = this.txtPay_OpenSingle.Tag.ToString().Trim();
- this.OutName = this.txtName.Text.Trim();
- this.OutAmount = Convert.ToDecimal(this.txtAmount.Text.Trim());
- this.OutRemark = this.txtRemark.Text.Trim();
- this.IsSave = true;
- this.Close();
- }
- }
- else
- { MessageBoxCustom.Show("二销类别不能为空"); }
- }
- else
- { MessageBoxCustom.Show("销售人员不能为空"); }
- }
- else
- { MessageBoxCustom.Show("收款金额不能为空"); }
- }
- else
- { MessageBoxCustom.Show("收款项目不能为空"); }
- }
- /// <summary>
- /// 取消
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected override void btnCancel_Click(object sender, EventArgs e)
- { this.Close(); }
- /// <summary>
- /// 选择接单人
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSelect2_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.FinancialManagement.OrdersReceivables.FrmSelectPayOpenSingle set = new FinancialManagement.OrdersReceivables.FrmSelectPayOpenSingle();
- set.ShowDialog();
- if (!string.IsNullOrEmpty(set.Str1))
- {
- this.txtPay_OpenSingle.Text = set.Str1;
- this.txtPay_OpenSingle.Tag = set.Str2;
- }
- }
- /// <summary>
- /// 设置
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void btnSet2_Click(object sender, EventArgs e)
- {
- LYFZ.Software.MainBusiness.InitialSet.FrmSystemSet set = new InitialSet.FrmSystemSet();
- set.TypeName = "BEBACDAJDFDDEACGJ";
- set.Version = "Version";
- if (set.ShowDialog() == DialogResult.OK)
- { this.BindPay_TwoPinsCategory(); }
- }
- /// <summary>
- /// 绑定二销类别
- /// </summary>
- public void BindPay_TwoPinsCategory()
- {
- DataTable dt = new DataTable();
- LYFZ.BLL.BLL_ErpSystemCategory SystemCategorybll = new BLL.BLL_ErpSystemCategory();
- DataTable dt2 = new DataTable();
- dt2 = new DataTable();
- dt2 = SystemCategorybll.GetList("Sc_ClassCode='BEBACDAJDFDDEACGJ'").Tables[0];
- dt = SystemCategorybll.GetList("Sc_ClassParentID=" + dt2.Rows[0]["ID"] + "and Sc_ClassCode!='BEBCADBFBCDFBGJHC' and Sc_ClassCode!='BEBCADBFBDDEGGABF' and Sc_ClassCode!='BEBCBFBICGDHCGBEJ' and Sc_ClassCode!='BEBCABBAAICBDHDHI' and Sc_ClassCode!='BEBCABBAAICJAAGDG' and Sc_ClassCode!='BEBCBFBICFCECBHFF' ").Tables[0];
- this.cmbPay_TwoPinsCategory.DataSource = dt;
- this.cmbPay_TwoPinsCategory.ValueMember = "Sc_ClassCode";
- this.cmbPay_TwoPinsCategory.DisplayMember = "Sc_ClassName";
- DataRow dr = dt.NewRow();
- dr["Sc_ClassCode"] = "-1";
- dr["Sc_ClassName"] = "";
- dt.Rows.InsertAt(dr, 0);
- this.cmbPay_TwoPinsCategory.SelectedIndex = 0;
- }
- }
- }
|