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 Infragistics.Win.UltraWinGrid;
using Core.Mes.Client.Comm.Tool;
using System.Collections;
namespace Core.StlMes.Client.SaleBase
{
public partial class FrmBuyerBase : FrmBase
{
string strShift = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserOrder();
string strOperator = CoreFS.SA06.CoreUserInfo.UserInfo.GetUserName();
string saleorg = "";//部门
string combelText = "";//省市区域名称
string combelonCity = "";//省市区域代码
string combleTo = "";//州或国
string stacustomerNo = "";//全局客户编码
string bigarea = "";//行政片区
string customerID = "";
string expanlixName = "";//客户名称
//用于展开操作项
ArrayList listExpanl = new ArrayList();
protected override void OnLoad(EventArgs e)
{
try
{
base.OnLoad(e);
ultraBaseGrid.DisplayLayout.Override.FilterUIType = Infragistics.Win.UltraWinGrid.FilterUIType.FilterRow;
ultraBaseGrid.DisplayLayout.Override.FilterOperatorDefaultValue = Infragistics.Win.UltraWinGrid.FilterOperatorDefaultValue.Contains;
for (int i = 0; i < ultraBaseGrid.DisplayLayout.Bands.Count; i++)
{
if (i > 0)
{
ultraBaseGrid.DisplayLayout.Bands[i].Override.FilterUIType = Infragistics.Win.UltraWinGrid.FilterUIType.HeaderIcons;
}
}
}
catch (System.Exception ex)
{ }
}
public FrmBuyerBase()
{
InitializeComponent();
ExceptionHelper.RegistException();
this.ComBelongsCity.AfterExpand += new TreeViewEventHandler(ComBelongsCity_AfterExpand);
this.ComBelongsCity.AfterCollapse += new TreeViewEventHandler(ComBelongsCity_AfterCollapse);
}
void ComBelongsCity_AfterCollapse(object sender, TreeViewEventArgs e)
{
if (e.Node.ImageIndex == 1)
e.Node.ImageIndex = e.Node.SelectedImageIndex = 0;
}
void ComBelongsCity_AfterExpand(object sender, TreeViewEventArgs e)
{
if (e.Node.ImageIndex == 0)
e.Node.ImageIndex = e.Node.SelectedImageIndex = 1;
}
private void FrmBuyerBase_Load(object sender, EventArgs e)
{
this.doLoadSource();
}
private void doLoadSource()
{
//市场系统
DataTable isx = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryBaseInfo", new Object[] { "1006" }, this.ob);
comBoStation.DataSource = isx;
comBoStation.DisplayMember = "BASENAME";
comBoStation.ValueMember = "BASECODE";
ClsBaseInfo.SetComboItemHeight(comBoStation);
//区域
isx = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryBaseInfo", new Object[] { "1007" }, this.ob);
comboRegIon.DataSource = isx;
comboRegIon.DisplayMember = "BASENAME";
comboRegIon.ValueMember = "BASECODE";
ClsBaseInfo.SetComboItemHeight(comboRegIon);
doGetSaleOrg();
QueryTree();
}
//刷新Tree
public void QueryTree()
{
this.ComBelongsCity.Nodes.Clear();
DataTable dt = new DataTable();
dt = ServerHelper.GetData("com.steering.pss.sale.base.CoreStation.GetTivCode", new Object[] { }, this.ob);
//树控件递归绑定方法。
Bind_Tv(dt, ComBelongsCity.Nodes, null, "REGION_NO", "P_REGION_NO", "REGION_NM");
}
private void Bind_Tv(DataTable dt, TreeNodeCollection tnc, string pid_val, string id, string pid, string text)
{
DataView dv = new DataView(dt);//将DataTable存到DataView中,以便于筛选数据
TreeNode tn;//建立TreeView的节点(TreeNode),以便将取出的数据添加到节点中
//以下为三元运算符,如果父id为空,则为构建“父id字段 is null”的查询条件,否则构建“父id字段=父id字段值”的查询条件
string filter = string.IsNullOrEmpty(pid_val) ? pid + " is null" : string.Format(pid + "='{0}'", pid_val);
dv.RowFilter = filter;//利用DataView将数据进行筛选,选出相同 父id值 的数据
foreach (DataRowView drv in dv)
{
tn = new TreeNode();//建立一个新节点(学名叫:一个实例)
tn.Tag = drv[id].ToString();//节点的Value值,一般为数据库的id值
tn.Text = drv[text].ToString();//节点的Text,节点的文本显示
tn.Name = drv["REGION_LVL_NO"].ToString();//区域属性代码
tn.ImageKey = drv["REGION_LVL_NM"].ToString();
tn.StateImageKey = drv["BIGAREA"].ToString();
if (!string.IsNullOrEmpty(drv["P_REGION_NO"].ToString()))
{
tn.ToolTipText = drv["P_REGION_NO"].ToString();
}
else
{
tn.ImageIndex = 0;
}
tnc.Add(tn);//将该节点加入到TreeNodeCollection(节点集合)中
Bind_Tv(dt, tn.Nodes, tn.Tag.ToString(), id, pid, text);//递归(反复调用这个方法,直到把数据取完为止)
}
}
///
/// 重写基类方法
///
///
///
public override void ToolBar_Click(object sender, string ToolbarKey)
{
//if (UserInfo.SaleOrg.Equals("NONE"))
//{
// MessageBox.Show("未授权,不允许查看!");
// return;
//}
switch (ToolbarKey)
{
case "doQuery":
doQuery();
break;
case "doAdd":
if (MessageUtil.ShowQuestion("是否新增数据?").ToString().ToLower().Equals("yes"))
{
try
{
string dosave = doSave();
if (dosave.Equals("true"))
{
MessageUtil.ShowTips("添加成功!");
doQuery();
}
else if (dosave.Equals("BugCustomer"))
{
MessageUtil.ShowTips("数据插入客户编码表失败!"); return;
}
else if (dosave.Equals("doInsertCustmRight"))
{
MessageUtil.ShowTips("数据插入客户授权表失败!"); return;
}
else if (dosave.Equals("BugCustmUseRight"))
{
MessageUtil.ShowTips("数据插入客户用途类型表失败!"); return;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return;
}
}
break;
case "doDelete":
if (ultraBaseGrid.ActiveRow == null)
{
MessageBox.Show("请选择要作废的客户信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (MessageUtil.ShowQuestion("是否确认作废【" + ultraBaseGrid.ActiveRow.Cells["CUSTOMER_NM"].Value.ToString() + "】客户数据?").ToString().ToLower().Equals("yes"))
{
if (doDelete("0"))
{
MessageUtil.ShowTips("作废成功!");
doQuery();
}
else
{
MessageUtil.ShowTips("作废失败!");
}
}
break;
case "doCancel":
if (ultraBaseGrid.ActiveRow == null)
{
MessageBox.Show("请选择要取消作废的客户信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (MessageUtil.ShowQuestion("是否确认取消作废的【" + ultraBaseGrid.ActiveRow.Cells["CUSTOMER_NM"].Value.ToString() + "】客户数据?").ToString().ToLower().Equals("yes"))
{
if (doDelete("1"))
{
MessageUtil.ShowTips("取消作废成功!");
doQuery();
}
else
{
MessageUtil.ShowTips("取消作废失败!");
}
}
break;
case "doUpdate":
string doUp = doUpdate();
if (doUp.Equals("true"))
{
MessageUtil.ShowTips("修改成功!");
doQuery();
}
else if (doUp.Equals("BugCustomer"))
{
MessageUtil.ShowTips("修改失败!");
}
break;
case "doLoad":
this.doLoadSource();
break;
case "OutExcel":
OutExcel();
break;
case "Close":
this.Close();
break;
}
}
private void OutExcel()
{
ultraBaseGrid.DisplayLayout.Bands[0].Columns["BTN_ORDER"].Hidden = true;
ultraBaseGrid.DisplayLayout.Bands[0].Columns["BTN_RECEIVE"].Hidden = true;
GridHelper.ulGridToExcel(ultraBaseGrid, "客户基础信息");
ultraBaseGrid.DisplayLayout.Bands[0].Columns["BTN_ORDER"].Hidden = false;
ultraBaseGrid.DisplayLayout.Bands[0].Columns["BTN_RECEIVE"].Hidden = false;
//string customerName = "";
//string validFlag = "";
//string strSaleOrg = "";
////销售与钢贸数据共享
//if (UserInfo.SaleOrg == "100101" || UserInfo.SaleOrg == "100103")
// strSaleOrg = "100101','100103";
//else if (UserInfo.SaleOrg == "100102")
// strSaleOrg = "100102";
//else
// strSaleOrg = "NONE";
//customerName = ultxtBaseName.Text.Trim();
//if (chkValid.Checked)
// validFlag = "0','1";
//else
// validFlag = "1";
//FrmOutExcel fBug = new FrmOutExcel(ob, customerName, validFlag, strSaleOrg);
//fBug.AutoSize = true;
//fBug.MaximumSize = new Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
//fBug.WindowState = FormWindowState.Maximized;
//fBug.Show();
}
private bool doDelete(string strValidFlag)
{
ArrayList parm = new ArrayList();
parm.Add(strValidFlag);
parm.Add(strOperator);
parm.Add(stacustomerNo);
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateCustomerALLS";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
parm = new ArrayList();
parm.Add(strValidFlag);
parm.Add(stacustomerNo);
parm.Add(saleorg);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateRightALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateUseALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateReceivUnitALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateOrderUnitALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
parm = new ArrayList();
parm.Add(strValidFlag);
parm.Add(stacustomerNo);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateFreightALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode == -1)
{
return false;
}
return true;
}
private string doUpdate()
{
string returnBug = ""; //记录bug信息
string customerName = textEditorBaseName.Text;//客户名称
string abrvition = textAbrviTion.Text;//客户简称
string org = textEditorORG.Text;//组织机构
string combelname = ComBelongsCity.Text;//省市区域名称
treeSelect(combelname);
string combelon = combelonCity;//省市区域代码
string comble = combleTo;//州或国
string py = this.textEditorABC.Text;//拼音
if(UserInfo.SaleOrg == "")
if (combelonCity.Equals(""))
{
MessageUtil.ShowTips("请选择‘洲’以下区域新增客户信息,找不到对应地区请维护!");
return returnBug;
}
if (stacustomerNo.Equals(""))
{
MessageUtil.ShowTips("请选中一条客户编码进行修改!");
return returnBug;
}
if (customerName.Trim().Equals(""))
{
MessageUtil.ShowTips("客户名称不允许为空!");
return returnBug;
}
if (abrvition.Trim().Equals(""))
{
MessageUtil.ShowTips("客户简称不允许为空!");
return returnBug;
}
//if (org.Trim().Equals(""))
//{
// MessageUtil.ShowTips("组织机构不允许为空!");
// return returnBug;
//}
if (combelname.Trim().Equals(""))
{
MessageUtil.ShowTips("省市/区域不允许为空!");
return returnBug;
}
if (comBoStation.Text.Trim().Equals(""))
{
MessageUtil.ShowTips("请选择[市场系统]!");
return returnBug;
}
else if (comBoStation.IsItemInList(comBoStation.Text.Trim()) == false)
{
MessageUtil.ShowTips("输入的[市场系统]不在,请选择[市场系统]!");
comBoStation.Focus();
return returnBug;
}
if (ultraBaseGrid.ActiveRow != null)
{
UltraGridRow row = ultraBaseGrid.ActiveRow;
while (row.HasParent())
{
row = row.ParentRow;
}
if (!row.Cells["CUSTOMER_NM"].Value.Equals(customerName))
{
DataTable customerTable = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryCustomer", new Object[] { customerName }, this.ob);
if (customerTable.Rows.Count > 0)
{
MessageUtil.ShowTips(customerName + ",客户名称已存在!");
return returnBug;
}
}
if (!row.Cells["ABRVITION"].Value.Equals(abrvition))
{
int customerCount = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryAbrviTion", new Object[] { abrvition }, this.ob).Rows.Count;
if (customerCount > 0)
{
MessageUtil.ShowTips(abrvition + ",简称已存在!");
return returnBug;
}
}
}
if (MessageUtil.ShowYesNoAndQuestion("是否确认修改?") == DialogResult.No) return "";
expanlixName = customerName;
ArrayList parm = new ArrayList();
parm.Add(customerName);
parm.Add(comboRegIon.Value);
parm.Add(combelon);
parm.Add(abrvition);
parm.Add(org);
parm.Add(strOperator);
parm.Add(py);
parm.Add(comBoStation.Text); // LX 修改 comBoStation.Value
parm.Add(ultraTextUserGrp.Text == "" ? "N/A" : ultraTextUserGrp.Text);
parm.Add(strOperator);
parm.Add(stacustomerNo);
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateCustomer";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode == -1)
{
returnBug = "BugCustomer";
return returnBug;
}
else
{
returnBug = "true";
}
return returnBug;
}
///
/// 根据登录账户,判断所属部门。
///
private void doGetSaleOrg()
{
UserInfo.SaleOrg = ClsBaseInfo.GetSaleOrg(UserInfo.GetDeptid());
saleorg = UserInfo.SaleOrg;
}
private string doSave()
{
string returnBug = ""; //记录bug信息
string customerName = textEditorBaseName.Text;//客户名称
string abrvition = textAbrviTion.Text;//客户简称
string org = textEditorORG.Text;//组织机构
treeSelect(ComBelongsCity.Text);//加载省市
string combelname = ComBelongsCity.Text;//省市区域名称
treeSelect(combelname);
string combelon = combelonCity;//省市区域代码
string comble = combleTo;//州或国
string zjabc = textEditorABC.Text;//拼音助记
string customerNo = "";
if (combelonCity.Trim().Equals(""))
{
MessageUtil.ShowTips("请选择[区域/省市]中省市不允许选择洲,请正确填写省市!");
return returnBug;
}
if (customerName.Trim().Equals(""))
{
MessageUtil.ShowTips("请输入[客户名称]!");
return returnBug;
}
if (abrvition.Trim().Equals(""))
{
MessageUtil.ShowTips("请输入[客户简称]!");
return returnBug;
}
//if (org.Trim().Equals(""))
//{
// MessageUtil.ShowTips("组织机构不允许为空!");
// return returnBug;
//}
if (combelname.Trim().Equals(""))
{
MessageUtil.ShowTips("请选择[省市/区域]!");
return returnBug;
}
//if (zjabc.Trim().Equals(""))
//{
// MessageUtil.ShowTips("拼音助记不允许为空!");
// return returnBug;
//}
//if (comboRegIon.Text.Trim().Equals(""))
//{
// MessageUtil.ShowTips("区域不允许为空!");
// return returnBug;
//}
if (comBoStation.Text.Trim().Equals(""))
{
MessageUtil.ShowTips("请选择[市场系统]!");
return returnBug;
}
else if (comBoStation.IsItemInList(comBoStation.Text.Trim()) == false)
{
MessageUtil.ShowTips("输入的[市场系统]不在,请选择[市场系统]!");
comBoStation.Focus();
return returnBug;
}
ArrayList parm = new ArrayList();
CoreClientParam ccp = new CoreClientParam();
//判断客户名称已存在而且无效 Update除了客户名称和简称以外的数据。
DataTable customerCTME = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryCTMR", new Object[] { customerName }, this.ob);
if (customerCTME.Rows.Count > 0)
{
parm = new ArrayList();
parm.Add(ultraTextUserGrp.Text == "" ? "N/A" : ultraTextUserGrp.Text);//用户组
parm.Add(comboRegIon.Value);//行政片区
parm.Add(combelon);//省市/区域
parm.Add(abrvition);//简称
parm.Add(org);//机构代码
parm.Add(strOperator);//创建人
parm.Add(zjabc);//拼音助记
parm.Add(comBoStation.Text);//市场系统(1006) LX 修改 comBoStation.Value
parm.Add("1");//有效标志(1:有效,0:无效)
parm.Add(customerCTME.Rows[0][0].ToString());//客户代码
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateDeleteCTMR";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode == -1)
{
MessageUtil.ShowTips("还原新增失败!");
return returnBug;
}
else
{
returnBug = "true";
parm = new ArrayList();
parm.Add(customerCTME.Rows[0][0].ToString()); //客户编码
parm.Add("100204");
parm.Add(saleorg);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "SetUpCustm_Use";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
return returnBug;
}
}
DataTable customerTable = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryCustomer", new Object[] { customerName }, this.ob);
if (customerTable.Rows.Count > 0)
{
customerNo = customerTable.Rows[0][0].ToString();
int countRight = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderManager.GetCustmRight", new Object[] { customerNo, saleorg }, this.ob).Rows.Count;
if (countRight > 0)
{
MessageUtil.ShowTips(customerName + ",客户名称已存在!");
return returnBug;
}
else
{
try
{
parm = new ArrayList();
parm.Add(customerNo); //客户编码
parm.Add(saleorg);
parm.Add("");
parm.Add(strOperator);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetInsertCustmRight";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return returnBug;
}
}
int countRights = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderManager.GetCustmUse", new Object[] { customerNo, saleorg }, this.ob).Rows.Count;
if (countRights > 0)
{
MessageUtil.ShowTips(customerName + ",客户名称已存在!");
return returnBug;
}
else
{
parm = new ArrayList();
parm.Add(customerNo); //客户编码
parm.Add(saleorg);
parm.Add("100204");
parm.Add(strOperator);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetInsertCustmUse";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
parm = new ArrayList();
parm.Add(customerNo); //客户编码
parm.Add(saleorg);
parm.Add("100205");
parm.Add(strOperator);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetInsertCustmUse";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
return "true";
}
int customerCount = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryAbrviTion", new Object[] { abrvition }, this.ob).Rows.Count;
if (customerCount > 0)
{
MessageUtil.ShowTips(abrvition + ",简称已存在!");
return returnBug;
}
//customer_nm, bigarea, region_no, abrvition, org, create_name
expanlixName = customerName;
parm = new ArrayList();
parm.Add(combelon);
parm.Add(combelon);
parm.Add(combelon);
parm.Add(combelon);
parm.Add(combelon);
parm.Add(customerName);
parm.Add(comboRegIon.Value);
parm.Add(combelon);
parm.Add(abrvition);
parm.Add(org);
parm.Add(strOperator);
parm.Add(zjabc);
parm.Add(comBoStation.Text); //LX 修改 comBoStation.Value
parm.Add(ultraTextUserGrp.Text == "" ? "N/A" : ultraTextUserGrp.Text);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetInsertCustomer";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode == -1)
{
returnBug = "BugCustomer";
return returnBug;
}
else
{
returnBug = "Next";
}
if (returnBug.Equals("Next"))
{
customerNo = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryCustomer", new Object[] { customerName }, this.ob).Rows[0][0].ToString();
parm = new ArrayList();
parm.Add(customerNo); //客户编码
parm.Add(saleorg);
parm.Add(" ");
parm.Add(strOperator);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetInsertCustmRight";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode == -1)
{
returnBug = "BugCustmRight";
return returnBug;
}
else
{
returnBug = "Next";
}
}
//customer_no, sale_org, custm_use, create_name, create_time
if (returnBug.Equals("Next"))
{
parm = new ArrayList();
parm.Add(customerNo); //客户编码
parm.Add(saleorg);
parm.Add("100205");
parm.Add(strOperator);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetInsertCustmUse";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
if (ccp.ReturnCode == -1)
{
returnBug = "BugCustmUseRight";
return returnBug;
}
else
{
returnBug = "true";
}
}
int countsig = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryCustm_Use", new Object[] { customerNo, "100204", saleorg }, this.ob).Rows.Count;
if (countsig == 0)
{
parm = new ArrayList();
parm.Add(customerNo); //客户编码
parm.Add(saleorg);
parm.Add("100204");
parm.Add(strOperator);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetInsertCustmUse";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
return returnBug;
}
//查询
public void doQuery()
{
string customerName = ""; //sql
string customerNo = ""; //客户简称
string custmuse = ""; //组织机构
string merPorSql = "";
string strSaleOrg = "'" + UserInfo.SaleOrg + "'"; //组织(销售、国贸、钢贸)
bool validFlag = chkValid.Checked;
if (!ultxtBaseName.Text.Trim().Equals(""))
{
customerName += " AND Upper(CUSTOMER_NM) like'%' || Upper('" + ultxtBaseName.Text.Trim() + "')||'%'";
}
if (!validFlag)
{
customerName += " AND validflag = '1' ";
merPorSql = " AND validflag = '1' ";
}
//销售与钢贸数据共享
if (UserInfo.SaleOrg == "100101" || UserInfo.SaleOrg == "100103")
strSaleOrg = "'100101','100103'";
DataTable dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryCustmright",
new Object[] { strSaleOrg, customerName, merPorSql }, this.ob);
slmBaseCartransport.Clear();
slmBaseReceivunit.Clear();
slmBaseOrderUnit.Clear();
slmBaseCustomer.Clear();
GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseCustomer, true);
string strValidFlag = validFlag ? "0" : "1";
dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.getBaseReceiveUnit",
new Object[] { ultxtBaseName.Text.Trim(), strValidFlag, strSaleOrg}, this.ob);
GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseReceivunit, true);
dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.getBaseOrderUnit",
new Object[] { ultxtBaseName.Text.Trim(), strValidFlag, strSaleOrg}, this.ob);
GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseOrderUnit, true);
dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryCustmFreightAll",
new Object[] { }, this.ob);
GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseCartransport, true);
foreach (UltraGridRow row in ultraBaseGrid.Rows)
{
row.Cells["BTN_ORDER"].Value = "维护";
row.Cells["BTN_RECEIVE"].Value = "维护";
if (row.Cells["CUSTOMER_NO"].Value.Equals(expanlixName))
{
row.Activate();
row.ExpandAll();
}
if (row.Cells["CUSTOMER_NM"].Value.Equals(expanlixName))
{
row.Activate();
row.ExpandAll();
}
}
this.ultraBaseGrid.UpdateData();
////内容自适应
//GridHelper.RefreshAndAutoSizeExceptRows(ultraBaseGrid, new UltraGridColumn[] {
//});
}
private void ultraBaseGrid_AfterRowActivate(object sender, EventArgs e)
{
Infragistics.Win.UltraWinGrid.UltraGridRow row = this.ultraBaseGrid.DisplayLayout.ActiveRow;
if (row.IsFilterRow) return;
if (row != null && row.Band.Key.Equals("slmBaseCustomer"))
{
this.stacustomerNo = row.Cells["CUSTOMER_NO"].Value == null ? "" : row.Cells["CUSTOMER_NO"].Value.ToString();
this.textEditorBaseName.Text = row.Cells["CUSTOMER_NM"].Value == null ? "" : row.Cells["CUSTOMER_NM"].Value.ToString();
this.textAbrviTion.Text = row.Cells["ABRVITION"].Value == null ? "" : row.Cells["ABRVITION"].Value.ToString();
this.textEditorORG.Text = row.Cells["ORG"].Value == null ? "" : row.Cells["ORG"].Value.ToString();
this.bigarea = row.Cells["BIGAREA"].Value == null ? "" : row.Cells["BIGAREA"].Value.ToString();
this.textEditorABC.Text = row.Cells["PY"].Value == null ? "" : row.Cells["PY"].Value.ToString();
this.comBoStation.Text = row.Cells["MARKET_SYS"].Value == null ? "" : row.Cells["MARKET_SYS"].Value.ToString();
this.comboRegIon.Text = this.bigarea;
this.ultraTextUserGrp.Text = row.Cells["USER_GRP"].Value == null ? "" : row.Cells["USER_GRP"].Value.ToString();
treeSelect(row.Cells["REGION_NO"].Value == null ? "" : row.Cells["REGION_NO"].Value.ToString());
}
//bool validFlag = chkValid.Checked;
//string merPorSql = "";
//if (!validFlag)
//{
// merPorSql = " AND validflag = '1' ";
//}
//UltraGridRow atvRow = ultraBaseGrid.ActiveRow;
//if (atvRow != null && atvRow.Band.AddButtonCaption.ToString().Equals("slmBaseCustomer"))
//{
// string customerNo = atvRow.Cells["CUSTOMER_NO"].Value.ToString();
// string custmuse = "''";
// if (atvRow.Cells["DINGJIE"].Value.ToString().Equals("true"))
// {
// custmuse += ", '" + "100202" + "'";
// }
// if (atvRow.Cells["SH"].Value.ToString().Equals("true"))
// {
// custmuse += ", '" + "100203" + "'";
// }
// if (custmuse != "")
// {
// DataTable dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryReceiv", new Object[] { customerNo, UserInfo.SaleOrg, custmuse, merPorSql }, this.ob);
// GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseReceivunit, true);
// dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryUnit", new Object[] { customerNo, UserInfo.SaleOrg, custmuse, merPorSql }, this.ob);
// GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseOrderUnit, true);
// dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryCustmFreightAll", new Object[] { }, this.ob);
// GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseCartransport, true);
// }
//}
}
//展开下拉列表树节点
public void treeSelect(string Name)
{
if (!string.IsNullOrEmpty(Name))
{
for (int e = 0; e < this.ComBelongsCity.Nodes.Count; e++)
{
ComBelongsCity.Nodes[e].Collapse();
combelonCity = "";
//展开一级节点 LX 修改
if (this.ComBelongsCity.Nodes[e].Text.Equals(Name) || this.ComBelongsCity.Nodes[e].Tag.Equals(Name))
{
this.ComBelongsCity.Nodes[e].Expand();
this.ComBelongsCity.Nodes[e].ExpandAll();
ComBelongsCity.Text = this.ComBelongsCity.Nodes[e].Text.ToString();
combelonCity = this.ComBelongsCity.Nodes[e].Tag.ToString();
combleTo = this.ComBelongsCity.Nodes[e].ToolTipText;
return;
}
//展开二级节点
for (int w = 0; w < this.ComBelongsCity.Nodes[e].Nodes.Count; w++)
{
if (this.ComBelongsCity.Nodes[e].Nodes[w].Text.Equals(Name) || this.ComBelongsCity.Nodes[e].Nodes[w].Tag.Equals(Name))
{
this.ComBelongsCity.Nodes[e].Expand();
this.ComBelongsCity.Nodes[e].Nodes[w].ExpandAll();
ComBelongsCity.Text = this.ComBelongsCity.Nodes[e].Nodes[w].Text.ToString();
combelonCity = this.ComBelongsCity.Nodes[e].Nodes[w].Tag.ToString();
combleTo = this.ComBelongsCity.Nodes[e].Nodes[w].ToolTipText;
return;
}
}
//展开三级子节点
for (int w = 0; w < this.ComBelongsCity.Nodes[e].Nodes.Count; w++)
{
for (int r = 0; r < this.ComBelongsCity.Nodes[e].Nodes[w].Nodes.Count; r++)
{
if (this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Text.Equals(Name) || this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Tag.Equals(Name))
{
this.ComBelongsCity.Nodes[e].Expand();
this.ComBelongsCity.Nodes[e].Nodes[w].Expand();
this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].ExpandAll();
ComBelongsCity.Text = this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Text.ToString();
combelonCity = this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Tag.ToString();
combleTo = this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].ToolTipText;
return;
}
}
}
//展开四级子节点
for (int w = 0; w < this.ComBelongsCity.Nodes[e].Nodes.Count; w++)
{
for (int r = 0; r < this.ComBelongsCity.Nodes[e].Nodes[w].Nodes.Count; r++)
{
for (int x = 0; x < this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Nodes.Count; x++)
{
if (this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Nodes[x].Text.Equals(Name) || this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Nodes[x].Tag.Equals(Name))
{
this.ComBelongsCity.Nodes[e].Expand();
this.ComBelongsCity.Nodes[e].Nodes[w].Expand();
this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Expand();
this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Nodes[x].ExpandAll();
ComBelongsCity.Text = this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Nodes[x].Text.ToString();
combelonCity = this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Nodes[x].Tag.ToString();
combleTo = this.ComBelongsCity.Nodes[e].Nodes[w].Nodes[r].Nodes[x].ToolTipText;
return;
}
}
}
}
}
}
}
/**
*1.勾选订货或者收货单位如果为true,判断是否存在:存在修改有效标记1,不存在弹窗新增一条。
*2.勾选订货或者收货单位如果为False,修改有效标记0;
*/
private void ultraBaseGrid_CellChange(object sender, CellEventArgs e)
{
if (e.Cell.Row.Index == -1)
{
return;
}
listExpanl.Clear();
Infragistics.Win.UltraWinGrid.UltraGridRow row = this.ultraBaseGrid.DisplayLayout.ActiveRow;
expanlixName = row.Cells["CUSTOMER_NO"].Text;
customerID = row.Cells["CUSTOMER_NO"].Text;
int count = 0;
if (e.Cell.Column.Key.Equals("VALIDFLAG"))
{
//用于修改增加后展开
listExpanl.Add(e.Cell.Row.Index);
if (row.Cells["VALIDFLAG"].Text.Equals("True"))
{
ArrayList parm = new ArrayList();
parm.Add("1");
parm.Add(stacustomerNo);
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateCustomerALLS";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
parm = new ArrayList();
parm.Add("1");
parm.Add(stacustomerNo);
parm.Add(saleorg);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateRightALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateUseALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateReceivUnitALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateOrderUnitALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
parm = new ArrayList();
parm.Add("1");
parm.Add(stacustomerNo);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateFreightALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
else
{
ArrayList parm = new ArrayList();
parm.Add("0");
parm.Add(stacustomerNo);
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateCustomerALLS";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
parm = new ArrayList();
parm.Add("0");
parm.Add(stacustomerNo);
parm.Add(saleorg);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateRightALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateUseALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateReceivUnitALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateOrderUnitALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
parm = new ArrayList();
parm.Add("0");
parm.Add(stacustomerNo);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateFreightALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
}
if (e.Cell.Column.Key.Equals("DINGJIE"))
{ //用于修改增加后展开
listExpanl.Add(e.Cell.Row.Index);
if (row.Cells["DINGJIE"].Text.Equals("True"))
{
count = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryOrderUnit", new Object[] { customerID, saleorg }, this.ob).Rows.Count;
if(count == 0)
{
MessageUtil.ShowWarning("请先维护订/结单位!");
row.Cells["DINGJIE"].Value = false;
return;
}
ArrayList parm = new ArrayList();
parm.Add("1");
parm.Add(stacustomerNo);
parm.Add(saleorg);
parm.Add("100202");
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateOrderUnit";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateUse";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
else if (row.Cells["DINGJIE"].Text.Equals("False"))
{
count = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryOrderUnit", new Object[] { customerID, saleorg }, this.ob).Rows.Count;
if (count > 0)
{
if (MessageUtil.ShowQuestion("是否删除订/结客户信息,删除之后该客户信息失效,相关合同生成无法调用该客户信息!").ToString().ToLower().Equals("yes"))
{
ArrayList parm = new ArrayList();
parm.Add("0");
parm.Add(stacustomerNo);
parm.Add(saleorg);
parm.Add("100202");
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateOrderUnit";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateUse";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
}
}
doQuery();
}
if (e.Cell.Column.Key.Equals("SH"))
{
//用于修改增加后展开
listExpanl.Add(e.Cell.Row.Index);
if (row.Cells["SH"].Text.Equals("True"))
{
count = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryReceivUnit", new Object[] { customerID, saleorg }, this.ob).Rows.Count;
if (count == 0)
{
MessageUtil.ShowWarning("请先维护收货单位!");
row.Cells["SH"].Value = false;
return;
}
ArrayList parm = new ArrayList();
parm.Add("1");
parm.Add(stacustomerNo);
parm.Add(saleorg);
parm.Add("100203");
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateReceivUnit";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateUse";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
else if (row.Cells["SH"].Text.Equals("False"))
{
count = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryReceivUnit", new Object[] { customerID, saleorg }, this.ob).Rows.Count;
if (count > 0)
{
if (MessageUtil.ShowQuestion("是否删除收货客户信息,删除之后该客户信息失效,相关合同生成无法调用该客户信息!").ToString().ToLower().Equals("yes"))
{
ArrayList parm = new ArrayList();
parm.Add("0");
parm.Add(stacustomerNo);
parm.Add(saleorg);
parm.Add("100203");
CoreClientParam ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateReceivUnit";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetUpdateUse";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
}
}
}
string keyName = e.Cell.Column.Key.ToUpper().Trim();
//if (keyName.Equals("UNBOUNDUP"))
//{
// treeSelect(e.Cell.Row.Cells["REGION_NO"].Value == null ? " " : e.Cell.Row.Cells["REGION_NO"].Value.ToString());
// //用于修改增加后展开
// listExpanl.Add(e.Cell.Row.ParentRow.Index);
// FrmBuyerSend frmSend = new FrmBuyerSend(this.ob);
// frmSend.Customer_no = e.Cell.Row.Cells["CUSTOMER_NO"].Value.ToString();
// frmSend.Sale_org = saleorg;
// frmSend.Custm_use = "100203";
// frmSend.Region_no = combelonCity;
// frmSend.StrOperator = strOperator;
// frmSend.ShowDialog();
//}
//if (keyName.Equals("UNITUP"))
//{
// treeSelect(e.Cell.Row.Cells["REGION_NO"].Value == null ? " " : e.Cell.Row.Cells["REGION_NO"].Value.ToString());
// //用于修改增加后展开
// listExpanl.Add(e.Cell.Row.ParentRow.Index);
// FrmBuyerOrder frmorder = new FrmBuyerOrder(this.ob);
// frmorder.Customer_no = e.Cell.Row.Cells["CUSTOMER_NO"].Value.ToString();
// frmorder.Sale_org = saleorg;
// frmorder.Custm_use = "100202";
// frmorder.Chn_fl = combleTo == "1001" ? "1" : "0";
// frmorder.Bigarea = e.Cell.Row.Cells["BIGAREA"].Value.ToString(); ;
// frmorder.Region_no = combelonCity;
// frmorder.StrOperator = strOperator;
// frmorder.ShowDialog();
//}
if (keyName.Equals("USERBOS"))
{
ArrayList parm = new ArrayList();
CoreClientParam ccp = new CoreClientParam();
expanlixName = e.Cell.Row.Cells["CUSTOMER_NO"].Value.ToString();
if (row.Cells["USERBOS"].Text.Equals("True"))
{
int countsig = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryCustm_Use",
new Object[] { e.Cell.Row.Cells["CUSTOMER_NO"].Value.ToString(), "100204", saleorg }, this.ob).Rows.Count;
if (countsig == 0)
{
parm = new ArrayList();
parm.Add(e.Cell.Row.Cells["CUSTOMER_NO"].Value.ToString()); //客户编码
parm.Add(saleorg);
parm.Add("100204");
parm.Add(strOperator);
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "GetInsertCustmUse";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
}
else
{
parm = new ArrayList();
parm.Add(e.Cell.Row.Cells["CUSTOMER_NO"].Value.ToString()); //客户编码
parm.Add("100204");
ccp = new CoreClientParam();
ccp.ServerName = "com.steering.pss.sale.base.CoreBuyerBase";
ccp.MethodName = "SetDeleteUseALL";
ccp.ServerParams = new object[] { parm };
ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
}
}
doQuery();
ultraBaseGrid.UpdateData();
}
private void ComBelongsCity_DropDownClosed(object sender, EventArgs e)
{
this.comboRegIon.Value = this.ComBelongsCity.SelectedNode.StateImageKey;
}
private void ultraBaseGrid_BeforeRowExpanded(object sender, CancelableRowEventArgs e)
{
//if (e.Row.IsFilterRow) return;
//bool validFlag = chkValid.Checked;
//string merPorSql = "";
//if (!validFlag)
//{
// merPorSql = " AND validflag = '1' ";
//}
//if (e.Row != null && e.Row.Band.AddButtonCaption.ToString().Equals("slmBaseCustomer"))
//{
// string customerNo = e.Row.Cells["CUSTOMER_NO"].Value.ToString();
// string custmuse = "''";
// if (e.Row.Cells["DINGJIE"].Value.ToString().Equals("true"))
// {
// custmuse += ", '" + "100202" + "'";
// }
// if (e.Row.Cells["SH"].Value.ToString().Equals("true"))
// {
// custmuse += ", '" + "100203" + "'";
// }
// if (custmuse != "")
// {
// DataTable dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryReceiv", new Object[] { customerNo, UserInfo.SaleOrg, custmuse, merPorSql }, this.ob);
// GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseReceivunit, true);
// dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerBase.GetQueryUnit", new Object[] { customerNo, UserInfo.SaleOrg, custmuse, merPorSql }, this.ob);
// GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseOrderUnit, true);
// dts = ServerHelper.GetData("com.steering.pss.sale.base.CoreBuyerOrder.GetQueryCustmFreightAll", new Object[] { }, this.ob);
// GridHelper.CopyDataToDatatable(ref dts, ref this.slmBaseCartransport, true);
// }
//}
}
private void textEditorBaseName_ValueChanged(object sender, EventArgs e)
{
//ChineseWord
textEditorABC.Text = ChineseWord.GetChineseSpell(textEditorBaseName.Text.Trim());
}
private void ultraBaseGrid_ClickCellButton(object sender, CellEventArgs e)
{
customerID = e.Cell.Row.Cells["CUSTOMER_NO"].Text;
if (e.Cell.Column.Key == "BTN_ORDER")
{
FrmBuyerOrder frmorder = new FrmBuyerOrder(this.ob);
frmorder.Customer_no = customerID;
frmorder.Sale_org = saleorg;
frmorder.Custm_use = "100202";
frmorder.Chn_fl = combleTo == "101" ? "1" : "0";
frmorder.Bigarea = bigarea;
frmorder.Region_no = combelonCity == "" ? "8" : combelonCity; ;
frmorder.StrOperator = strOperator;
frmorder.ShowDialog();
}
else if (e.Cell.Column.Key == "BTN_RECEIVE")
{
FrmBuyerSend frmSend = new FrmBuyerSend(this.ob);
frmSend.Customer_no = customerID;
frmSend.Sale_org = saleorg;
frmSend.Custm_use = "100203";
frmSend.Region_no = combelonCity == "" ? "8" : combelonCity;
frmSend.StrOperator = strOperator;
frmSend.ShowDialog();
}
//CUSTOMER_NM
expanlixName = e.Cell.Row.Cells["CUSTOMER_NM"].Text;
doQuery();
}
private void textEditorBaseName_Validating(object sender, CancelEventArgs e)
{
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textEditorBaseName.Text) > 100)
{
MessageBox.Show("录入客户名称【中文名不能大于50个字符/英文名不能大于100个字符】数据验证失败,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
e.Cancel = true;
}
}
private void textAbrviTion_Validating(object sender, CancelEventArgs e)
{
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textAbrviTion.Text) > 60)
{
MessageBox.Show("录入客户简称【中文名不能大于30个字符/英文名不能大于60个字符】数据验证失败,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
e.Cancel = true;
}
}
private void ultraTextUserGrp_Validating(object sender, CancelEventArgs e)
{
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(ultraTextUserGrp.Text) > 40)
{
MessageBox.Show("录入用户组【中文名不能大于20个字符/英文名不能大于40个字符】数据验证失败,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
e.Cancel = true;
}
}
private void textEditorORG_Validating(object sender, CancelEventArgs e)
{
if (Core.Mes.Client.Comm.Globals.GetStrBytesLength(textEditorORG.Text) > 60)
{
MessageBox.Show("录入机构代码【中文名不能大于30个字符/英文名不能大于60个字符】数据验证失败,请重新录入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
e.Cancel = true;
}
}
}
}