| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.YdmPipeManage.Entity;
- using Core.StlMes.Client.YdmPipeManage.Tool;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinEditors;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Core.StlMes.Client.YdmPipeManage;
- using Core.Mes.Client.Comm.Control;
- namespace Core.StlMes.Client.YdmPipeManage
- {
- public partial class FrmLikuExamine : FrmBase
- {
- public FrmLikuExamine()
- {
- InitializeComponent();
- this.IsLoadUserView = true;
- }
- string[] arr = null;
- private void txtMemo_EditorButtonClick(object sender, Infragistics.Win.UltraWinEditors.EditorButtonEventArgs e)
- {
- UltraTextEditor textEditor = (UltraTextEditor)sender;
- PopupTextBox popupText = new PopupTextBox(textEditor.Text, 500);
- if (popupText.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- textEditor.Text = popupText.TextInfo.Trim();
- }
- this.ultraGrid1.ActiveCell.Value = textEditor.Text;
- this.ultraGrid1.ActiveRow.Update();
- }
- private void FrmLikuExamine_Load(object sender, EventArgs e)
- {
- DateTime now = DateTime.Now;
- DateTime dt1 = new DateTime(now.Year, now.Month, 1);//当月第一天
- DateTime dt2 = dt1.AddMonths(1).AddDays(-1);//当月最后一天
- this.cmbDate.Value = DateTime.Parse(dt1.ToString("yyyy-MM-dd") + " 00:00:00");
- this.cmbEndDate.Value = DateTime.Parse(dt2.ToString("yyyy-MM-dd") + " 23:59:59");
- EntityHelper.ShowGridCaption<QcmLkJudgeChangeEntity>(this.ultraGrid1.DisplayLayout.Bands[0]);
- arr = this.CustomInfo.Contains("XS")?new string[]{}:this.ValidDataPurviewIds;
- }
- /// <summary>
- /// 重写基类方法
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="ToolbarKey"></param>
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- switch (ToolbarKey)
- {
- case "Query":
- doQueryApply();
- break;
- case "Audit":
- auditCross();
- break;
- case"AuditNo":
- auditNoCross();
- break;
- case"CancelAudit":
- cancelAudit();
- break;
- case "Export":
- GridHelper.ulGridToExcel(ultraGrid1, "成品利库申请信息");;
- break;
- case "Close":
- this.Close();
- break;
- }
- }
-
- /// <summary>
- /// 查询
- /// </summary>
- private void doQueryApply()
- {
- string startTim = "";
- string endTim = "";
- string judgeNo = "";
- string orderNo = "";
- string valueFlag = "";
- if (this.chkJudgeStoveNo.Checked && this.uteJudgeStoveNo.Text.Trim() != "")
- {
- judgeNo = this.uteJudgeStoveNo.Text.Trim();
- }
- if(this.chkOrderNo.Checked && this.cmbOrderNo.Text.Trim() != "")
- {
- orderNo = this.cmbOrderNo.Text.Trim();
- }
- if (this.chkDate.Checked)
- {
- if (DateTime.Parse(cmbDate.Value.ToString()) > DateTime.Parse(this.cmbEndDate.Value.ToString()))
- {
- MessageUtil.ShowTips("选择的前面时间不能大于后面的时间!");
- return;
- }
- else
- {
- startTim = this.cmbDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
- endTim = this.cmbEndDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
- }
- }
- valueFlag = this.ultraOptionSet1.CheckedItem.DataValue.ToString();
- ArrayList parmList = new ArrayList();
- parmList.Add(startTim);
- parmList.Add(endTim);
- parmList.Add(judgeNo);
- parmList.Add(orderNo);
- parmList.Add(valueFlag);
- String supp = this.CustomInfo.Contains("120504") ? "120504" : "";
- List<QcmLkJudgeChangeEntity> listSource = EntityHelper.GetData<QcmLkJudgeChangeEntity>(
- "com.steering.pss.ydm.pipemanage.FrmLikuExamine.doQueryApply", new object[] { parmList, arr, supp }, this.ob);
- qcmLkJudgeChangeEntityBindingSource.DataSource = listSource;
- }
- /// <summary>
- /// 审批通过
- /// </summary>
- private void auditCross()
- {
- this.ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要审批的信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow uRow in checkMagRows)
- {
- QcmLkJudgeChangeEntity qcmTity = (QcmLkJudgeChangeEntity)uRow.ListObject;
- qcmTity.AgreeName = UserInfo.GetUserName();
- if (qcmTity.IndexSeq.Equals(""))
- {
- MessageUtil.ShowTips("审批通过时请选择制程号!");
- return;
- }
- if(qcmTity.Cic.Equals(""))
- {
- MessageUtil.ShowTips("审批时请选择CIC!");
- return;
- }
- string qcmLkEntity = JSONFormat.Format(qcmTity);
- parmList.Add(qcmLkEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmLikuExamine";
- ccp.MethodName = "auditCross";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("审批成功!"))
- {
- doQueryApply();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 审批不通过
- /// </summary>
- private void auditNoCross()
- {
- this.ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要审批的信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach(UltraGridRow uRow in checkMagRows)
- {
- QcmLkJudgeChangeEntity qcmTity = (QcmLkJudgeChangeEntity)uRow.ListObject;
- qcmTity.AgreeName = UserInfo.GetUserName();
- string qcmLkEntity = JSONFormat.Format(qcmTity);
- parmList.Add(qcmLkEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmLikuExamine";
- ccp.MethodName = "auditNoCross";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("审批成功!"))
- {
- doQueryApply();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- /// <summary>
- /// 撤销审批
- /// </summary>
- private void cancelAudit()
- {
- this.ultraGrid1.UpdateData();
- IQueryable<UltraGridRow> checkMagRows = this.ultraGrid1.Rows.AsQueryable().Where(" CHK = 'True'");
- if (checkMagRows.Count() == 0)
- {
- MessageUtil.ShowTips("请选择需要撤销审批的信息!");
- return;
- }
- ArrayList parmList = new ArrayList();
- foreach (UltraGridRow uRow in checkMagRows)
- {
- QcmLkJudgeChangeEntity qcmTity = (QcmLkJudgeChangeEntity)uRow.ListObject;
- string qcmLkEntity = JSONFormat.Format(qcmTity);
- parmList.Add(qcmLkEntity);
- }
- CoreClientParam ccp = new CoreClientParam();
- ccp.ServerName = "com.steering.pss.ydm.pipemanage.FrmLikuExamine";
- ccp.MethodName = "cancelAudit";
- ccp.ServerParams = new object[] { parmList };
- ccp = ob.ExecuteNonQuery(ccp, CoreInvokeType.Internal);
- if (ccp.ReturnCode != -1)
- {
- if (ccp.ReturnInfo.Equals("撤销成功!"))
- {
- doQueryApply();
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- else
- {
- MessageUtil.ShowTips(ccp.ReturnInfo);
- }
- }
- }
- private void chkDate_CheckedChanged(object sender, EventArgs e)
- {
- this.cmbDate.Enabled = this.cmbEndDate.Enabled = this.chkDate.Checked;
- }
- private void chkJudgeStoveNo_CheckedChanged(object sender, EventArgs e)
- {
- this.uteJudgeStoveNo.Enabled = this.chkJudgeStoveNo.Checked;
- }
- private void chkOrderNo_CheckedChanged(object sender, EventArgs e)
- {
- cmbOrderNo.Enabled = this.chkOrderNo.Checked;
- }
- private void cmbIndexSeq_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- this.ultraGrid1.UpdateData();
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmLikuExamine.doQueryIndexSeq",
- new object[] { this.ultraGrid1.ActiveRow.Cells["OrdLnPk"].Text }, ob);
- dt.Columns["INDEX_SEQ"].Caption = "制程号";
- BaseInfoPopup baseInfo = new BaseInfoPopup(dt, "INDEX_SEQ", "INDEX_CODE");
- baseInfo.Shown += new EventHandler((a, b) =>
- {
- var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
- c => c.GetValue("INDEX_CODE") == this.cmbIndexSeq.Tag.ToString2()
- ).FirstOrDefault();
- if (actRow != null) actRow.Activate();
- });
- if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- this.ultraGrid1.ActiveCell.Value = baseInfo.ChoicedRow.GetValue("INDEX_SEQ");
- this.ultraGrid1.ActiveCell.Row.Cells["IndexSeq"].Value = baseInfo.ChoicedRow.GetValue("INDEX_CODE");
- }
- }
- private void cmbCic_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- this.ultraGrid1.UpdateData();
- if (this.ultraGrid1.ActiveRow.Cells["IndexSeq"].Text == "")
- {
- MessageUtil.ShowTips("选择CIC索引码时请先选择制程号!");
- return;
- }
- DataTable dt = ServerHelper.GetData("com.steering.pss.ydm.pipemanage.FrmLikuExamine.doQueryCic",
- new object[] { this.ultraGrid1.ActiveRow.Cells["CraftSeq"].Text, this.ultraGrid1.ActiveRow.Cells["OrdLnPk"].Text, this.ultraGrid1.ActiveRow.Cells["IndexSeq"].Text }, ob);
- dt.Columns["CIC"].Caption = "CIC";
- BaseInfoPopup1 baseInfo = new BaseInfoPopup1(dt, "CIC", "CIC_CODE");
- baseInfo.Shown += new EventHandler((a, b) =>
- {
- var actRow = baseInfo.UltraGrid1.Rows.AsQueryable().Where(
- c => c.GetValue("CIC_CODE") == this.cmbCic.Tag.ToString2()).FirstOrDefault();
- if (actRow != null) actRow.Activate();
- });
- if (baseInfo.ShowDialog() == System.Windows.Forms.DialogResult.OK)
- {
- this.ultraGrid1.ActiveCell.Value = baseInfo.ChoicedRow.GetValue("CIC");
- this.ultraGrid1.ActiveCell.Row.Cells["Cic"].Value = baseInfo.ChoicedRow.GetValue("CIC_CODE");
- }
- }
- private void ultraTextEditor5_EditorButtonClick(object sender, EditorButtonEventArgs e)
- {
- UltraGridRow uRow = this.ultraGrid1.ActiveRow;
- if (uRow.Cells["CraftNo"].Text.Trim() == "" || uRow.Cells["CraftPath"].Text.Trim() == "")
- {
- return;
- }
- BaseMethod.ViewCarft_No(uRow.Cells["CraftPath"].Text.Trim());
- }
-
- }
- }
|