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;
using CoreFS.CA06;
using Core.Mes.Client.Comm.Server;
using Core.Mes.Client.Comm.Control;
using Core.StlMes.Client.SaleComm;
using Infragistics.Win.UltraWinGrid;
using Core.Mes.Client.Comm.Tool;
using System.Collections;
using System.IO;
namespace Core.StlMes.Client.SaleBase
{
public partial class FrmBuyerOrder : FrmBase
{
OpeBase ob = new OpeBase();
bool blValidating = false; // 验证状态返回 LX
string customer_no = "";//客户编码
public string Customer_no
{
get { return customer_no; }
set { customer_no = value; }
}
string sale_org = "";//销售组织
public string Sale_org
{
get { return sale_org; }
set { sale_org = value; }
}
string custm_use = "";//用途类型
public string Custm_use
{
get { return custm_use; }
set { custm_use = value; }
}
string strOperator = "";//登录名称
public string StrOperator
{
get { return strOperator; }
set { strOperator = value; }
}
string chn_fl = "";//国内/国外
public string Chn_fl
{
get { return chn_fl; }
set { chn_fl = value; }
}
string bigarea = "";//行政片区
public string Bigarea
{
get { return bigarea; }
set { bigarea = value; }
}
string region_no = "";//省市/区域
public string Region_no
{
get { return region_no; }
set { region_no = value; }
}
//查询结果
private DataTable _dtBuerOrder;
public FrmBuyerOrder(OpeBase ops)
{
this.ob = ops;
InitializeComponent();
}
private void FrmBuyerOrder_Load(object sender, EventArgs e)
{
load();//初始化
DataTable table = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryOrderunitDj", new Object[] { customer_no, sale_org, custm_use }, this.ob);
_dtBuerOrder = table;
if (table.Rows.Count > 0)
{
//主界面点击修改查询该条数据加载到对应控件文本内。
this.cmbCustomerType.Text = table.Rows[0]["CUSTM_CTGRY"].ToString();
this.cmbCustoRating.Text = table.Rows[0]["CUSTM_LVL"].ToString();
this.cmbCustoNature.Text = table.Rows[0]["CUSTM_PRPTY"].ToString();
this.textACCOUNT.Text = table.Rows[0]["ACCOUNT"].ToString();
this.textADDRESS.Text = table.Rows[0]["ADDRESS"].ToString();
this.textAGENT.Text = table.Rows[0]["AGENT"].ToString();
this.textBANK.Text = table.Rows[0]["BANK"].ToString();
this.textFAX.Text = table.Rows[0]["FAX"].ToString();
this.textLEGAL_PSN.Text = table.Rows[0]["LEGAL_PSN"].ToString();
this.customer_nm.Text = table.Rows[0]["CUSTOMER_NM"].ToString();
this.textMEMO.Text = table.Rows[0]["MEMO"].ToString();
this.textPHONE.Text = table.Rows[0]["PHONE"].ToString();
this.textTAX_ID.Text = table.Rows[0]["TAX_ID"].ToString();
this.textZIP_CODE.Text = table.Rows[0]["ZIP_CODE"].ToString();
this.ultraText.Text = table.Rows[0]["CUSTM_DATA"].ToString();
if (!string.IsNullOrEmpty(table.Rows[0]["CUSTM_DATA"].ToString().Trim()))
{
try
{
ctrlFileDown1.FilePath = "sale/buyer/" + customer_no;//路径
}
catch (Exception ex)
{
}
}
}
else
{
table = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueyPubuleCustomer", new Object[] { customer_no, sale_org }, this.ob);
if (table.Rows.Count > 0)
{
this.textPHONE.Text = table.Rows[0]["PHONE"].ToString();
this.textFAX.Text = table.Rows[0]["FAX"].ToString();
this.textZIP_CODE.Text = table.Rows[0]["ZIP_CODE"].ToString();
this.textAGENT.Text = table.Rows[0]["CONSIGNEE"].ToString();
this.customer_nm.Text = table.Rows[0]["CUSTOMER_NM"].ToString();
this.textADDRESS.Text = table.Rows[0]["ADDRESS"].ToString();
}
}
}
private void load()
{
DataTable isx = new DataTable();
DataTable unLoad = new DataTable();
unLoad.Columns.Add("Name", typeof(System.String));
unLoad.Columns.Add("Code", typeof(System.String));
////销售区域
//this.cmbArea.DataSource = null;
//isx = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryOrder", new Object[] { sale_org }, this.ob);
//this.cmbArea.DataSource = isx;
//cmbArea.DisplayMember = "SALE_AREA_DESC";
//cmbArea.ValueMember = "SALE_AREA_NO";
/*客户类别:1003
客户性质:1004
客户等级:1005*/
isx = new DataTable();
this.cmbCustomerType.DataSource = null;
isx = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryBaseInfo", new Object[] { "1003" }, this.ob);
unLoad = new DataTable();
unLoad.Columns.Add("Name", typeof(System.String));
unLoad.Columns.Add("Code", typeof(System.String));
for (int i = 0; i < isx.Rows.Count; i++)
{
unLoad.Rows.Add(isx.Rows[i]["BASENAME"].ToString(), isx.Rows[i]["BASECODE"].ToString());
}
if (isx.Rows.Count > 0)
{
unLoad.Columns["Name"].Caption = "客户名称";
unLoad.Columns["Code"].Caption = "客户编码";
this.cmbCustomerType.DataSource = unLoad;
DataRow dr = unLoad.NewRow();
cmbCustomerType.DataSource = unLoad;
cmbCustomerType.DisplayMember = "Name";
cmbCustomerType.ValueMember = "Code";
}
isx = new DataTable();
this.cmbCustoRating.DataSource = null;
isx = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryBaseInfo", new Object[] { "1005" }, this.ob);
unLoad = new DataTable();
unLoad.Columns.Add("Name", typeof(System.String));
unLoad.Columns.Add("Code", typeof(System.String));
for (int i = 0; i < isx.Rows.Count; i++)
{
unLoad.Rows.Add(isx.Rows[i]["BASENAME"].ToString(), isx.Rows[i]["BASECODE"].ToString());
}
if (isx.Rows.Count > 0)
{
unLoad.Columns["Name"].Caption = "客户名称";
unLoad.Columns["Code"].Caption = "客户编码";
this.cmbCustoRating.DataSource = unLoad;
DataRow dr = unLoad.NewRow();
cmbCustoRating.DataSource = unLoad;
cmbCustoRating.DisplayMember = "Name";
cmbCustoRating.ValueMember = "Code";
}
isx = new DataTable();
this.cmbCustoNature.DataSource = null;
isx = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryBaseInfo", new Object[] { "1004" }, this.ob);
unLoad = new DataTable();
unLoad.Columns.Add("Name", typeof(System.String));
unLoad.Columns.Add("Code", typeof(System.String));
for (int i = 0; i < isx.Rows.Count; i++)
{
unLoad.Rows.Add(isx.Rows[i]["BASENAME"].ToString(), isx.Rows[i]["BASECODE"].ToString());
}
if (isx.Rows.Count > 0)
{
unLoad.Columns["Name"].Caption = "客户名称";
unLoad.Columns["Code"].Caption = "客户编码";
this.cmbCustoNature.DataSource = unLoad;
DataRow dr = unLoad.NewRow();
cmbCustoNature.DataSource = unLoad;
cmbCustoNature.DisplayMember = "Name";
cmbCustoNature.ValueMember = "Code";
}
//到站信息
this.comBoStation.DataSource = null;
isx = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetSlmBaseStation", new Object[] { }, this.ob);
this.comBoStation.DataSource = isx;
comBoStation.DisplayMember = "STATION_NM";
comBoStation.ValueMember = "STATION_NO";
//运输方式
this.ultraComboys.DataSource = null;
isx = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryBaseInfo", new Object[] { "1105" }, this.ob);
this.ultraComboys.DataSource = isx;
ultraComboys.DisplayMember = "BASENAME";
ultraComboys.ValueMember = "BASECODE";
//专用线路
this.comboSPCL.DataSource = null;
isx = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetSlmBasesPclLn", new Object[] { }, this.ob);
this.comboSPCL.DataSource = isx;
comboSPCL.DisplayMember = "SPCL_LN_NM";
comboSPCL.ValueMember = "SPCL_LN_NO";
}
private void ultraToolbarsOrder_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
{
switch (e.Tool.Key)
{
case "Save":
if (_dtBuerOrder.Rows.Count > 0)
{
if (_dtBuerOrder.Rows[0]["SALE_ORG"].ToString() != UserInfo.SaleOrg)
{
MessageUtil.ShowWarning("该条记录不是您所在的销售组织创建,无法进行修改!");
return;
}
}
ultraTabControl2.Focus();
if (blValidating == true)
return;
int countTable = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryOrderunitDj",
new Object[] { customer_no, sale_org, custm_use }, this.ob).Rows.Count;
if (countTable > 0)
{
//修改该条数据
string custmctgryName = this.cmbCustomerType.Text.Trim();
string custmctgryCode = this.cmbCustomerType.Value == null ? "" : this.cmbCustomerType.Value.ToString();
string custmlvlName = this.cmbCustoRating.Text.Trim();
string custmlvlCode = this.cmbCustoRating.Value == null ? "" : this.cmbCustoRating.Value.ToString();
string custmprptyName = this.cmbCustoNature.Text.Trim();
string custmprptyCode = this.cmbCustoNature.Value == null ? "" : this.cmbCustoNature.Value.ToString();
string account = this.textACCOUNT.Text.Trim();
string address = this.textADDRESS.Text.Trim();
string agent = this.textAGENT.Text.Trim();
string bank = this.textBANK.Text.Trim();
string fax = this.textFAX.Text.Trim();
string legalpsn = this.textLEGAL_PSN.Text.Trim();
string memo = this.textMEMO.Text.Trim();
string phone = this.textPHONE.Text.Trim();
string taxid = this.textTAX_ID.Text.Trim();
string zipcode = this.textZIP_CODE.Text.Trim();
if (string.IsNullOrEmpty(custmctgryName))
{
MessageUtil.ShowTips("请选择客户类别!");
return;
}
if (string.IsNullOrEmpty(custmlvlName) && sale_org != "100102")
{
MessageUtil.ShowTips("请选择客户等级!");
return;
}
if (string.IsNullOrEmpty(custmprptyName) && sale_org != "100102")
{
MessageUtil.ShowTips("请选择客户性质!");
return;
}
if (string.IsNullOrEmpty(legalpsn) && sale_org != "100102")
{
MessageUtil.ShowTips("法人不能为空!");
return;
}
//if (string.IsNullOrEmpty(agent))
//{
// MessageUtil.ShowTips("代理人不能为空!");
// return;
//}
if (string.IsNullOrEmpty(account) && sale_org != "100102")
{
MessageUtil.ShowTips("帐号不能为空!");
return;
}
if (string.IsNullOrEmpty(zipcode) && sale_org != "100102")
{
MessageUtil.ShowTips("邮编不能为空!");
return;
}
//if (string.IsNullOrEmpty(account))
//{
// MessageUtil.ShowTips("地址不能为空!");
// return;
//}
if (string.IsNullOrEmpty(taxid) && sale_org != "100102")
{
MessageUtil.ShowTips("税号不能为空!");
return;
}
if (string.IsNullOrEmpty(bank) && sale_org != "100102")
{
MessageUtil.ShowTips("开户银行不能为空!");
return;
}
//if (string.IsNullOrEmpty(fax))
//{
// MessageUtil.ShowTips("传真不能为空!");
// return;
//}
ArrayList parm = new ArrayList();
parm.Add(custmctgryCode);
parm.Add(custmprptyCode);
parm.Add(custmlvlCode);
parm.Add(legalpsn);
parm.Add(agent);
parm.Add(address);
parm.Add(region_no);
parm.Add(zipcode);
parm.Add(bank);
parm.Add(account);
parm.Add(taxid);
parm.Add(phone);
parm.Add(fax);
parm.Add(memo);
parm.Add(strOperator);
parm.Add(this.ultraText.Text.Trim());
parm.Add(customer_no);
parm.Add(sale_org);
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerOrder";
ccp.MethodName = "SetUpdateCustmFreight";
ccp.ServerParams = new object[] { parm };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
parm = new ArrayList();
parm.Add(customer_no);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerOrder";
ccp.MethodName = "GetDeleteFreight";
ccp.ServerParams = new object[] { parm };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
//ultraGridOrder.UpdateData();
//foreach (UltraGridRow ugr in this.ultraGridOrder.Rows)
//{
// if (ugr.Cells["CD"].Value.ToString().ToLower() == "true")
// {
// /*customer_no, freight_no, address, station_no, spcl_ln_no,
// trans_typ, memo, create_name, create_time*/
// parm = new ArrayList();
// parm.Add(customer_no);
// parm.Add(sale_org);
// parm.Add(customer_no);
// parm.Add(customer_no);
// parm.Add(ugr.Cells["ADDRESS"].Value.ToString() == "" ? " " : ugr.Cells["ADDRESS"].Value.ToString());
// parm.Add(ugr.Cells["STATION_NO"].Value.ToString() == "" ? " " : ugr.Cells["STATION_NO"].Value.ToString());
// parm.Add(ugr.Cells["SPCL_LN_NO"].Value.ToString() == "" ? " " : ugr.Cells["SPCL_LN_NO"].Value.ToString());
// parm.Add(ugr.Cells["TRANS_TYP"].Value.ToString() == "" ? " " : ugr.Cells["TRANS_TYP"].Value.ToString());
// parm.Add(ugr.Cells["MEMO"].Value.ToString() == "" ? " " : ugr.Cells["MEMO"].Value.ToString());
// parm.Add(strOperator);
// ccp = new CoreClientParam();
// ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerOrder";
// ccp.MethodName = "SetInsertCustmFreight";
// ccp.ServerParams = new object[] { parm };
// ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
// }
//}
if (ccp.ReturnCode == 0)
{
MessageUtil.ShowTips("更新成功!");
this.Close();
}
}
else
{
ArrayList parm = new ArrayList();
CoreClientParam ccp = new CoreClientParam();
int countMuseCount = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetSlmCustMuseCount", new Object[] { customer_no, sale_org, custm_use }, this.ob).Rows.Count;
if (countMuseCount == 0)
{
parm.Add(customer_no);
parm.Add(sale_org);
parm.Add(custm_use);
parm.Add(strOperator);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerSend";
ccp.MethodName = "GetInsertCustmUse";
ccp.ServerParams = new object[] { parm };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
if (ccp.ReturnCode == 0 || countMuseCount>0)
{
/*customer_no, sale_org, custm_use, chn_fl, custm_ctgry,
custm_prpty, custm_lvl, legal_psn, AGENT, address, bigarea,
region_no, disarea, zip_code, bank, ACCOUNT, tax_id, phone, fax,
memo, create_name, create_time
*/
string custmctgryName = this.cmbCustomerType.Text.Trim();
string custmctgryCode = this.cmbCustomerType.Value == null ? "" : this.cmbCustomerType.Value.ToString();
string custmlvlName = this.cmbCustoRating.Text.Trim();
string custmlvlCode = this.cmbCustoRating.Value == null ? "" : this.cmbCustoRating.Value.ToString();
string custmprptyName = this.cmbCustoNature.Text.Trim();
string custmprptyCode = this.cmbCustoNature.Value == null ? "" : this.cmbCustoNature.Value.ToString();
string account = this.textACCOUNT.Text.Trim();
string address = this.textADDRESS.Text.Trim();
string agent = this.textAGENT.Text.Trim();
string bank = this.textBANK.Text.Trim();
string fax = this.textFAX.Text.Trim();
string legalpsn = this.textLEGAL_PSN.Text.Trim();
string memo = this.textMEMO.Text.Trim();
string phone = this.textPHONE.Text.Trim();
string taxid = this.textTAX_ID.Text.Trim();
string zipcode = this.textZIP_CODE.Text.Trim();
if (string.IsNullOrEmpty(custmctgryName))
{
MessageUtil.ShowTips("请选择客户类别!");
return;
}
if (string.IsNullOrEmpty(custmlvlName) && sale_org != "100102")
{
MessageUtil.ShowTips("请选择客户等级!");
return;
}
if (string.IsNullOrEmpty(custmprptyName) && sale_org != "100102")
{
MessageUtil.ShowTips("请选择客户性质!");
return;
}
if (string.IsNullOrEmpty(legalpsn) && sale_org != "100102")
{
MessageUtil.ShowTips("法人不能为空!");
return;
}
if (string.IsNullOrEmpty(agent) && sale_org != "100102")
{
MessageUtil.ShowTips("代理人不能为空!");
return;
}
if (string.IsNullOrEmpty(account) && sale_org != "100102")
{
MessageUtil.ShowTips("帐号不能为空!");
return;
}
if (string.IsNullOrEmpty(zipcode) && sale_org != "100102")
{
MessageUtil.ShowTips("邮编不能为空!");
return;
}
//if (string.IsNullOrEmpty(account))
//{
// MessageUtil.ShowTips("地址不能为空!");
// return;
//}
if (string.IsNullOrEmpty(taxid) && sale_org != "100102")
{
MessageUtil.ShowTips("税号不能为空!");
return;
}
if (string.IsNullOrEmpty(bank) && sale_org != "100102")
{
MessageUtil.ShowTips("开户银行不能为空!");
return;
}
//if (string.IsNullOrEmpty(fax))
//{
// MessageUtil.ShowTips("传真不能为空!");
// return;
//}
parm = new ArrayList();
parm.Add(customer_no);
parm.Add(sale_org);
parm.Add(custm_use);
parm.Add(chn_fl);
parm.Add(custmctgryCode);
parm.Add(custmprptyCode);
parm.Add(custmlvlCode);
parm.Add(legalpsn);
parm.Add(agent);
parm.Add(address);
parm.Add(bigarea);
parm.Add(region_no);
parm.Add(zipcode);
parm.Add(bank);
parm.Add(account);
parm.Add(taxid);
parm.Add(phone);
parm.Add(fax);
parm.Add(memo);
parm.Add(strOperator);
parm.Add(this.ultraText.Text.Trim());
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerOrder";
ccp.MethodName = "SetInsertOrderunit";
ccp.ServerParams = new object[] { parm };
ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
//if (ccp.ReturnCode == 0)
//{
// ultraGridOrder.UpdateData();
// foreach (UltraGridRow ugr in this.ultraGridOrder.Rows)
// {
// if (ugr.Cells["CD"].Value.ToString().ToLower() == "true")
// {
// /*customer_no, freight_no, address, station_no, spcl_ln_no,
// trans_typ, memo, create_name, create_time*/
// parm = new ArrayList();
// parm.Add(customer_no);
// parm.Add(sale_org);
// parm.Add(customer_no);
// parm.Add(customer_no);
// parm.Add(ugr.Cells["ADDRESS"].Value.ToString() == "" ? " " : ugr.Cells["ADDRESS"].Value.ToString());
// parm.Add(ugr.Cells["STATION_NO"].Value.ToString() == "" ? " " : ugr.Cells["STATION_NO"].Value.ToString());
// parm.Add(ugr.Cells["SPCL_LN_NO"].Value.ToString() == "" ? " " : ugr.Cells["SPCL_LN_NO"].Value.ToString());
// parm.Add(ugr.Cells["TRANS_TYP"].Value.ToString() == "" ? " " : ugr.Cells["TRANS_TYP"].Value.ToString());
// parm.Add(ugr.Cells["MEMO"].Value.ToString() == "" ? " " : ugr.Cells["MEMO"].Value.ToString());
// parm.Add(strOperator);
// try
// {
// ccp = new CoreClientParam();
// ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerOrder";
// ccp.MethodName = "SetInsertCustmFreight";
// ccp.ServerParams = new object[] { parm };
// ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
// }
// catch (Exception ex)
// {
// throw ex;
// }
// }
// }
//}
}
if (ccp.ReturnCode == -1)
{
MessageUtil.ShowTips("新增失败!");
}
else
{
MessageUtil.ShowTips("新增成功!");
this.Close();
}
}
break;
case "Esc":
this.Close();
break;
}
}
private void ultraText_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
{
string messageLabel = "sale/buyer/" + customer_no;
if(FlileUploadcomm.FlileUpload(messageLabel))
{
ultraText.Text = messageLabel;
try
{
ctrlFileDown1.FilePath = "sale/buyer/" + customer_no;
}
catch (Exception ex)
{
}
}
}
///
/// 法人录入验证
///
///
///
private void textLEGAL_PSN_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textLEGAL_PSN.Text) > 20)
{
MessageBox.Show("录入法人【中文名不能大于10个字符/英文名不能大于20个字符】数据验证失败,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
///
/// 代理人录入验证
///
///
///
private void textAGENT_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textAGENT.Text) > 20)
{
MessageBox.Show("录入代理人数据验证失败【中文名不能大于10个字符/英文名不能大于20个字符】,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
///
/// 地址录入验证
///
///
///
private void textADDRESS_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textADDRESS.Text) > 500)
{
MessageBox.Show("录入地址数据验证失败【中文地址不能大于250个字符/英文地址不能大于500个字符】,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
///
/// 开户银行录入验证
///
///
///
private void textBANK_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textBANK.Text) > 50)
{
MessageBox.Show("录入开户银行数据验证失败【中文名不能大于25个字符/英文名不能大于50个字符】,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
///
/// 电话码号录入验证
///
///
///
private void textPHONE_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.IsChinese(textPHONE.Text))
{
MessageBox.Show("录入电话号码数据验证失败【电话号码不能为中文】,请按国内/国际电话规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
else
{
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textPHONE.Text) > 20)
{
MessageBox.Show("录入电话号码数据验证失败【不能大于20个字符】,请按国内/国际电话规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
}
///
/// 传真录入验证
///
///
///
private void textFAX_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.IsChinese(textFAX.Text))
{
MessageBox.Show("录入传真号码数据验证失败【传真号码不能为中文】,请按国内/国际传真号码规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
else
{
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textFAX.Text) > 20)
{
MessageBox.Show("录入传真号码数据验证失败【不能大于20个字符】,请按国内/国际传真号码规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
}
///
/// 邮编录入验证
///
///
///
private void textZIP_CODE_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.IsChinese(textZIP_CODE.Text))
{
MessageBox.Show("录入邮编数据验证失败【邮编不能为中文】,请按国内/国际邮编规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
else
{
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textZIP_CODE.Text) > 20)
{
MessageBox.Show("录入邮编数据验证失败【不能大于20个字符】,请按国内/国际邮编规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
}
///
/// 税号录入验证
///
///
///
private void textTAX_ID_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.IsChinese(textTAX_ID.Text))
{
MessageBox.Show("录入税号数据验证失败【税号不能为中文】,请按国内/国际税号规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
else
{
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textTAX_ID.Text) > 20)
{
MessageBox.Show("录入税号数据验证失败【不能大于50个字符】,请按国内/国际税号规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
}
///
/// 帐号录入验证
///
///
///
private void textACCOUNT_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.IsChinese(textACCOUNT.Text))
{
MessageBox.Show("录入帐号数据验证失败【帐号不能为中文】,请按国内/国际帐号规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
else
{
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textACCOUNT.Text) > 50)
{
MessageBox.Show("录入帐号数据验证失败【不能大于50个字符】,请按国内/国际帐号规则重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
}
private void textMEMO_Validating(object sender, CancelEventArgs e)
{
blValidating = false;
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textMEMO.Text) > 200)
{
MessageBox.Show("录入备注数据验证失败【备注不能大于100个字符/英文地址不能大于200个字符】,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
blValidating = true;
e.Cancel = true;
}
}
}
}