using System; using System.Collections.Generic; using System.Data; using System.Windows.Forms; using CoreFS.CA06; using Core.Mes.Client.Comm.Control; using Infragistics.Win.UltraWinGrid; using Infragistics.Win; using System.Collections; using System.Linq; using Core.StlMes.Client.SaleComm; using Core.Mes.Client.Comm.Server; using Infragistics.Win.UltraWinEditors; using Core.Mes.Client.Comm.Tool; using Core.StlMes.Client.SaleOrder.ReviewForm; namespace Core.StlMes.Client.SaleOrder { public partial class frmOrderProducer : FrmBase { //定位 string prdcrIndex = ""; public frmOrderProducer() { InitializeComponent(); } DataTable dtMain = new DataTable(); //监制主表 DataTable dtVice = new DataTable(); //监制从表 //witch Tab private string tabNum = "1"; public override void ToolBar_Click(object sender, string ToolbarKey) { switch (ToolbarKey) { case "doQuery": doQuery(); break; case "doAdd": doAdd(); break; case "doAddHt": doAddHt(); break; case "doFect": doFect(); break; case "doFeckBack": doFectBack(); break; case "doFeckBoss": doFectBoss(); break; case "Export": exportData(); break; case "Copy": CopyData(); break; case "Paste": PasteData(); break; case "doClose": this.Close(); break; } } public void doAddHt() { ultraGrid2.UpdateData(); if (ultraGrid2.Rows.Count == 0) { MessageBox.Show("没有需要保存的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } int mflag = 0; //主表标识 int flag = 0; //从表标识 ArrayList mlist = new ArrayList(); //主表修改参数 ArrayList clist = new ArrayList(); // 从表修改参数 ArrayList dlist = new ArrayList(); //从表需要清空的参数 foreach (UltraGridRow row in ultraGrid2.Rows) { if (Convert.ToBoolean(row.Cells["CHK"].Value)) { string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString(); string prdcrNoIndex = row.Cells["PRDCR_INDEX"].Value.ToString(); string status = GetPrdcrStatus(prdcrNo, prdcrNoIndex); //改流程注释下面限制 if (status == "W") { MessageUtil.ShowWarning("您所选记录,监制处于待确认状态,不能修改!"); row.Activate(); return; } if (row.Cells["PRDCR_DESC"].Text.Trim() == "") { MessageUtil.ShowWarning("请选择监制说明!"); return; } mflag += 1; ArrayList list = new ArrayList(); list.Add(row.Cells["PRDCR_DESC"].Value.ToString()); list.Add(this.txtPrdcrFile.Text); list.Add(UserInfo.GetUserName()); list.Add(prdcrNo.Substring(0, 32).ToString()); mlist.Add(list); foreach (UltraGridRow crow in row.ChildBands[0].Rows) { if (Convert.ToBoolean(crow.Cells["XZ"].Value)) { ArrayList parm = new ArrayList(); if (crow.Cells["PRDCR_PRC_DESC"].Value.ToString() == "") { MessageBox.Show("请选择监制类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (crow.Cells["PRDCR_ADVC_DAY"].Value.ToString() == "") { MessageBox.Show("请输入提前天数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (crow.Cells["PDEPT_NO"].Value.ToString() == "") { MessageBox.Show("请选择监制单位1!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (crow.Cells["PRDCR_MAN"].Value.ToString() == "") { MessageBox.Show("请选择监制人员1!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Convert.ToBoolean(crow.Cells["XZ"].Value)) { parm.Add("1"); } else { parm.Add("0"); } parm.Add(crow.Cells["PRDCR_PRC_DESC"].Value.ToString()); parm.Add(crow.Cells["PRDCR_ADVC_DAY"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NO"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NAME"].Value.ToString()); parm.Add(crow.Cells["PHONE"].Value.ToString()); parm.Add(crow.Cells["PRDCR_MAN"].Text); parm.Add(crow.Cells["PRDCR_MAN_PHONE"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NO2"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NAME2"].Value.ToString()); parm.Add(crow.Cells["PHONE2"].Value.ToString()); parm.Add(crow.Cells["PRDCR_MAN2"].Text); parm.Add(crow.Cells["PRDCR_MAN_PHONE2"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NO3"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NAME3"].Value.ToString()); parm.Add(crow.Cells["PHONE3"].Value.ToString()); parm.Add(crow.Cells["PRDCR_MAN3"].Text); parm.Add(crow.Cells["PRDCR_MAN_PHONE3"].Value.ToString()); parm.Add(crow.Cells["MEMO"].Value.ToString()); parm.Add(crow.Cells["PRDCR_NO"].Value.ToString().Substring(0, 32)); flag += 1; clist.Add(parm); } } } } if (mflag == 0) { MessageUtil.ShowWarning("请选择需要保存的制程!"); return; } if (flag == 0) { MessageUtil.ShowWarning("一个制程下请至少维护一条监制信息!"); return; } if (MessageBox.Show("是否确认保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer"; ccp.MethodName = "doAddHt"; ccp.ServerParams = new object[] { mlist, clist }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageUtil.ShowTips("保存成功!"); doQuery(); } } private void exportData() { if(tabNum=="1"){ GridHelper.ulGridToExcel(this.ultraGrid1, "监制要求管理"); } else { GridHelper.ulGridToExcel(this.ultraGrid3, "监制要求查看"); } } /// /// 行复制 /// /// /// private void CopyRowToRow(DataRow srcRow, DataRow desRow) { for (int i = 0; i < srcRow.Table.Columns.Count; i++) { string columnName = srcRow.Table.Columns[i].ColumnName; desRow[columnName] = srcRow[columnName]; } } /// /// 复制选择的数据 /// private void CopyData() { // ultraGrid2 ultraGrid2.UpdateData(); UltraGridRow ugr = ultraGrid2.ActiveRow; if (ugr == null) { MessageUtil.ShowWarning("请选择一条制程主表记录或者从表记录进行复制!"); return; } if (ugr.HasParent()) { ugr = ugr.ParentRow; } dtMain = OrderProducer_Main.Copy(); dtMain.Clear(); dtVice = OrderProducer_Tain.Copy(); dtVice.Clear(); DataRow mRow = dtMain.NewRow(); CopyRowToRow(((DataRowView)ugr.ListObject).Row, mRow); dtMain.Rows.Add(mRow); //复制子表 foreach (UltraGridRow uRow in ugr.ChildBands[0].Rows) { DataRow vRow = dtVice.NewRow(); if (uRow.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { CopyRowToRow(((DataRowView)uRow.ListObject).Row, vRow); dtVice.Rows.Add(vRow); } } } /// /// 粘贴复制的数据 /// private void PasteData() { if (dtMain == null || dtMain.Rows.Count <= 0 || dtVice == null || dtVice.Rows.Count <= 0) { MessageUtil.ShowWarning("没有数据,请复制后再进行粘贴操作!"); return; } UltraGridRow ugr = ultraGrid2.ActiveRow; if (ugr == null) { MessageUtil.ShowWarning("请选择一条制程主表记录或者从表记录来粘贴你复制的数据!"); return; } if (ugr.HasParent()) { ugr = ugr.ParentRow; } //粘贴主记录 OrderProducer_Main OrderProducer_Tain //OrderProducer_Main.BeginInit(); DataRow mRow = dtMain.Rows[0]; ugr.Cells["PRDCR_DESC"].Value = mRow["PRDCR_DESC"].ToString(); //粘贴从表 foreach (UltraGridRow uRow in ugr.ChildBands[0].Rows) { foreach (DataRow dr in dtVice.Rows) { if (uRow.Cells["PROCESS_DESC"].Value.ToString() == dr["PROCESS_DESC"].ToString() && uRow.Cells["PROCESS_DESC_C"].Value.ToString() == dr["PROCESS_DESC_C"].ToString() && uRow.Cells["STATION_DESC"].Value.ToString() == dr["STATION_DESC"].ToString()) { uRow.Cells["PRDCR_PRC_DESC"].Value = dr["PRDCR_PRC_DESC"].ToString(); uRow.Cells["PRDCR_ADVC_DAY"].Value = dr["PRDCR_ADVC_DAY"].ToString(); uRow.Cells["PDEPT_NO"].Value = dr["PDEPT_NO"].ToString(); uRow.Cells["PHONE"].Value = dr["PHONE"].ToString(); uRow.Cells["PRDCR_MAN"].Value = dr["PRDCR_MAN"].ToString(); uRow.Cells["PRDCR_MAN_PHONE"].Value = dr["PRDCR_MAN_PHONE"].ToString(); uRow.Cells["PDEPT_NO2"].Value = dr["PDEPT_NO2"].ToString(); uRow.Cells["PHONE2"].Value = dr["PHONE2"].ToString(); uRow.Cells["PRDCR_MAN2"].Value = dr["PRDCR_MAN2"].ToString(); uRow.Cells["PRDCR_MAN_PHONE2"].Value = dr["PRDCR_MAN_PHONE2"].ToString(); uRow.Cells["PDEPT_NO3"].Value = dr["PDEPT_NO3"].ToString(); uRow.Cells["PHONE3"].Value = dr["PHONE3"].ToString(); uRow.Cells["PRDCR_MAN3"].Value = dr["PRDCR_MAN3"].ToString(); uRow.Cells["PRDCR_MAN_PHONE3"].Value = dr["PRDCR_MAN_PHONE3"].ToString(); uRow.Cells["MEMO"].Value = dr["MEMO"].ToString(); uRow.Cells["XZ"].Value = true; } } } ultraGrid2.UpdateData(); } /// /// 监制通过 /// public void doFectBoss() { ultraGrid1.UpdateData(); int rCount = 0; ArrayList list = new ArrayList(); foreach (UltraGridRow row in ultraGrid1.Rows) { if (Convert.ToBoolean(row.Cells["CHK"].Value)) { rCount += 1; string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString(); List status = GetPrdcrAllStatus(prdcrNo); if (status.Contains("S")) { MessageUtil.ShowWarning("您所选记录监制已经审批通过!"); return; } list.Add(row.Cells["PRDCR_NO"].Value.ToString()); } } if (rCount == 0) { MessageBox.Show("请选择您要审批通过的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (MessageBox.Show("是否审批通过?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.No) return; CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer"; ccp.MethodName = "coreOrderProducerDeptProsu"; ccp.ServerParams = new object[] { list, this.UserInfo.GetUserName() }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageBox.Show("操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); doQuery(); } } /// /// 监制退回 /// public void doFectBack() { ultraGrid1.UpdateData(); int rCount = 0; ArrayList list = new ArrayList(); DataTable dt = MakeDataTable(); foreach (UltraGridRow row in ultraGrid1.Rows) { if (Convert.ToBoolean(row.Cells["CHK"].Value)) { rCount += 1; string orderNo = row.Cells["ORDER_NO"].Value.ToString(); string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString(); List status = GetPrdcrAllStatus(prdcrNo); if (status.Contains("S")) { string orderSts = GetOrderStatus(orderNo); if (orderSts == "12020402") //提报完毕 { MessageUtil.ShowWarning("您所选合同已经提报,监制无法退回!"); return; } } DataTable dt1 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcr", new Object[] { prdcrNo }, this.ob); foreach (DataRow t in dt1.Rows) { DataRow dr = dt.NewRow(); dr["ORDER_NO"] = row.Cells["ORDER_NO"].Value.ToString(); dr["ORDER_SEQ"] = row.Cells["ORDER_SEQ"].Value.ToString(); dr["MSC_PLINE"] = t["MSC_PLINE"].ToString(); dr["MSC_PLINE_DESC"] = t["MSC_PLINE_DESC"].ToString(); dr["PSC_DESC"] = row.Cells["PSC_DESC"].Value.ToString(); dr["STD_NAME"] = row.Cells["STD_NAME"].Value.ToString(); dr["PRODUCNAME"] = row.Cells["PRODUCNAME"].Value.ToString(); //dr["STD_STYLE_DESC"] = row.Cells["STD_STYLE_DESC"].Value.ToString(); dr["MODEL_DESC"] = row.Cells["MODEL_DESC"].Value.ToString(); dr["PRDCR_NO"] = t["PRDCR_NO"].ToString(); dr["PRDCR_INDEX"] = t["PRDCR_INDEX"].ToString(); dt.Rows.Add(dr); } } } if (rCount == 0) { MessageBox.Show("请选择您要审批退回的记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (MessageBox.Show("是否审批退回?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return; FrmOrderPrdcrBack fop = new FrmOrderPrdcrBack(); fop.Dt = dt; fop.ShowDialog(); dt = fop.Dt; if (fop.DialogResult != DialogResult.OK) return; foreach (DataRow dr in dt.Rows) { ArrayList parm = new ArrayList(); parm.Add(UserInfo.GetUserName()); parm.Add(dr["FAIL_RSN"].ToString()); parm.Add(dr["PRDCR_INDEX"].ToString()); parm.Add(dr["PRDCR_NO"].ToString()); list.Add(parm); } CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer"; ccp.MethodName = "coreOrderProducerDeptProBa"; ccp.ServerParams = new object[] { list }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageBox.Show("退回操作成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); doQuery(); } } /// /// 提报监制 /// public void doFect() { ultraGrid1.UpdateData(); int rCount = 0; ArrayList list = new ArrayList(); foreach (UltraGridRow row in ultraGrid1.Rows) { if (Convert.ToBoolean(row.Cells["CHK"].Value)) { rCount += 1; string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString(); List status = GetPrdcrAllStatus(prdcrNo); if (status.Contains("L")) { MessageUtil.ShowWarning("您所选记录,监制尚未维护!"); return; } else if (status.Contains("W")) { MessageUtil.ShowWarning("您所选记录,监制已经提报!"); return; } else if (status.Contains("S")) { MessageUtil.ShowWarning("您所选记录,监制已经生效!"); return; } else if (status.Contains("F")) { MessageUtil.ShowWarning("您所选记录,存在回退的监制,请修改!"); return; } list.Add(row.Cells["PRDCR_NO"].Value.ToString()); } } if (rCount == 0) { MessageBox.Show("请选择您要提报的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (MessageBox.Show("是否审批提报?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) return; CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer"; ccp.MethodName = "coreOrderProducerDeptProFe"; ccp.ServerParams = new object[] { list }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageBox.Show("提报成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); doQuery(); } } /// /// 保存 /// public void doAdd() { ultraGrid2.UpdateData(); if (ultraGrid2.Rows.Count == 0) { MessageBox.Show("没有需要保存的数据!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } int mflag = 0; //主表标识 int flag = 0; //从表标识 ArrayList mlist = new ArrayList(); //主表修改参数 ArrayList clist = new ArrayList(); // 从表修改参数 ArrayList dlist = new ArrayList(); //从表需要清空的参数 foreach (UltraGridRow row in ultraGrid2.Rows) { if (Convert.ToBoolean(row.Cells["CHK"].Value)) { string prdcrNo = row.Cells["PRDCR_NO"].Value.ToString(); string prdcrNoIndex = row.Cells["PRDCR_INDEX"].Value.ToString(); string status = GetPrdcrStatus(prdcrNo, prdcrNoIndex); //改流程注释下面限制 if (status == "W") { MessageUtil.ShowWarning("您所选记录,监制处于待确认状态,不能修改!"); row.Activate(); return; } //if (status == "S") //{ // MessageUtil.ShowWarning("您所选记录,监制已经生效,不能修改!"); // row.Activate(); // return; //} if (row.Cells["PRDCR_DESC"].Text.Trim() == "") { MessageUtil.ShowWarning("请选择监制说明!"); return; } mflag += 1; ArrayList list = new ArrayList(); list.Add(row.Cells["PRDCR_DESC"].Value.ToString()); list.Add(this.txtPrdcrFile.Text); list.Add(UserInfo.GetUserName()); list.Add(prdcrNo); list.Add(prdcrNoIndex); mlist.Add(list); foreach (UltraGridRow crow in row.ChildBands[0].Rows) { if (Convert.ToBoolean(crow.Cells["XZ"].Value)) { ArrayList parm = new ArrayList(); if (crow.Cells["PRDCR_PRC_DESC"].Value.ToString() == "") { MessageBox.Show("请选择监制类型!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (crow.Cells["PRDCR_ADVC_DAY"].Value.ToString() == "") { MessageBox.Show("请输入提前天数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (crow.Cells["PDEPT_NO"].Value.ToString() == "") { MessageBox.Show("请选择监制单位1!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (crow.Cells["PRDCR_MAN"].Value.ToString() == "") { MessageBox.Show("请选择监制人员1!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (Convert.ToBoolean(crow.Cells["XZ"].Value)) { parm.Add("1"); } else { parm.Add("0"); } parm.Add(crow.Cells["PRDCR_PRC_DESC"].Value.ToString()); parm.Add(crow.Cells["PRDCR_ADVC_DAY"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NO"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NAME"].Value.ToString()); parm.Add(crow.Cells["PHONE"].Value.ToString()); parm.Add(crow.Cells["PRDCR_MAN"].Text); parm.Add(crow.Cells["PRDCR_MAN_PHONE"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NO2"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NAME2"].Value.ToString()); parm.Add(crow.Cells["PHONE2"].Value.ToString()); parm.Add(crow.Cells["PRDCR_MAN2"].Text); parm.Add(crow.Cells["PRDCR_MAN_PHONE2"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NO3"].Value.ToString()); parm.Add(crow.Cells["PDEPT_NAME3"].Value.ToString()); parm.Add(crow.Cells["PHONE3"].Value.ToString()); parm.Add(crow.Cells["PRDCR_MAN3"].Text); parm.Add(crow.Cells["PRDCR_MAN_PHONE3"].Value.ToString()); parm.Add(crow.Cells["MEMO"].Value.ToString()); parm.Add(crow.Cells["PRDCR_NO"].Value.ToString()); parm.Add(crow.Cells["PRDCR_INDEX"].Value.ToString()); parm.Add(crow.Cells["STATION_CODE"].Value.ToString()); flag += 1; clist.Add(parm); } else { //未监制的工序点 ArrayList al = new ArrayList(); al.Add(crow.Cells["PRDCR_NO"].Value.ToString()); al.Add(crow.Cells["PRDCR_INDEX"].Value.ToString()); al.Add(crow.Cells["STATION_CODE"].Value.ToString()); dlist.Add(al); } } } } if (mflag == 0) { MessageUtil.ShowWarning("请选择需要保存的制程!"); return; } if (flag == 0) { MessageUtil.ShowWarning("一个制程下请至少维护一条监制信息!"); return; } if (MessageBox.Show("是否确认保存?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) { return; } CoreClientParam ccp = new CoreClientParam(); ccp.IfShowErrMsg = false; ccp.ServerName = "com.steering.pss.sale.order.CoreOrderProducer"; ccp.MethodName = "save"; ccp.ServerParams = new object[] { mlist, clist, dlist }; ccp = this.ExecuteNonQuery(ccp, CoreInvokeType.Internal); if (ccp != null) { if (ccp.ReturnCode == -1) { MessageUtil.ShowWarning(ccp.ReturnInfo); return; } MessageUtil.ShowTips("保存成功!"); doQuery(); } } public void doQuery() { //创建时间 string date = ""; string From = "1000-01-01 00:00:01"; string End = "9999-12-31 23:59:59"; if (che_date.Checked) { if (Convert.ToDateTime(date_starte.Value) > Convert.ToDateTime(date_end.Value)) { MessageBox.Show("请输入的日期范围不正确!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } From = Convert.ToDateTime(date_starte.Value).ToString("yyyy-MM-dd") + " 00:00:01"; End = Convert.ToDateTime(date_end.Value).ToString("yyyy-MM-dd") + " 23:59:59"; } date = " AND T.CREATE_TIME>= TO_DATE('" + From + "' ,'YYYY-MM-DD HH24:MI:SS') AND T.CREATE_TIME <= TO_DATE( '" + End + "','YYYY-MM-DD HH24:MI:SS')"; ultraGrid1.UpdateData(); UltraGridRow ugr = ultraGrid1.ActiveRow; string prdcrNo = ""; if (ugr != null) { prdcrNo = ugr.Cells["PRDCR_NO"].Value.ToString(); } //合同号 string order = ""; if (che_order.Checked) { if (te_order.Text == "") { MessageBox.Show("请输入合同号!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } else { order = te_order.Text; } } //监制的要求状态 var status = dept_stuts.Checked ? cho_stuts.CheckedItems.Select(p => p.DataValue.ToString()).ToArray() : new string[] { "M", "W", "S", "F", "L" }; if (tabNum == "1") { dataSet2.Clear(); } else if (tabNum == "2") { dataSet4.Clear(); } string[] arr = this.ValidDataPurviewIds; DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.CoreOrderProducerHeadQuery", new Object[] { date, order, status, arr, this.CustomInfo, tabNum }, this.ob); if (tabNum == "1") { GridHelper.CopyDataToDatatable(ref dt, ref this.OrderProduSql, true); } else if (tabNum == "2") { GridHelper.CopyDataToDatatable(ref dt, ref this.dataTable1, true); } if (tabNum == "1") { if (prdcrNo != "") { foreach (UltraGridRow row in ultraGrid1.Rows) { if (row.Cells["PRDCR_NO"].Value.ToString().Equals(prdcrNo)) { row.Activate(); break; } } } } } private void che_date_CheckedChanged(object sender, EventArgs e) { date_starte.Enabled = che_date.Checked; date_end.Enabled = che_date.Checked; } private void dept_stuts_CheckedChanged(object sender, EventArgs e) { cho_stuts.Enabled = dept_stuts.Checked; } private void che_order_CheckedChanged(object sender, EventArgs e) { te_order.Enabled = che_order.Checked; } ValueList vlistManageNo = new ValueList(); ValueList vlistManageNo1 = new ValueList(); private void frmOrderProducer_Load(object sender, EventArgs e) { date_starte.Value = DateTime.Now.AddDays(-30).ToShortDateString(); date_end.Value = DateTime.Now.ToShortDateString(); UltraComboEditor uce = new UltraComboEditor(); DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getPrdcrDesc", null, this.ob); uce.DataSource = dt; this.Controls.Add(uce); uce.Visible = false; uce.DisplayMember = "BASENAME"; uce.ValueMember = "BASECODE"; ultraGrid2.DisplayLayout.Bands[0].Columns["PRDCR_DESC"].EditorComponent = uce; ultraGrid2.DisplayLayout.Bands[0].Columns["PRDCR_DESC"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; ultraGrid4.DisplayLayout.Bands[0].Columns["PRDCR_DESC"].EditorComponent = uce; ultraGrid4.DisplayLayout.Bands[0].Columns["PRDCR_DESC"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; if (this.CustomInfo == "2") { dept_stuts.Checked = true; cho_stuts.Value = "W"; } DataTable dt3 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.CoreOrderProducerPdeptBase", null, this.ob); vlistManageNo = GeneralValuelist(ref dt3, "PDEPT_NO", "PDEPT_NAME"); DataTable dt4 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.CoreOrderProducerPrcBase", null, this.ob); vlistManageNo1 = GeneralValuelist(ref dt4, "BASECODE", "BASENAME"); } public static ValueList GeneralValuelist(ref DataTable table, string strKey, string strText) { if (table == null || !table.Columns.Contains(strKey) || !table.Columns.Contains(strText)) { return null; } ArrayList alist = new ArrayList(); ValueList vlist = new ValueList(); for (int i = 0; i < table.Rows.Count; i++) { try { if (!alist.Contains(table.Rows[i][strKey])) { alist.Add(table.Rows[i][strKey]); vlist.ValueListItems.Add(table.Rows[i][strKey], Convert.ToString(table.Rows[i][strText])); } } catch { } } return vlist; } private void ultraGrid1_AfterRowActivate(object sender, EventArgs e) { UltraGridRow ugr = ultraGrid1.ActiveRow; if (ugr != null) { this.Cursor = Cursors.WaitCursor; for (int i = 0; i < ugr.Cells.Count; i++) { if (!ugr.Cells[i].Column.Key.Equals("CHK")) ugr.Cells[i].Activation = Activation.ActivateOnly; } doQueryProducer(); } this.Cursor = Cursors.Default; } public void doQueryProducer() { ultraGrid1.UpdateData(); UltraGridRow ugr = ultraGrid1.ActiveRow; if (ugr == null) return; //查询合同监制从表 string prdcrNo = ugr.Cells["PRDCR_NO"].Value.ToString(); DataTable dt1 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcr", new Object[] { prdcrNo }, this.ob); DataTable dt2 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcrLst", new Object[] { prdcrNo }, this.ob); OrderProducer_Tain.Clear(); GridHelper.CopyDataToDatatable(ref dt1, ref this.OrderProducer_Main, true); GridHelper.CopyDataToDatatable(ref dt2, ref this.OrderProducer_Tain, true); for (int i = 0; i < ultraGrid2.Rows.Count; i++) { for (int j = 0; j < ultraGrid2.Rows[i].ChildBands[0].Rows.Count; j++) { ultraGrid2.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO"].ValueList = vlistManageNo; ultraGrid2.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO2"].ValueList = vlistManageNo; ultraGrid2.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO3"].ValueList = vlistManageNo; ultraGrid2.Rows[i].ChildBands[0].Rows[j].Cells["PRDCR_PRC_DESC"].ValueList = vlistManageNo1; } } } private void ultraGrid2_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e) { ultraGrid2.UpdateData(); if (e.Cell.Column.Key.Equals("CHK")) { e.Cell.Row.ExpandAll(); if (e.Cell.Row.Cells["CHK"].Value.ToString().ToUpper() != "TRUE") { e.Cell.Row.Cells["PRDCR_DESC"].Activation = Activation.ActivateOnly; } else { e.Cell.Row.Cells["PRDCR_DESC"].Activation = Activation.AllowEdit; } } else if (e.Cell.Column.Key.Equals("PRDCR_DESC")) //监制说明 { string code = e.Cell.Value.ToString(); //获取这个CODE下的所有工序点。 DataTable stDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getPrdcrStationCode", new object[] { code }, this.ob); List list = new List(); if (stDt != null && stDt.Rows.Count > 0) { for (int i = 0; i < stDt.Rows.Count; i++) list.Add(stDt.Rows[i][0].ToString()); } for (int j = 0; j < e.Cell.Row.ChildBands[0].Rows.Count; j++) { if (list.Contains(e.Cell.Row.ChildBands[0].Rows[j].Cells["STATION_CODE"].Value.ToString())) e.Cell.Row.ChildBands[0].Rows[j].Cells["XZ"].Value = true; else e.Cell.Row.ChildBands[0].Rows[j].Cells["XZ"].Value = false; } } else if (e.Cell.Column.Key.Equals("PRDCR_PRC_DESC")) { int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") row.Cells["PRDCR_PRC_DESC"].Value = e.Cell.Value; } } } else if (e.Cell.Column.Key.Equals("PRDCR_ADVC_DAY")) { int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") row.Cells["PRDCR_ADVC_DAY"].Value = e.Cell.Value; } } } else if (e.Cell.Column.Key == "PDEPT_NO" || e.Cell.Column.Key == "PDEPT_NO2" || e.Cell.Column.Key == "PDEPT_NO3") { string unit = ""; if (e.Cell.Column.Key == "PDEPT_NO") { unit = e.Cell.Value.ToString(); e.Cell.Row.Cells["PDEPT_NAME"].Value = e.Cell.Text; DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { unit }, this.ob); //监制人 ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_"); e.Cell.Row.Cells["PRDCR_MAN"].ValueList = vl; e.Cell.Row.Cells["PRDCR_MAN"].Value = ""; e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value = ""; int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { row.Cells["PDEPT_NO"].Value = e.Cell.Value; row.Cells["PHONE"].Value = e.Cell.Row.Cells["PHONE"].Value; row.Cells["PRDCR_MAN"].Value = e.Cell.Row.Cells["PRDCR_MAN"].Value; row.Cells["PRDCR_MAN_PHONE"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value; } } } } if (e.Cell.Column.Key == "PDEPT_NO2") { unit = e.Cell.Value.ToString(); e.Cell.Row.Cells["PDEPT_NAME2"].Value = e.Cell.Text; DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { unit }, this.ob); //监制人 ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_"); e.Cell.Row.Cells["PRDCR_MAN2"].ValueList = vl; e.Cell.Row.Cells["PRDCR_MAN2"].Value = ""; e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value = ""; int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { row.Cells["PDEPT_NO2"].Value = e.Cell.Value; row.Cells["PHONE2"].Value = e.Cell.Row.Cells["PHONE2"].Value; row.Cells["PRDCR_MAN2"].Value = e.Cell.Row.Cells["PRDCR_MAN2"].Value; row.Cells["PRDCR_MAN_PHONE2"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value; } } } } if (e.Cell.Column.Key == "PDEPT_NO3") { unit = e.Cell.Value.ToString(); e.Cell.Row.Cells["PDEPT_NAME3"].Value = e.Cell.Text; DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { unit }, this.ob); //监制人 ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_"); e.Cell.Row.Cells["PRDCR_MAN3"].ValueList = vl; e.Cell.Row.Cells["PRDCR_MAN3"].Value = ""; e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value = ""; int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { row.Cells["PDEPT_NO3"].Value = e.Cell.Value; row.Cells["PHONE3"].Value = e.Cell.Row.Cells["PHONE3"].Value; row.Cells["PRDCR_MAN3"].Value = e.Cell.Row.Cells["PRDCR_MAN3"].Value; row.Cells["PRDCR_MAN_PHONE3"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value; } } } } DataTable dt = Globals.GetData("com.steering.pss.sale.order.CoreOrderProducer.CoreOrderProducerPhoneQuery", new Object[] { unit }, this.ob); //单位电话 string phone = dt.Rows.Count == 0 ? "" : dt.Rows[0][0].ToString2(); if (e.Cell.Column.Key == "PDEPT_NO") { e.Cell.Row.Cells["PHONE"].Value = phone; int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { row.Cells["PHONE"].Value = phone; } } } } else if (e.Cell.Column.Key == "PDEPT_NO2") { e.Cell.Row.Cells["PHONE2"].Value = phone; int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { row.Cells["PHONE2"].Value = phone; } } } } else if (e.Cell.Column.Key == "PDEPT_NO3") { e.Cell.Row.Cells["PHONE3"].Value = phone; int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { row.Cells["PHONE3"].Value = phone; } } } } } else if (e.Cell.Column.Key.Equals("PRDCR_MAN")) { e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value = e.Cell.Value; int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { row.Cells["PDEPT_NO"].Value = e.Cell.Row.Cells["PDEPT_NO"].Value; row.Cells["PRDCR_MAN"].Value = e.Cell.Text; row.Cells["PRDCR_MAN_PHONE"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value; } } } } else if (e.Cell.Column.Key.Equals("PRDCR_MAN2")) { e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value = e.Cell.Value; int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { row.Cells["PDEPT_NO2"].Value = e.Cell.Row.Cells["PDEPT_NO2"].Value; row.Cells["PRDCR_MAN2"].Value = e.Cell.Text; row.Cells["PRDCR_MAN_PHONE2"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value; } } } } else if (e.Cell.Column.Key.Equals("PRDCR_MAN3")) { e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value = e.Cell.Value; int num = Convert.ToInt32(e.Cell.Row.Cells["ROWNUM"].Value); foreach (UltraGridRow row in e.Cell.Row.ParentRow.ChildBands[0].Rows) { if (Convert.ToInt32(row.Cells["ROWNUM"].Value) > num) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE") { row.Cells["PDEPT_NO3"].Value = e.Cell.Row.Cells["PDEPT_NO3"].Value; row.Cells["PRDCR_MAN3"].Value = e.Cell.Text; row.Cells["PRDCR_MAN_PHONE3"].Value = e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value; } } } } else if (e.Cell.Column.Key == "XZ") { if (Convert.ToBoolean(e.Cell.Value)) { e.Cell.Row.Cells["PRDCR_PRC_FL"].Value = true; e.Cell.Row.Cells["PRDCR_PRC_FL"].Activation = Activation.AllowEdit; e.Cell.Row.Cells["PRDCR_PRC_DESC"].Activation = Activation.AllowEdit; e.Cell.Row.Cells["PRDCR_ADVC_DAY"].Activation = Activation.AllowEdit; e.Cell.Row.Cells["PDEPT_NO"].Activation = Activation.AllowEdit; e.Cell.Row.Cells["PRDCR_MAN"].Activation = Activation.AllowEdit; e.Cell.Row.Cells["PDEPT_NO2"].Activation = Activation.AllowEdit; e.Cell.Row.Cells["PRDCR_MAN2"].Activation = Activation.AllowEdit; e.Cell.Row.Cells["PDEPT_NO3"].Activation = Activation.AllowEdit; e.Cell.Row.Cells["PRDCR_MAN3"].Activation = Activation.AllowEdit; e.Cell.Row.Cells["MEMO"].Activation = Activation.AllowEdit; //自动带出存在的记录的数据 string prdcr = e.Cell.Row.ParentRow.Cells["PRDCR_NO"].Value.ToString(); DataRow[] arr = OrderProducer_Tain.Select("PRDCR_NO = '" + prdcr + "' AND XZ='True' AND PRDCR_PRC_DESC <> '' ", ""); if (arr.Length > 0) { DataRow dr = arr[arr.Length - 1]; if (e.Cell.Row.Cells["PRDCR_PRC_DESC"].Text == "" || e.Cell.Row.Cells["PRDCR_ADVC_DAY"].Text == "" || e.Cell.Row.Cells["PDEPT_NO"].Text == "") { e.Cell.Row.Cells["PRDCR_PRC_DESC"].Value = dr["PRDCR_PRC_DESC"].ToString(); e.Cell.Row.Cells["PRDCR_ADVC_DAY"].Value = dr["PRDCR_ADVC_DAY"].ToString(); e.Cell.Row.Cells["PDEPT_NO"].Value = dr["PDEPT_NO"].ToString(); e.Cell.Row.Cells["PDEPT_NAME"].Value = dr["PDEPT_NAME"].ToString(); e.Cell.Row.Cells["PHONE"].Value = dr["PHONE"].ToString(); DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { dr["PDEPT_NO"].ToString() }, this.ob); //监制人 ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_"); e.Cell.Row.Cells["PRDCR_MAN"].ValueList = vl; e.Cell.Row.Cells["PRDCR_MAN"].Value = dr["PRDCR_MAN"].ToString(); e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Value = dr["PRDCR_MAN_PHONE"].ToString(); e.Cell.Row.Cells["PDEPT_NO2"].Value = dr["PDEPT_NO2"].ToString(); e.Cell.Row.Cells["PDEPT_NAME2"].Value = dr["PDEPT_NAME2"].ToString(); e.Cell.Row.Cells["PHONE2"].Value = dr["PHONE2"].ToString(); DataTable personDt2 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { dr["PDEPT_NO2"].ToString() }, this.ob); //监制人 ValueList vl2 = GeneralValuelist(ref personDt2, "PHONE", "NAME_"); e.Cell.Row.Cells["PRDCR_MAN2"].ValueList = vl2; e.Cell.Row.Cells["PRDCR_MAN2"].Value = dr["PRDCR_MAN2"].ToString(); e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Value = dr["PRDCR_MAN_PHONE2"].ToString(); e.Cell.Row.Cells["PDEPT_NO3"].Value = dr["PDEPT_NO3"].ToString(); e.Cell.Row.Cells["PDEPT_NAME3"].Value = dr["PDEPT_NAME3"].ToString(); DataTable personDt3 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { dr["PDEPT_NO3"].ToString() }, this.ob); //监制人 ValueList vl3 = GeneralValuelist(ref personDt3, "PHONE", "NAME_"); e.Cell.Row.Cells["PRDCR_MAN3"].ValueList = vl3; e.Cell.Row.Cells["PHONE3"].Value = dr["PHONE3"].ToString(); e.Cell.Row.Cells["PRDCR_MAN3"].Value = dr["PRDCR_MAN3"].ToString(); e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Value = dr["PRDCR_MAN_PHONE3"].ToString(); } } } else { e.Cell.Row.Cells["PRDCR_PRC_FL"].Activation = Activation.ActivateOnly; e.Cell.Row.Cells["PRDCR_PRC_DESC"].Activation = Activation.ActivateOnly; e.Cell.Row.Cells["PRDCR_ADVC_DAY"].Activation = Activation.ActivateOnly; e.Cell.Row.Cells["PDEPT_NO"].Activation = Activation.ActivateOnly; e.Cell.Row.Cells["PRDCR_MAN_PHONE"].Activation = Activation.ActivateOnly; e.Cell.Row.Cells["PDEPT_NO2"].Activation = Activation.ActivateOnly; e.Cell.Row.Cells["PRDCR_MAN_PHONE2"].Activation = Activation.ActivateOnly; e.Cell.Row.Cells["PDEPT_NO3"].Activation = Activation.ActivateOnly; e.Cell.Row.Cells["PRDCR_MAN_PHONE3"].Activation = Activation.ActivateOnly; e.Cell.Row.Cells["MEMO"].Activation = Activation.ActivateOnly; } } } private void txtPrdcrFile_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e) { if (e.Button.Key == "DownLoad")//下载 { frmOrderProducerinfo stu = new frmOrderProducerinfo(); stu.oPbc = this.ob; stu.index = ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text; stu.ShowDialog(); } else//上传 { string sFileName = "Image/pss/sale/order/ORD_PK/ORD_LN_PK/PRDCR/" + ultraGrid1.ActiveRow.Cells["ORDER_NO"].Text; this.txtPrdcrFile.Text = sFileName; FlileUploadcomm.FlileUpload(sFileName); } } private void ultraGrid2_AfterRowActivate(object sender, EventArgs e) { ultraGrid2.UpdateData(); UltraGridRow row = ultraGrid2.ActiveRow; if (row == null) return; if (row.HasParent()) { if (row.Cells["XZ"].Value.ToString().ToUpper() == "TRUE" && this.CustomInfo == "1") { row.Cells["PRDCR_PRC_FL"].Value = true; row.Cells["PRDCR_PRC_FL"].Activation = Activation.AllowEdit; row.Cells["PRDCR_PRC_DESC"].Activation = Activation.AllowEdit; row.Cells["PRDCR_ADVC_DAY"].Activation = Activation.AllowEdit; row.Cells["PDEPT_NO"].Activation = Activation.AllowEdit; row.Cells["PHONE"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_MAN"].Activation = Activation.AllowEdit; row.Cells["PRDCR_MAN_PHONE"].Activation = Activation.ActivateOnly; row.Cells["PDEPT_NO2"].Activation = Activation.AllowEdit; row.Cells["PDEPT_NAME2"].Activation = Activation.AllowEdit; row.Cells["PHONE2"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_MAN2"].Activation = Activation.AllowEdit; row.Cells["PRDCR_MAN_PHONE2"].Activation = Activation.ActivateOnly; row.Cells["PDEPT_NO3"].Activation = Activation.AllowEdit; row.Cells["PDEPT_NAME3"].Activation = Activation.AllowEdit; row.Cells["PHONE3"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_MAN3"].Activation = Activation.AllowEdit; row.Cells["PRDCR_MAN_PHONE3"].Activation = Activation.ActivateOnly; row.Cells["MEMO"].Activation = Activation.AllowEdit; DataTable personDt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { row.Cells["PDEPT_NO"].Value.ToString() }, this.ob); //监制人 ValueList vl = GeneralValuelist(ref personDt, "PHONE", "NAME_"); row.Cells["PRDCR_MAN"].ValueList = vl; DataTable personDt2 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { row.Cells["PDEPT_NO2"].Value.ToString() }, this.ob); //监制人 ValueList vl2 = GeneralValuelist(ref personDt2, "PHONE", "NAME_"); row.Cells["PRDCR_MAN2"].ValueList = vl2; DataTable personDt3 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getDeptPerson", new object[] { row.Cells["PDEPT_NO3"].Value.ToString() }, this.ob); //监制人 ValueList vl3 = GeneralValuelist(ref personDt3, "PHONE", "NAME_"); row.Cells["PRDCR_MAN3"].ValueList = vl3; } else { if (this.CustomInfo == "2") { row.Cells["XZ"].Activation = Activation.ActivateOnly; row.ParentRow.Cells["PRDCR_DESC"].Activation = Activation.ActivateOnly; } row.Cells["PRDCR_PRC_FL"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_PRC_DESC"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_ADVC_DAY"].Activation = Activation.ActivateOnly; row.Cells["PDEPT_NO"].Activation = Activation.ActivateOnly; row.Cells["PDEPT_NAME"].Activation = Activation.ActivateOnly; row.Cells["PHONE"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_MAN"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_MAN_PHONE"].Activation = Activation.ActivateOnly; row.Cells["PDEPT_NO2"].Activation = Activation.ActivateOnly; row.Cells["PDEPT_NAME2"].Activation = Activation.ActivateOnly; row.Cells["PHONE2"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_MAN2"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_MAN_PHONE2"].Activation = Activation.ActivateOnly; row.Cells["PDEPT_NO3"].Activation = Activation.ActivateOnly; row.Cells["PDEPT_NAME3"].Activation = Activation.ActivateOnly; row.Cells["PHONE3"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_MAN3"].Activation = Activation.ActivateOnly; row.Cells["PRDCR_MAN_PHONE3"].Activation = Activation.ActivateOnly; row.Cells["MEMO"].Activation = Activation.ActivateOnly; } } else { if (this.CustomInfo == "2") { row.Cells["PRDCR_DESC"].Activation = Activation.ActivateOnly; } else { if (row.Cells["CHK"].Value.ToString().ToUpper() != "TRUE") { row.Cells["PRDCR_DESC"].Activation = Activation.ActivateOnly; } else { row.Cells["PRDCR_DESC"].Activation = Activation.AllowEdit; } } } } /// /// 获取监制状态 /// /// /// public string GetPrdcrStatus(string prdcrNo, string prdcrNoIndex) { string status = ""; DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getPrdcrStatus", new object[] { prdcrNo, prdcrNoIndex }, this.ob); if (dt != null && dt.Rows.Count > 0) { status = dt.Rows[0][0].ToString(); } return status; } /// /// 获取监制编码下的所有状态 /// /// /// public List GetPrdcrAllStatus(string prdcrNo) { List status = new List(); DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getPrdcrAllStatus", new object[] { prdcrNo }, this.ob); if (dt != null && dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { status.Add(dt.Rows[i][0].ToString()); } } return status; } /// /// 获取合同状态 /// /// /// public string GetOrderStatus(string orderNo) { string status = ""; DataTable dt = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderStatus", new object[] { orderNo }, this.ob); if (dt != null && dt.Rows.Count > 0) { status = dt.Rows[0][0].ToString(); } return status; } private void te_order_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == 13) doQuery(); } private void frmOrderProducer_Shown(object sender, EventArgs e) { if (this.CustomInfo.Equals("1")) { ultraLabel2.Text = "批量只是用于提报"; } else { ultraLabel2.Visible = false; } } private DataTable MakeDataTable() { DataTable dt = new DataTable(); dt.Columns.Add("ORDER_NO", Type.GetType("System.String")); dt.Columns.Add("ORDER_SEQ", Type.GetType("System.String")); dt.Columns.Add("MSC_PLINE", Type.GetType("System.String")); dt.Columns.Add("MSC_PLINE_DESC", Type.GetType("System.String")); dt.Columns.Add("PRDCR_NO", Type.GetType("System.String")); dt.Columns.Add("PRDCR_INDEX", Type.GetType("System.String")); dt.Columns.Add("PSC_DESC", Type.GetType("System.String")); dt.Columns.Add("STD_NAME", Type.GetType("System.String")); dt.Columns.Add("STD_STYLE_DESC", Type.GetType("System.String")); dt.Columns.Add("PRODUCNAME", Type.GetType("System.String")); dt.Columns.Add("MODEL_DESC", Type.GetType("System.String")); dt.Columns.Add("FAIL_RSN", Type.GetType("System.String")); return dt; } private void ultraTabControl1_SelectedTabChanged(object sender, Infragistics.Win.UltraWinTabControl.SelectedTabChangedEventArgs e) { try { if (ultraTabControl1.ActiveTab.Key == "0") { tabNum = "1"; } else if (ultraTabControl1.ActiveTab.Key == "1") { tabNum = "2"; ultraLabel2.Visible = false; dept_stuts.Checked = false; } SetToolMenuVisible(this.CustomInfo); } catch { } } /// /// 设置按钮的可见性 /// /// private void SetToolMenuVisible(string p) { if (toolMenu == null) return; if (p == "1") //监制维护 { if (tabNum == "1") { if (toolMenu.Toolbars[0].Tools.Exists("doAdd")) toolMenu.Toolbars[0].Tools["doAdd"].InstanceProps.Visible = DefaultableBoolean.True; if (toolMenu.Toolbars[0].Tools.Exists("doFect")) toolMenu.Toolbars[0].Tools["doFect"].InstanceProps.Visible = DefaultableBoolean.True; if (toolMenu.Toolbars[0].Tools.Exists("Copy")) toolMenu.Toolbars[0].Tools["Copy"].InstanceProps.Visible = DefaultableBoolean.True; if (toolMenu.Toolbars[0].Tools.Exists("Paste")) toolMenu.Toolbars[0].Tools["Paste"].InstanceProps.Visible = DefaultableBoolean.True; } else if (tabNum == "2") { if (toolMenu.Toolbars[0].Tools.Exists("doAdd")) toolMenu.Toolbars[0].Tools["doAdd"].InstanceProps.Visible = DefaultableBoolean.False; if (toolMenu.Toolbars[0].Tools.Exists("doFect")) toolMenu.Toolbars[0].Tools["doFect"].InstanceProps.Visible = DefaultableBoolean.False; if (toolMenu.Toolbars[0].Tools.Exists("Copy")) toolMenu.Toolbars[0].Tools["Copy"].InstanceProps.Visible = DefaultableBoolean.False; if (toolMenu.Toolbars[0].Tools.Exists("Paste")) toolMenu.Toolbars[0].Tools["Paste"].InstanceProps.Visible = DefaultableBoolean.False; } } else if (p == "2") //监制审批 { if (tabNum == "1") { if (toolMenu.Toolbars[0].Tools.Exists("doFeckBoss")) toolMenu.Toolbars[0].Tools["doFeckBoss"].InstanceProps.Visible = DefaultableBoolean.True; if (toolMenu.Toolbars[0].Tools.Exists("doFeckBack")) toolMenu.Toolbars[0].Tools["doFeckBack"].InstanceProps.Visible = DefaultableBoolean.True; } else if (tabNum == "2") { if (toolMenu.Toolbars[0].Tools.Exists("doFeckBoss")) toolMenu.Toolbars[0].Tools["doFeckBoss"].InstanceProps.Visible = DefaultableBoolean.False; if (toolMenu.Toolbars[0].Tools.Exists("doFeckBack")) toolMenu.Toolbars[0].Tools["doFeckBack"].InstanceProps.Visible = DefaultableBoolean.False; } } } private void ultraGrid3_AfterRowActivate(object sender, EventArgs e) { doQueryProducerViewer(); } public void doQueryProducerViewer() { ultraGrid3.UpdateData(); UltraGridRow ugr = ultraGrid3.ActiveRow; if (ugr == null) return; //查询合同监制从表 string prdcrNo = ugr.Cells["PRDCR_NO"].Value.ToString(); DataTable dt1 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcr", new Object[] { prdcrNo }, this.ob); DataTable dt2 = ServerHelper.GetData("com.steering.pss.sale.order.CoreOrderProducer.getOrderLinePrdcrLst", new Object[] { prdcrNo }, this.ob); dataTable3.Clear(); GridHelper.CopyDataToDatatable(ref dt1, ref this.dataTable2, true); GridHelper.CopyDataToDatatable(ref dt2, ref this.dataTable3, true); for (int i = 0; i < ultraGrid4.Rows.Count; i++) { for (int j = 0; j < ultraGrid4.Rows[i].ChildBands[0].Rows.Count; j++) { ultraGrid4.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO"].ValueList = vlistManageNo; ultraGrid4.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO2"].ValueList = vlistManageNo; ultraGrid4.Rows[i].ChildBands[0].Rows[j].Cells["PDEPT_NO3"].ValueList = vlistManageNo; ultraGrid4.Rows[i].ChildBands[0].Rows[j].Cells["PRDCR_PRC_DESC"].ValueList = vlistManageNo1; } } } private void txtPrdcrFile1_EditorButtonClick(object sender, EditorButtonEventArgs e) { if (e.Button.Key == "DownLoad")//下载 { frmOrderProducerinfo stu = new frmOrderProducerinfo(); stu.oPbc = this.ob; stu.index = ultraGrid3.ActiveRow.Cells["ORDER_NO"].Text; stu.ShowDialog(); } } } }