private void InitTsdlvw() { this.hsCols = PlArchivManage.Agent.GetViewOfCol("托晒单", out this.lstOrder, out this.hsColWide); PlArchivManage.SetCol(this.hsCols, this.lvwTSD, "TSD", this.lstOrder, this.hsColWide); this.lstCando = new ArrayList(); this.GetCando(); this.d_AfterIterationUpdated = new PLMBizItemDelegate(this.AfterItemUpdated); this.d_AfterMasterUpdated = new PLMBizItemDelegate(this.AfterItemUpdated); this.d_AfterDeleted = new PLMDelegate2(this.AfterDeleted); this.d_AfterRevisionCreated = new PLMBizItemDelegate(this.AfterItemUpdated); this.d_AfterReleased = new PLMBizItemDelegate(this.AfterItemUpdated); this.d_AfterUndoNewRevision = new PLMBizItemDelegate(this.AfterItemUpdated); this.d_AfterCheckIn = new PLMBizItemDelegate(this.AfterItemUpdated); this.d_AfterCheckOut = new PLMBizItemDelegate(this.AfterItemUpdated); this.d_AfterUndoCheckOut = new PLMBizItemDelegate(this.AfterItemUpdated); this.d_AfterAbandon = new PLMBizItemDelegate(this.AfterItemUpdated); this.d_AfterUndoAbandon = new PLMBizItemDelegate(this.AfterItemUpdated); this.Lvw_AfterTabClose = new PLMSimpleDelegate(this.CloseTsdTab); this.Lvw_AfterTsdCreate = new PLMSimpleDelegate(this.ItemCreated); BizItemHandlerEvent.Instance.D_AfterReleased = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterReleased, this.d_AfterReleased); BizItemHandlerEvent.Instance.D_AfterRevisionCreated = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterRevisionCreated, this.d_AfterRevisionCreated); BizItemHandlerEvent.Instance.D_AfterUndoNewRevision = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterUndoNewRevision, this.d_AfterUndoNewRevision); BizItemHandlerEvent.Instance.D_AfterCheckIn = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterCheckIn, this.d_AfterCheckIn); BizItemHandlerEvent.Instance.D_AfterCheckOut = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterCheckOut, this.d_AfterCheckOut); BizItemHandlerEvent.Instance.D_AfterUndoCheckOut = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterUndoCheckOut, this.d_AfterUndoCheckOut); BizItemHandlerEvent.Instance.D_AfterIterationUpdated = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterIterationUpdated, this.d_AfterIterationUpdated); BizItemHandlerEvent.Instance.D_AfterMasterUpdated = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterMasterUpdated, this.d_AfterMasterUpdated); BizItemHandlerEvent.Instance.D_AfterDeleted = (PLMDelegate2)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterDeleted, this.d_AfterDeleted); BizItemHandlerEvent.Instance.D_AfterUndoAbandon = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterUndoAbandon, this.d_AfterUndoAbandon); BizItemHandlerEvent.Instance.D_AfterAbandon = (PLMBizItemDelegate)Delegate.Combine(BizItemHandlerEvent.Instance.D_AfterAbandon, this.d_AfterAbandon); DelegatesOfAm.Instance.D_AfterTsdTabClose = (PLMSimpleDelegate)Delegate.Combine(DelegatesOfAm.Instance.D_AfterTsdTabClose, this.Lvw_AfterTabClose); DelegatesOfAm.Instance.D_AfterTsdCreate = (PLMSimpleDelegate)Delegate.Combine(DelegatesOfAm.Instance.D_AfterTsdCreate, this.Lvw_AfterTsdCreate); }
private void UpdateTsdItem(object obj) { DEBusinessItem item = obj as DEBusinessItem; if (item != null) { PlArchivManage.UpdateLvwValues(this.hsCols, this.lvwTSD, this.lstOrder, item); } }
private void btnTsSchDocId_Click(object sender, EventArgs e) { this.lvwTSD.Items.Clear(); DataSet tSD = PlArchivManage.Agent.GetTSD(this.txtTsID.Text, this.resWkTsd.ResValue); if (((tSD != null) && (tSD.Tables.Count > 0)) && (tSD.Tables[0].Rows.Count > 0)) { PlArchivManage.SetLvwClsValues(this.hsCols, this.lvwTSD, this.lstOrder, tSD.Tables[0], "DQDOSSIERPRINT"); } this.lvwTSD.Refresh(); }
private void RefreshBoms() { DERelationBizItemList relListOfDEBizItem = PlArchivManage.GetRelListOfDEBizItem(this._theItem, ConstAm.TDSBOM_RELCLASS); this.lvwPrintBom.Items.Clear(); foreach (DERelationBizItem item in relListOfDEBizItem.RelationBizItems) { if (item.Relation.State != RelationState.Deleted) { PlArchivManage.UpdatePrintLvwRelValues(this.lvwPrintBom, this.lstOrder, item); } } }
private void init() { ArrayList tsRes = PlArchivManage.GetTsRes("路线部门") as ArrayList; foreach (string str in tsRes) { ListViewItem item = new ListViewItem(str) { Text = str }; this.lvwUnit.Items.Add(item); } }
private void lvwTSD_DragDrop(object sender, DragEventArgs e) { if (e.Data != null) { DEBusinessItem item; ArrayList list = new ArrayList(); ArrayList list2 = new ArrayList(); foreach (ListViewItem item2 in this.lvwTSD.Items) { IBizItem tag = item2.Tag as IBizItem; list2.Add(tag.MasterOid); } if (e.Data.GetDataPresent(typeof(CLCopyData))) { CLCopyData data = (CLCopyData)e.Data.GetData(typeof(CLCopyData)); foreach (object obj2 in data) { item = PlArchivManage.GetItem(obj2); if ((item.Master.ClassName == "DQDOSSIERPRINT") && ((item != null) && !list2.Contains(item.MasterOid))) { list2.Add(item.MasterOid); list.Add(item); } } } else { item = PlArchivManage.GetItem(e.Data.GetData(typeof(IBizItem))); if (item != null) { if (item.Master.ClassName != "DQDOSSIERPRINT") { return; } if (!list2.Contains(item.MasterOid)) { list2.Add(item.MasterOid); list.Add(item); } } } if (list.Count > 0) { foreach (DEBusinessItem item4 in list) { PlArchivManage.SetLvwValues(this.hsCols, this.lvwTSD, this.lstOrder, item4); } this.lvwTSD.Refresh(); } } }
private void btnTsQiuckSch_Click(object sender, EventArgs e) { FrmTsdQuickSch sch = new FrmTsdQuickSch(); if (sch.ShowDialog() == DialogResult.OK) { DataSet ds = sch.ds; this.lvwTSD.Items.Clear(); if (((ds != null) && (ds.Tables.Count > 0)) && (ds.Tables[0].Rows.Count > 0)) { PlArchivManage.SetLvwClsValues(this.hsCols, this.lvwTSD, this.lstOrder, ds.Tables[0], "DQDOSSIERPRINT"); } this.lvwTSD.Refresh(); } }
private void Init() { if (!this._isPrint) { PlArchivManage.SetComBoxItem("托晒方式", this.txtTsType, "", this._isPrint); PlArchivManage.SetComBoxItem("托晒打印状态", this.txtTsStatue, "", this._isPrint); } else { PlArchivManage.SetComBoxItem("托晒方式", this.txtTsType, "", this._isPrint); PlArchivManage.SetComBoxItem("托晒打印状态", this.txtTsStatue, "", this._isPrint); } PlArchivManage.SetComBoxItem("发图类型", this.txtFtlx, null, this._isPrint); PlArchivManage.SetComBoxItem("路线部门", this.txtUnit, "", this._isPrint); DateTime time = DateTime.Now.AddDays(-7.0); this.dTFromTime.Value = new DateTime(time.Year, time.Month, time.Day); DateTime time2 = time.AddDays(15.0).AddSeconds(-1.0); this.dTToTime.Value = time2; }
private void AfterItemUpdated(IBizItem[] bizItems) { if ((bizItems != null) && (bizItems.Length != 0)) { ArrayList list = new ArrayList(PSConvert.ToBizItems(bizItems, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid)); foreach (DEBusinessItem item in list) { if (item.ClassName != "DQDOSSIERPRINT") { break; } string tsStatue = PlArchivManage.GetTsStatue(item); string str2 = tsStatue; if ((str2 == null) || ((str2 != "打印完成") && (str2 != "打印取消"))) { if (tsStatue == "开始打印") { bool flag = false; foreach (ListViewItem item2 in this.lvwTSD.Items) { DEBusinessItem tag = item2.Tag as DEBusinessItem; if (tag.MasterOid == item.MasterOid) { flag = true; break; } } if (!flag) { continue; } } this.UpdateTsdItem(item); } } } }
private void btnClose_Click(object sender, EventArgs e) { bool flag = false; if (this._isChg) { int num; int num2; int num3; PlArchivManage.CheckPrintItem(this._theItem, out num, out num2, out num3); if (num2 > 0) { if (MessageBox.Show("是否保存当前的打印状态设置后退出 ?", "未保存", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes) { this.Save(); } } else if (num <= 0) { if (num3 > 0) { switch (MessageBox.Show("是:将取消打印!\r\n否:仅保存修改! ", "取消打印", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)) { case DialogResult.Yes: PlArchivManage.CancelPrint(this._theItem, ""); this.Save(); break; case DialogResult.No: this.Save(); break; } } } else { switch (MessageBox.Show("是: 将结束打印,不再允许更改!\r\n否:仅保存修改! ", "完成打印", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)) { case DialogResult.Yes: { StringBuilder builder; PlArchivManage.EndPrint(this._theItem, "", false); this.Save(); ArrayList lstItems = new ArrayList(); lstItems.Add(this._theItem); PlArchivManage.Agent.CheckTsdRight(lstItems, "EndPrint", out builder, "托晒"); if (builder.Length <= 0) { PlArchivManage.Agent.PrintOrSentTsd(ClientData.LogonUser.Oid, this._theItem, "EndPrint", out builder); if (builder.Length > 0) { FrmArchivManage.frmMian.DisplayTextInRichtBox("完成打印失败,检测到下列错误:\r\n\t" + builder.ToString(), 0, true); return; } flag = true; break; } FrmArchivManage.frmMian.DisplayTextInRichtBox("完成打印失败,检测到下列错误:\r\n\t" + builder.ToString(), 0, true); return; } case DialogResult.No: this.Save(); break; } } } this._theItem = PLItem.Agent.GetBizItem(this._theItem.MasterOid, 0, 0, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem) as DEBusinessItem; try { if (flag) { PlArchivManage.CommitWorkItem(this._theItem); } } catch (Exception exception) { FrmArchivManage.frmMian.DisplayTextInRichtBox("打印完成,但提交流程失败:" + this._theItem.Id + exception.ToString(), 2, true); } if (BizItemHandlerEvent.Instance.D_AfterIterationUpdated != null) { BizItemHandlerEvent.Instance.D_AfterIterationUpdated(BizOperationHelper.ConvertPLMBizItemDelegateParam(this._theItem)); } DelegatesOfAm.Instance.D_AfterPrintTabClose(this._theItem.Id); }
private void InitIvwRelItem() { this.hsCols = PlArchivManage.Agent.GetViewOfCol("打印明细", out this.lstOrder, out this.hsColWide); PlArchivManage.SetCol(this.hsCols, this.lvwPrintBom, "PrintBom", this.lstOrder, this.hsColWide); this.RefreshBoms(); }
private void btnPrintEnd_Click(object sender, EventArgs e) { if (this.lvwPrintBom.SelectedItems.Count != 0) { ListViewItem current; ArrayList list = new ArrayList(); ArrayList list2 = new ArrayList(); IEnumerator enumerator = this.lvwPrintBom.SelectedItems.GetEnumerator(); while (enumerator.MoveNext()) { current = (ListViewItem)enumerator.Current; DERelationBizItem tag = current.Tag as DERelationBizItem; if (!(this.GetRelItemStatus(tag) == "已打印")) { list.Add(tag); list2.Add(current); } } if (list.Count != 0) { if (list.Count == 1) { current = list2[0] as ListViewItem; current.Selected = true; } bool isSameReason = false; for (int i = 0; i < list.Count; i++) { bool flag2; DERelationBizItem relItem = list[i] as DERelationBizItem; if (i < (list.Count - 1)) { flag2 = false; } else { flag2 = true; } if (!isSameReason) { FrmInputRemark remark = new FrmInputRemark(relItem.Id + "完成打印", true, flag2); DialogResult result = remark.ShowDialog(); isSameReason = remark.IsSameReason; string strMarkup = remark.StrMarkup; if (isSameReason) { if (result != DialogResult.OK) { int count = list.Count - i; list.RemoveRange(i, count); } else { for (int j = i; j < list.Count; j++) { DERelationBizItem item4 = list[j] as DERelationBizItem; PlArchivManage.EndPrint(item4, strMarkup); PlArchivManage.UpdatePrintLvwRelValues(this.lvwPrintBom, this.lstOrder, item4); this._isChg = true; } } break; } if (result != DialogResult.OK) { list.RemoveAt(i); i--; } else { PlArchivManage.EndPrint(relItem, strMarkup); PlArchivManage.UpdatePrintLvwRelValues(this.lvwPrintBom, this.lstOrder, relItem); this._isChg = true; } } } this.RefreshFormByDocId(); } } }
private void D_TOSENT_TSD_Click(object sender, EventArgs e) { ArrayList lstItems = new ArrayList(); foreach (ListViewItem item in this.lvwTSD.SelectedItems) { DEBusinessItem tag = item.Tag as DEBusinessItem; if (((tag.State == ItemState.CheckOut) && (tag.Holder == ClientData.LogonUser.Oid)) || (tag.State == ItemState.CheckIn)) { lstItems.Add(tag); } } if (lstItems.Count == 0) { MessageBox.Show("没有能够回收的托晒单!", "提示", MessageBoxButtons.OK, MessageBoxIcon.None); } else { StringBuilder builder; ArrayList list2 = PlArchivManage.Agent.CheckTsdRight(lstItems, "ToSent", out builder, "托晒"); if (list2.Count == 0) { FrmArchivManage.frmMian.DisplayTextInRichtBox("没有数据可以发送回收:\r\n" + builder.ToString(), 0, true); } else { if (builder.Length > 0) { DialogResult result = MessageBox.Show("发现数据错误,见详细信息中的内容,是否继续?", "发送托晒单直接回收错误", MessageBoxButtons.YesNo, MessageBoxIcon.Question); FrmArchivManage.frmMian.DisplayTextInRichtBox("下列数据无法 直接回收:\r\n" + builder.ToString(), 0, result == DialogResult.No); if (result != DialogResult.Yes) { return; } } StringBuilder builder2 = new StringBuilder(); StringBuilder builder3 = new StringBuilder(); for (int i = 0; i < list2.Count; i++) { StringBuilder builder4; DEBusinessItem item3 = list2[i] as DEBusinessItem; PlArchivManage.Agent.PrintOrSentTsd(ClientData.LogonUser.Oid, item3, "ToSent", out builder4); if (builder4.Length > 0) { builder.Append(builder4.ToString()); } else { item3 = PLItem.Agent.GetBizItem(item3.MasterOid, 0, 0, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem) as DEBusinessItem; try { PlArchivManage.CommitWorkItem(item3); } catch (Exception exception) { builder3.Append("\t" + item3.Id + ":" + exception.Message + "\r\n\t " + exception.ToString()); } if (BizItemHandlerEvent.Instance.D_AfterReleased != null) { BizItemHandlerEvent.Instance.D_AfterReleased(BizOperationHelper.ConvertPLMBizItemDelegateParam(item3)); } builder2.Append("\t" + item3.Id); } } if (builder.Length > 0) { FrmArchivManage.frmMian.DisplayTextInRichtBox("下列托晒单直接回收没有成功\r\n" + builder.ToString(), 0, true); } if (builder2.Length > 0) { FrmArchivManage.frmMian.DisplayTextInRichtBox("下列托晒单直接回收成功\r\n" + builder2.ToString(), 1, true); } if (builder3.Length > 0) { FrmArchivManage.frmMian.DisplayTextInRichtBox("下列托晒单已发送回收,但提交流程失败\r\n" + builder3.ToString(), 2, true); } } } }
private void btnUpdateBpm_Click(object sender, EventArgs e) { PlArchivManage.SetBpmInfo(this.resWkTsd, true); }