| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674 |
- 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.StlMes.Client.YdmBase;
- using Core.StlMes.Client.YdmPipeManage.Tool;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Control;
- using Core.Mes.Client.Comm.Tool;
- using System.Collections;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win.UltraWinGrid;
- using com.steering.pss.ydm.entity;
- using Core.StlMes.Client.YdmPipeManage.Controls;
- using Core.StlMes.Client.YdmPipeManage.Entity;
- namespace Core.StlMes.Client.YdmPipeManage
- {
- public partial class frmPipStoreRed : FrmBase
- {
- public frmPipStoreRed()
- {
- this.IsLoadUserView = true;
- InitializeComponent();
- }
- private void frmPipStoreRed_Load(object sender, EventArgs e)
- {
- StartTime.Value = DateTime.Parse(new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1).ToString());
- //StartTime.Value = DateTime.Parse(DateTime.Now.ToString("yyyy-MM") + "-01" + " 00:00:00");
- DateTime d1 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
- //EndTime.Value = DateTime.Parse(DateTime.Now.AddMonths(1).AddDays(1 - DateTime.Now.Day).ToString("yyyy-MM-dd") + " 23:59:59");
- EndTime.Value = DateTime.Parse(d1.AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd") +" 23:59:59");
- this.StartTime.Enabled = false;
- this.EndTime.Enabled = false;
- this.cmbJudge.Enabled = false;
- this.cmbOrder.Enabled = false;
- this.cmbStorager.Enabled = false;
- Init();
- }
- UltraComboEditor stroreName = new UltraComboEditor();
- string strInbound = "800704";//产出红冲
- private void Init()
- {
- YdmBaseClass.InitComboEditor(cmbStorager, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getStorageDetail", "STORAGE_NO", this.ob, false);
- YdmBaseClass.InitComboEditor(stroreName, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getStorageDetail", "STORAGE_NO", this.ob, false);
- YdmBaseClass.BindColumn(stroreName, "STORAGE_NO", this.Controls, this.ultraGrid2, 0);
- BaseMethod.InitPline(cmbFactory, this.ob);
- BaseMethod.InitSourse(cmbSource, this.ob);
- //YdmBaseClass.InitComboEditor(cmbFactory, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getFactoryDetail", "PLINE_CODE", this.ob, false);
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query2":
- QueryMat();
- break;
- case"Query1":
- getInList();
- break;
- case "pipRedStore":
- pipRedStore();
- break;
- case "CanclePipe":
- DoCanclePipeIn();
- break;
- case"adjust":
- adjustYear();
- break;
- case"Export":
- exportData();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// <summary>
- /// 调整结转年月
- /// </summary>
- private void adjustYear()
- {
- this.ultraGrid4.UpdateData();
- ArrayList list = new ArrayList();
- ArrayList parm = new ArrayList();
- int isUpdate = 0;
- string inDoc = "";
- string heatNo = "";
- string mothYear = "";
- string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds,ob);
- foreach (UltraGridRow uRow in ultraGrid4.Rows)
- {
- if (Convert.ToBoolean(uRow.Cells["CHK"].Text) == true)
- {
- isUpdate += 1;
- inDoc = uRow.Cells["INSTOCK_DOC"].Value.ToString();
- heatNo = uRow.Cells["JUDGE_STOVE_NO"].Value.ToString();
- mothYear = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
- parm.Add(DateTime.Now.ToString("yyyyMM"));
- DataTable ds = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeEnter.selectYearMoth", new object[] { parm, arr }, ob);
- if (int.Parse(ds.Rows[0]["ACOUNT"].ToString()) > 0)
- {
- MessageUtil.ShowTips("此炉【" + heatNo + "】已进行结转,不允许调整结转年月!");
- return;
- }
- list.Add(mothYear);
- list.Add(mothYear + "02 12:00:00");
- list.Add(inDoc);
- }
- }
- if (isUpdate == 0) { MessageUtil.ShowTips("请勾选要调整结转年月的数据!"); return; }
- int count = ServerHelper.SetData("com.steering.pss.ydm.pipemanage.FrmPipeEnter.updateYear", new object[] { list }, ob);
- if (count > 0)
- {
- getInList();
- MessageUtil.ShowTips("修改成功");
- }
- }
- /// <summary>
- /// 导出
- /// </summary>
- private void exportData()
- {
- GridHelper.ulGridToExcel(ultraGrid4, "红冲实绩总汇");
- }
-
- /// <summary>
- /// 库存查询
- /// </summary>
- private void QueryMat()
- {
- ArrayList pram = new ArrayList();
- string intimeStart = ""; //缴库起始时间
- string intimeEnd = ""; //缴库结束时间
- string stoveno = ""; //炉号
- string order = "";
- string stroage = "";
- if (ultraCheckEditor5.Checked)
- {
- intimeStart = StartTime.Value.ToString();
- intimeEnd = EndTime.Value.ToString();
- }
- //else
- //{
- // intimeStart = DateTime.Now.ToString("yyyy-MM") + "-01" + " 00:00:00";;
- // intimeEnd = DateTime.Now.AddMonths(1).AddDays(1 - DateTime.Now.Day).AddHours(-24).ToString("yyyy-MM-dd") + " 23:59:59";
- //}
- if (chkJudge.Checked)
- {
- if (cmbJudge.Text.Trim() == "")
- {
- MessageUtil.ShowTips("炉号不能为空,请选择!");
- return;
- }
- stoveno = cmbJudge.Text.Trim();
- }
- if (chkOrder.Checked)
- {
- if (cmbOrder.Text.Trim() == "")
- {
- MessageUtil.ShowTips("合同号不能为空,请选择!");
- return;
- }
- order = cmbOrder.Text.Trim();
- }
- if (DateTime.Parse(StartTime.Value.ToString()) > DateTime.Parse(EndTime.Value.ToString()))
- {
- MessageUtil.ShowTips("开始时间不能大于结束时间!");
- return;
- }
- if (chkStrong.Checked)
- {
- if (cmbStorager.Text.Trim() == "")
- {
- MessageUtil.ShowTips("仓库不能为空,请选择!");
- return;
- }
- stroage = cmbStorager.Value.ToString();
- }
- pram.Add(stoveno);
- pram.Add(order);
- pram.Add(stroage);
- string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds, this.ob);
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipStoreRed.getMat", new object[] { pram, arr, intimeStart, intimeEnd }, this.ob);//MatData
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable2, true);
- }
- /// <summary>
- /// 查询入库实绩
- /// </summary>
- /// <param name="heatNo"></param>
- /// <param name="bacthNo"></param>
- /// <param name="groupNo"></param>
- private void getInList()
- {
- string heatNo = "";
- string orderNo = "";
- string storgeNo = "";
- string startTim = "";
- string endTim = "";
- if (ultraCheckEditor5.Checked)
- {
- startTim = StartTime.Value.ToString();
- endTim = EndTime.Value.ToString();
- }
- //else
- //{
- // startTim = DateTime.Now.ToString("yyyy-MM") + "-01" + " 00:00:00"; ;
- // endTim = DateTime.Now.AddMonths(1).AddDays(1 - DateTime.Now.Day).AddHours(-24).ToString("yyyy-MM-dd") + " 23:59:59";
- //}
- if (chkJudge.Checked)
- {
- if (this.cmbJudge.Text == "")
- {
- MessageUtil.ShowTips("请选择炉号!");
- return;
- }
- else
- {
- heatNo = this.cmbJudge.Text.Trim();
- }
- }
- if (chkOrder.Checked)
- {
- if (this.cmbOrder.Text == "")
- {
- MessageUtil.ShowTips("请选择合同号!");
- return;
- }
- else
- {
- orderNo = this.cmbOrder.Text.Trim();
- }
- }
- if (chkStrong.Checked)
- {
- if (this.cmbStorager.Text == "")
- {
- MessageUtil.ShowTips("请选择仓库!");
- return;
- }
- else
- {
- storgeNo = this.cmbStorager.Value.ToString();
- }
- }
- ArrayList list = new ArrayList();
- string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
- list.Add(heatNo);
- list.Add(orderNo);
- list.Add(storgeNo);
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipStoreRed.getInList", new object[] { list, arr, startTim, endTim }, this.ob);
- GridHelper.CopyDataToDatatable(ref dt, ref dataTable4, true);
- }
- /// <summary>
- /// 库存红冲
- /// </summary>
- private void pipRedStore()
- {
- this.ultraGrid2.UpdateData();
- UltraGridRow ugr = ultraGrid2.ActiveRow;
- int count = 0;
- string strInMemo = "";
- ArrayList matParm = new ArrayList();
- ArrayList plnSpale = new ArrayList();
- ArrayList statusUpdate = new ArrayList();
- MatZcMEntity1 matzcMEntity = new MatZcMEntity1();
- foreach (UltraGridRow row in ultraGrid2.Rows)
- {
- if (Convert.ToBoolean(row.Cells["CHOOSE"].Text) == true)
- {
- ArrayList sList = new ArrayList();
- sList.Add(row.Cells["JUDGE_STOVE_NO"].Value.ToString());
- sList.Add(row.Cells["BATCH_NO"].Value.ToString());
- sList.Add(row.Cells["BATCH_GROUD_NO"].Value.ToString());
- sList.Add(row.Cells["MAT_STATUS"].Value.ToString());
- sList.Add(row.Cells["PLINE_CODE"].Value.ToString());
- sList.Add(row.Cells["STD_CODE"].Value.ToString2());
- sList.Add(row.Cells["STORAGE_NO"].Value.ToString());
- sList.Add(row.Cells["BAL_YEAR_MONTH"].Value.ToString().Replace("-",""));
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipStoreRed.getStaueCount", new object[] { sList }, ob);
- if (int.Parse(row.Cells["REDCOUNT"].Text.Trim()) < 0)
- {
- if (dt.Rows[0]["ACOUNT"].ToString() == "")
- {
- MessageUtil.ShowTips("该炉已无库存信息,无法红冲!");
- return;
- }
- }
- if (dt.Rows[0]["ACOUNT"].ToString() != row.Cells["UNIT"].Text)
- {
- MessageUtil.ShowTips("该炉状态已改变或者无库存信息,请刷新界面!");
- return;
- }
- if (!StringUtil.IsInt(Math.Abs(double.Parse(row.Cells["REDCOUNT"].Text)).ToString()))
- {
- MessageUtil.ShowTips("支数请输入整数!");
- return;
- }
- //if (double.Parse(row.Cells["REDWEIGHT"].Value.ToString2()) <= 0)
- //{
- // MessageUtil.ShowTips("红冲重量不能为零或者空!");
- // return;
- //}
- if (Math.Abs(int.Parse((row.Cells["REDCOUNT"].Value.ToString2()))) == 0)
- {
- MessageUtil.ShowTips("红冲支数不能为零或者空!");
- return;
- }
- if (int.Parse(row.Cells["REDCOUNT"].Text) < 0)
- {
- if (int.Parse(row.Cells["REDCOUNT"].Text) > int.Parse(row.Cells["UNIT"].Text) || double.Parse(row.Cells["REDWEIGHT"].Text) > double.Parse(row.Cells["WEIGHT"].Text) || double.Parse(row.Cells["LENGTH"].Text) > double.Parse(row.Cells["ACT_LEN"].Text))
- {
- MessageUtil.ShowTips("冲销支数/重量/长度不能大于库存数量,输入正确冲销的支数、重量、长度!");
- return;
- }
- }
- //if (int.Parse(row.Cells["REDCOUNT"].Text) == int.Parse(row.Cells["UNIT"].Text))
- //{
- // if (row.Cells["REDWEIGHT"].Text == "" || row.Cells["REDWEIGHT"].Text == "0")
- // {
- // MessageUtil.ShowTips("红冲重量不能为空!");
- // return;
- // }
-
- //}
- if (!(double.Parse(row.Cells["REDWEIGHT"].Text.Replace("_", "")) >= 0) || !(double.Parse(row.Cells["LENGTH"].Text) >= 0))
- {
- MessageUtil.ShowTips("红冲重量和长度都需大于0,红冲正负以支数正负区分!");
- return;
- }
- DataTable dd = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.CorePipeInTemp.getLockFlag", new object[] { row.Cells["JUDGE_STOVE_NO"].Text, row.Cells["BATCH_NO"].Text, row.Cells["BATCH_GROUD_NO"].Text }, ob);
- if (int.Parse(dd.Rows[0]["ACOUNT"].ToString()) > 0)
- {
- MessageUtil.ShowTips("炉号:" + row.Cells["JUDGE_STOVE_NO"].Text + "、批号:" + row.Cells["BATCH_NO"].Text + "的数据有被封锁的,不能进行红冲!");
- return;
- }
- ArrayList matList = new ArrayList();
- matList.Add(row.Cells["JUDGE_STOVE_NO"].Value.ToString()); //炉号
- matList.Add(row.Cells["BATCH_NO"].Value.ToString());//批号
- matList.Add(row.Cells["BATCH_GROUD_NO"].Value.ToString());//组号
- matList.Add(row.Cells["UNIT"].Value.ToString());//库存支数
- matList.Add(row.Cells["REDCOUNT"].Value.ToString());//红冲支数
- matList.Add(row.Cells["WEIGHT"].Value.ToString());//库存重量
- matList.Add(row.Cells["REDWEIGHT"].Value.ToString().Replace("_", ""));//红冲重量
- matList.Add(this.UserInfo.GetUserName());//操作人
- DataTable dtMemo = PipeManageClass.getComTypeInfo(strInbound, ob);
- if (dtMemo.Rows.Count >= 1)
- {
- strInMemo = dtMemo.Rows[0]["MEMO"].ToString();
- }
- matList.Add(strInMemo);
- matList.Add(strInbound);
- matList.Add(row.Cells["ACT_LEN"].Value.ToString());//库存长度//10
- matList.Add(row.Cells["LENGTH"].Value.ToString().Replace("_", ""));//红冲长度
- matList.Add(row.Cells["ORD_LN_PK"].Value.ToString());//合同行键
- matList.Add(row.Cells["ORD_PK"].Value.ToString());
- matList.Add(row.Cells["ORD_LN_DLY_PK"].Value.ToString());
- matList.Add(row.Cells["ORDER_NO"].Value.ToString());//合同号
- matList.Add(row.Cells["ORDER_SEQ"].Value.ToString());
- matList.Add(row.Cells["ORDER_SEQ_NO"].Value.ToString());
- matList.Add(row.Cells["STORAGE_NO"].Value.ToString());//仓库号//18
- matList.Add(this.UserInfo.GetDeptid());
- matList.Add(this.UserInfo.GetDepartment());
- matList.Add(ClsBaseInfo.GetDepartIdBySectionId(this.UserInfo.GetDeptid(), this.ob));
- matList.Add(ClsBaseInfo.GetDepartBySectionId(this.UserInfo.GetDeptid(), this.ob));
- matList.Add(row.Cells["PRODUCCODE"].Value.ToString());//品名代码//23
- matList.Add(row.Cells["PRODUCNAME"].Value.ToString());//品名名称
- matList.Add(row.Cells["STEELCODE"].Value.ToString());//钢级(牌号)代码
- matList.Add(row.Cells["STEELNAME"].Value.ToString());//钢级名称
- matList.Add(row.Cells["SPEC_CODE"].Value.ToString());//产品规格代码
- matList.Add(row.Cells["SPEC_NAME"].Value.ToString());//产品规格描述
- matList.Add(row.Cells["MODEL_CODE"].Value.ToString());//扣型代码
- matList.Add(row.Cells["MODEL_DESC"].Value.ToString());//扣型描述
- matList.Add(row.Cells["STD_CODE"].Value.ToString());//标准代码//31
- matList.Add(row.Cells["STD_NAME"].Value.ToString());//标准名称
- matList.Add(row.Cells["BELONG_CODE"].Value.ToString());//所属单位代码
- matList.Add(row.Cells["BELONG_NAME"].Value.ToString());//所属单位
- matList.Add(row.Cells["STD_STYLE"].Value.ToString());//标准类别代码
- matList.Add(row.Cells["STD_STYLE_DESC"].Value.ToString());//标准类别描述//36
- matList.Add(row.Cells["ACT_DIMATER"].Value.ToString());// 外径
- matList.Add(row.Cells["ACT_HEIGHT"].Value.ToString());//壁厚
- matList.Add(row.Cells["LEN_NO"].Value.ToString());//长度编码(订货)
- matList.Add(row.Cells["LEN_DESC"].Value.ToString());//长度描述(订货)
- matList.Add(row.Cells["LEN_UNIT"].Value.ToString());//长度单位
- matList.Add(row.Cells["ACT_LEN_MIN"].Value.ToString());
- matList.Add(row.Cells["ACT_LEN_MAX"].Value.ToString());
- matList.Add(row.Cells["MEMO"].Value.ToString());//备注
- if (row.Cells["PRODUCT_FLAG"].Value.ToString() == "成品")
- {
- matList.Add("801402");//材料类别
- }
- else if (row.Cells["PRODUCT_FLAG"].Value.ToString() == "商品")
- {
- matList.Add("801403");//材料类别
- }
- else
- {
- matList.Add("801401");//材料类别
- }
- matList.Add(row.Cells["MAT_STATUS"].Value.ToString());//材料状态
- matList.Add(row.Cells["JUDGE_STD_NAME"].Value.ToString());//判定标准//47
- if (this.cmbSource.Text != "" && this.cmbFactory.Text != "")
- {
- matList.Add(this.cmbFactory.Value.ToString());
- matList.Add(this.cmbFactory.Text);
- }
- else
- {
- matList.Add(row.Cells["PLINE_CODE"].Value.ToString());//产线代码
- matList.Add(row.Cells["PLINE_NAME"].Value.ToString());//产线
- }
- matList.Add(row.Cells["GRADECODE"].Value.ToString());//钢种代码
- matList.Add(row.Cells["GRADENAME"].Value.ToString());//钢种
- matList.Add(row.Cells["PIPMEMO"].Value.ToString());//入库备注
- if (this.cmbSource.Text != "" && this.cmbFactory.Text != "")
- {
- matList.Add(this.cmbSource.Value.ToString());
- matList.Add(this.cmbSource.Text);
- matList.Add(this.cmbFactory.Value.ToString());
- matList.Add(this.cmbFactory.Text);
- }
- else
- {
- matList.Add(row.Cells["MAT_ORIGIN_CODE"].Value.ToString());//材料来源类别
- matList.Add(row.Cells["MAT_ORIGIN_NAME"].Value.ToString());
- matList.Add(row.Cells["SOURE_CODE"].Value.ToString());//材料来源地
- matList.Add(row.Cells["SOURE_NAME"].Value.ToString());
- }
- matList.Add(row.Cells["MATERIAL_NO"].Value.ToString());//物料码//57
- matList.Add(row.Cells["MATERIAL_NAME"].Value.ToString());
- matList.Add(row.Cells["BAL_YEAR_MONTH"].Value.ToString().Replace("-", ""));
- matList.Add(row.Cells["BELONG_CODE"].Value.ToString());
- matParm.Add(matList);
- ArrayList plnList = new ArrayList();
- plnList.Add(row.Cells["REDWEIGHT"].Text.Replace("_", ""));
- plnList.Add(row.Cells["REDCOUNT"].Text);
- plnList.Add(this.UserInfo.GetUserName());
- plnList.Add(row.Cells["ORDER_NO"].Value.ToString());
- plnList.Add(row.Cells["ORDER_SEQ"].Value.ToString());
- plnList.Add(row.Cells["ORDER_SEQ_NO"].Value.ToString());
- plnList.Add(row.Cells["JUDGE_STOVE_NO"].Text.Trim());
- plnList.Add(row.Cells["BATCH_NO"].Text.Trim());
- plnList.Add(row.Cells["BATCH_GROUD_NO"].Text);
- plnSpale.Add(plnList);
- count++;
- }
- }
- if (count < 1)
- {
- MessageUtil.ShowTips("请选择需要红冲的库存数据!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmPipStoreRed";
- ccp.MethodName = "pipRedStore";
- ccp.ServerParams = new object[] { matParm, plnSpale };
- ccp = ob.ExecuteNonQuery(ccp,CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("库存红冲成功!"))
- {
- QueryMat();
- getInList();
- MessageUtil.ShowTips("库存红冲成功!");
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销库存红冲
- /// </summary>
- private void DoCanclePipeIn()
- {
- this.ultraGrid4.UpdateData();
- UltraGridRow ugr = ultraGrid4.ActiveRow;
- int count = 0;
- ArrayList matList = new ArrayList();
- string[] arr = BaseMethod.InitPermissions(this.ValidDataPurviewIds, ob);
- string moth = "";
- foreach (UltraGridRow row in ultraGrid4.Rows)
- {
- if (Convert.ToBoolean(row.Cells["CHK"].Text) == true)
- {
- ArrayList parm = new ArrayList();
- moth = DateTime.Parse(row.Cells["BAL_YEAR_MONTH"].Text).AddMonths(1).ToString("yyyyMM");
- parm.Add(moth);
- DataTable ds = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmPipeAdjust.selectYearMoth", new object[] { parm, arr }, ob);
- if (int.Parse(ds.Rows[0]["ACOUNT"].ToString()) > 0)
- {
- MessageUtil.ShowTips("此炉【" + row.Cells["JUDGE_STOVE_NO"].Text + "】已进行结转,不允许撤销!");
- return;
- }
- matList.Add(row.Cells["ACT_WEIGHT"].Text);
- matList.Add(row.Cells["ACT_COUNT"].Text);
- matList.Add(this.UserInfo.GetUserName());
- matList.Add(row.Cells["ORDER_NO"].Value.ToString());
- matList.Add(row.Cells["ORDER_SEQ"].Value.ToString());
- matList.Add(row.Cells["DELIVERY_NO"].Value.ToString());
- matList.Add(row.Cells["JUDGE_STOVE_NO"].Text.Trim());
- matList.Add(row.Cells["BATCH_NO"].Text.Trim());
- matList.Add(row.Cells["BATCH_GROUD_NO"].Text);
- matList.Add(row.Cells["INSTOCK_DOC"].Text.ToString());
- matList.Add(row.Cells["ACT_LEN"].Text);
- matList.Add(row.Cells["ORD_LN_PK"].Text);
- matList.Add(row.Cells["ORD_LN_DLY_PK"].Text);
- matList.Add(row.Cells["BELONG_CODE"].Text.Trim());
- matList.Add(row.Cells["BELONG_NAME"].Text.Trim());
- count++;
- }
- }
- if (count < 1)
- {
- MessageUtil.ShowTips("请选择需要撤销的数据!");
- return;
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmPipStoreRed";
- ccp.MethodName = "pipCancelRedStore";
- ccp.ServerParams = new object[] { matList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("库存红冲撤销成功!"))
- {
- QueryMat();
- getInList();
- MessageUtil.ShowTips("库存红冲撤销成功!");
- }
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
-
- private void ultraCheckEditor5_CheckedChanged(object sender, EventArgs e)
- {
- StartTime.Enabled = this.ultraCheckEditor5.Checked;
- this.EndTime.Enabled = this.ultraCheckEditor5.Checked;
- }
- private void chkJudge_CheckedChanged(object sender, EventArgs e)
- {
- cmbJudge.Enabled = chkJudge.Checked;
- }
- private void chkOrder_CheckedChanged(object sender, EventArgs e)
- {
- cmbOrder.Enabled = chkOrder.Checked;
- }
- private void chkStrong_CheckedChanged(object sender, EventArgs e)
- {
- cmbStorager.Enabled = this.chkStrong.Checked;
- }
- int iSelectG3Row = -1;
- int iSelectG2Row = -1;
- private void ultraGrid2_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- ultraGrid2.UpdateData();
- if (ultraGrid2.Rows.Count == 1)
- {
- ultraGrid2.Rows[0].Cells["CHOOSE"].Value = true;
- }
- else
- {
- if (e.Cell.Column.Key.ToString().ToUpper() == "CHOOSE")
- {
- if (e.Cell.Value.ToString().ToUpper() == "TRUE")
- {
- if (iSelectG2Row != -1)
- ultraGrid2.Rows[iSelectG2Row].Cells["CHOOSE"].Value = false;
- iSelectG2Row = e.Cell.Row.Index;
- }
- else
- {
- iSelectG2Row = -1;
- }
- }
- }
- }
- private void ultraGrid4_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- ultraGrid4.UpdateData();
- if (ultraGrid4.Rows.Count == 1)
- {
- ultraGrid4.Rows[0].Cells["CHK"].Value = true;
- }
- else
- {
- if (e.Cell.Column.Key.ToString().ToUpper() == "CHK")
- {
- if (e.Cell.Value.ToString().ToUpper() == "TRUE")
- {
- if (iSelectG3Row != -1)
- ultraGrid4.Rows[iSelectG3Row].Cells["CHK"].Value = false;
- iSelectG3Row = e.Cell.Row.Index;
- }
- else
- {
- iSelectG3Row = -1;
- }
- }
- }
- }
- private void cmbJudge_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue == 13)
- {
- QueryMat();
- }
- }
- private void cmbOrder_KeyDown(object sender, KeyEventArgs e)
- {
- if (e.KeyValue == 13)
- {
- QueryMat();
- }
- }
- private void cmbSource_ValueChanged(object sender, EventArgs e)
- {
- if (this.cmbSource.Text != "")
- {
- if (this.cmbSource.Value.ToString() == "801302")//产线
- {
- YdmBaseClass.InitComboEditor(cmbFactory, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getFactoryDetail", "PLINE_CODE", this.ob, false);
- }
- else if (this.cmbSource.Value.ToString() == "801301")//外购
- {
- YdmBaseClass.InitComboEditor(cmbFactory, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getWg", "BASE_CODE", this.ob, false);
- }
- else if (this.cmbSource.Value.ToString() == "801303")//倒库
- {
- YdmBaseClass.InitComboEditor(cmbFactory, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getDk", "BASE_CODE", this.ob, false);
- }
- else if (this.cmbSource.Value.ToString() == "801304")//外委
- {
- YdmBaseClass.InitComboEditor(cmbFactory, "com.steering.pss.ydm.pipemanage.CorePipeInTemp.getWw", "BASE_CODE", this.ob, false);
- }
- }
- }
- }
- }
|