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 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 mEndSent_Click(object sender, EventArgs e) { if (this.lvwSentLst.SelectedItems.Count != 0) { ArrayList list = new ArrayList(); foreach (ListViewItem item in this.lvwSentLst.SelectedItems) { DEBusinessItem tag = item.Tag as DEBusinessItem; if ((tag.State == ItemState.CheckOut) && (tag.Holder == ClientData.LogonUser.Oid)) { list.Add(tag); } else if (tag.State == ItemState.CheckIn) { object attrValue = tag.Iteration.GetAttrValue(ConstAm.SENT_ATTR_SENTSTATUS); string str = (attrValue == null) ? "" : attrValue.ToString(); if (str != "已收发") { list.Add(tag); } } } if (list.Count == 0) { MessageBox.Show("收发帐不符合要求,被别人检出,或已经定版!"); } else { int num; DEBusinessItem item3; StringBuilder strErr = new StringBuilder(); for (num = 0; num < list.Count; num++) { item3 = list[num] as DEBusinessItem; StringBuilder builder2 = PlArchivManage.CheckSentRight(item3, true); if (builder2.Length > 0) { strErr.Append(item3.Id + "不能完成收发\r\t" + builder2); list.Remove(item3); num--; } } if (strErr.Length > 0) { FrmArchivManage.frmMian.DisplayTextInRichtBox(strErr.ToString(), 0, true); } else { PlArchivManage.Agent.SignSentList(list, string.Empty, string.Empty, string.Empty); StringBuilder builder3 = new StringBuilder(); for (num = 0; num < list.Count; num++) { int num2; DEBusinessItem item4; item3 = list[num] as DEBusinessItem; bool isJustOne = (list.Count - num) > 1; FrmInputRemark remark = new FrmInputRemark("收发帐:" + item3.Id + "结束收发", true, isJustOne); DialogResult result = remark.ShowDialog(); bool isSameReason = remark.IsSameReason; if (result != DialogResult.OK) { if (isSameReason) { num2 = num; while (num2 < list.Count) { item4 = list[num2] as DEBusinessItem; list.RemoveAt(num2); num2--; num2++; } } else { list.RemoveAt(num); num--; } } else { if (isSameReason) { for (num2 = num; num2 < list.Count; num2++) { item4 = list[num2] as DEBusinessItem; PlArchivManage.EndSent(item4, remark.StrMarkup, out strErr); this.ReNewOpen(item3); } break; } PlArchivManage.EndSent(item3, remark.StrMarkup, out strErr); this.ReNewOpen(item3); } } if (list.Count > 0) { for (num = 0; num < list.Count; num++) { item3 = list[num] as DEBusinessItem; builder3.Append(item3.Id); builder3.Append(";"); } } if (builder3.Length > 0) { builder3 = builder3.Remove(builder3.Length - 1, 1); builder3.Insert(0, "\r\n 收发完成"); FrmArchivManage.frmMian.DisplayTextInRichtBox(builder3.ToString(), 1, true); } } } } }
private void mCancelSent_Click(object sender, EventArgs e) { if (this.lvwSentLst.SelectedItems.Count != 0) { ArrayList list = new ArrayList(); foreach (ListViewItem item in this.lvwSentLst.SelectedItems) { DEBusinessItem tag = item.Tag as DEBusinessItem; if ((tag.State == ItemState.CheckOut) && (tag.Holder == ClientData.LogonUser.Oid)) { list.Add(tag); } else if (tag.State == ItemState.CheckIn) { list.Add(tag); } } if (list.Count == 0) { MessageBox.Show("收发帐不符合要求,被别人检出,或已经定版!"); } else { int num; DEBusinessItem item3; StringBuilder builder = new StringBuilder(); for (num = 0; num < list.Count; num++) { item3 = list[num] as DEBusinessItem; StringBuilder builder2 = PlArchivManage.CheckSentRight(item3, false); if (builder2.Length > 0) { builder.Append(item3.Id + "不能完成取消收发\r\t" + builder2); list.Remove(item3); num--; } } if (builder.Length > 0) { FrmArchivManage.frmMian.DisplayTextInRichtBox(builder.ToString(), 0, true); } StringBuilder builder3 = new StringBuilder(); for (num = 0; num < list.Count; num++) { int num2; DEBusinessItem item4; item3 = list[num] as DEBusinessItem; bool isJustOne = (list.Count - num) > 1; FrmInputRemark remark = new FrmInputRemark("收发帐:" + item3.Id + "取消收发", false, isJustOne); DialogResult result = remark.ShowDialog(); bool isSameReason = remark.IsSameReason; if (result != DialogResult.OK) { if (isSameReason) { num2 = num; while (num2 < list.Count) { item4 = list[num2] as DEBusinessItem; list.RemoveAt(num2); num2--; num2++; } } else { list.RemoveAt(num); num--; } } else { if (isSameReason) { for (num2 = num; num2 < list.Count; num2++) { item4 = list[num2] as DEBusinessItem; PlArchivManage.CancelSent(item4, remark.StrMarkup); this.ReNewOpen(item3); } break; } PlArchivManage.CancelSent(item3, remark.StrMarkup); this.ReNewOpen(item3); } } if (list.Count > 0) { for (num = 0; num < list.Count; num++) { item3 = list[num] as DEBusinessItem; builder3.Append(item3.Id); builder3.Append(";"); } } if (builder3.Length > 0) { BizItemHandlerEvent.Instance.D_AfterIterationUpdated((IBizItem[]) list.ToArray(typeof(IBizItem))); builder3 = builder3.Remove(builder3.Length - 1, 1); builder3.Insert(0, "\r\n 取消收发完成"); FrmArchivManage.frmMian.DisplayTextInRichtBox(builder3.ToString(), 1, true); } } } }
private void mItemToSent_Click(object sender, EventArgs e) { if (this.lvwPrintLst.SelectedItems.Count != 0) { ArrayList list = new ArrayList(); StringBuilder builder = new StringBuilder(); foreach (ListViewItem item in this.lvwPrintLst.SelectedItems) { DEBusinessItem tag = item.Tag as DEBusinessItem; if (PlArchivManage.GetTsStatue(tag) == "开始打印") { list.Add(tag); } } if (list.Count == 0) { MessageBox.Show("托晒单状态不符合要求,必须处于“开始打印”阶段的托晒单才能完成打印,发往收发部门!"); } else { DialogResult result = MessageBox.Show("是: 对于打印状态为[已取消]的托晒明细,也将设置为[已完成]\r\n否:已取消打印的托晒明细不做处理。", "完成打印方式选择", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question); int num = (result == DialogResult.Yes) ? 1 : ((result == DialogResult.No) ? 2 : 0); if (num == 0) { MessageBox.Show("取消完成打印操作"); } else { int num2; DEBusinessItem current; StringBuilder builder2 = new StringBuilder(); StringBuilder builder3 = new StringBuilder(); Hashtable hashtable = new Hashtable(); bool isPowerPrintBomAll = num == 1; ArrayList list2 = new ArrayList(); for (num2 = 0; num2 < list.Count; num2++) { int num3; int num4; int num5; current = list[num2] as DEBusinessItem; PlArchivManage.CheckPrintItem(current, out num3, out num4, out num5); if (!(isPowerPrintBomAll || (((num3 != 0) || (num4 != 0)) || (num5 == 0)))) { list2.Add(current); list.Remove(current); num2--; } else { int num6; DEBusinessItem item4; bool isJustOne = (list.Count - num2) == 1; FrmInputRemark remark = new FrmInputRemark("托晒单:" + current.Id + "完成打印", true, isJustOne); result = remark.ShowDialog(); bool isSameReason = remark.IsSameReason; string strMarkup = remark.StrMarkup; if (result != DialogResult.OK) { if (isSameReason) { num6 = num2; while (num6 < list.Count) { item4 = list[num6] as DEBusinessItem; builder3.Append(item4.Id); builder3.Append(";"); list.RemoveAt(num6); num6--; num6++; } } else { builder3.Append(current.Id); builder3.Append(";"); list.RemoveAt(num2); num2--; } } else { if (isSameReason) { for (num6 = num2; num6 < list.Count; num6++) { item4 = list[num6] as DEBusinessItem; hashtable[item4] = strMarkup; num2++; } break; } hashtable[current] = strMarkup; } } } if (list2.Count > 0) { string str2 = ""; IEnumerator enumerator = list2.GetEnumerator(); while (enumerator.MoveNext()) { current = (DEBusinessItem) enumerator.Current; str2 = str2 + current.Id + " "; } FrmArchivManage.frmMian.DisplayTextInRichtBox("下列托晒单中所有明细均以被取消打印,不能完成打印:\r\n" + str2, 2, true); } if (list.Count > 0) { StringBuilder builder4 = new StringBuilder(); ArrayList list3 = new ArrayList(); for (num2 = 0; num2 < list.Count; num2++) { StringBuilder builder5; current = list[num2] as DEBusinessItem; string sm = (hashtable[current] == null) ? "" : hashtable[current].ToString(); PlArchivManage.EndPrint(current, sm, isPowerPrintBomAll); current.Iteration = PLItem.UpdateItemIterationDirectly(current, ClientData.LogonUser.Oid, true, ClientData.UserGlobalOption, false); PlArchivManage.Agent.PrintOrSentTsd(ClientData.LogonUser.Oid, current, "EndPrint", out builder5); if (builder5.Length > 0) { builder4.Append(builder5.ToString()); } else { list3.Add(current); } } if (list3.Count > 0) { ArrayList list4 = new ArrayList(); ArrayList list5 = new ArrayList(); ArrayList list6 = new ArrayList(); for (num2 = 0; num2 < list3.Count; num2++) { IBizItem item5 = list3[num2] as IBizItem; list4.Add(item5.MasterOid); list5.Add(0); list6.Add(0); } list3 = PLItem.Agent.GetBizItems((Guid[]) list4.ToArray(typeof(Guid)), (int[]) list5.ToArray(typeof(int)), (int[]) list6.ToArray(typeof(int)), ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem); BizItemHandlerEvent.Instance.D_AfterIterationUpdated((IBizItem[]) list3.ToArray(typeof(IBizItem))); foreach (DEBusinessItem item6 in list3) { builder2.Append(item6.Id); builder2.Append(";"); this.ReNewOpen(item6); object systemParameter = new PLSystemParam().GetSystemParameter(ConstAm.ISUSEAUTOCOMMIT); if (systemParameter != null) { bool flag4 = systemParameter.ToString() == "Y"; try { if (flag4) { PlArchivManage.CommitWorkItem(item6); } } catch (Exception exception) { builder.Append("\t" + item6.Id + ":" + exception.Message + "\r\n\t " + exception.ToString()); } } } } } if (builder2.Length > 0) { builder2 = builder2.Remove(builder2.Length - 1, 1); builder2.Insert(0, "\r\n 完成打印"); FrmArchivManage.frmMian.DisplayTextInRichtBox(builder2.ToString(), 1, true); } if (builder3.Length > 0) { builder3 = builder3.Remove(builder2.Length - 1, 1); builder3.Insert(0, "\r\n 被取消打印:"); FrmArchivManage.frmMian.DisplayTextInRichtBox(builder3.ToString(), 2, true); } if (builder.Length > 0) { FrmArchivManage.frmMian.DisplayTextInRichtBox("下列托晒单已完成打印,但提交流程失败\r\n" + builder.ToString(), 2, true); } } } } }
private void mItemCancelPrint_Click(object sender, EventArgs e) { if (this.lvwPrintLst.SelectedItems.Count != 0) { ArrayList list = new ArrayList(); foreach (ListViewItem item in this.lvwPrintLst.SelectedItems) { DEBusinessItem tag = item.Tag as DEBusinessItem; string tsStatue = PlArchivManage.GetTsStatue(tag); if ((tsStatue != "打印完成") && (tsStatue != "打印取消")) { list.Add(tag); } } if (list.Count == 0) { MessageBox.Show("没有可以取消打印的托晒单!"); } else { int num; DEBusinessItem item3; string strMarkup; StringBuilder builder = new StringBuilder(); StringBuilder builder2 = new StringBuilder(); bool isSameReason = false; Hashtable hashtable = new Hashtable(); for (num = 0; num < list.Count; num++) { int num2; DEBusinessItem item4; item3 = list[num] as DEBusinessItem; bool isJustOne = (list.Count - num) == 1; FrmInputRemark remark = new FrmInputRemark("托晒单:" + item3.Id + "取消打印", false, isJustOne); DialogResult result = remark.ShowDialog(); isSameReason = remark.IsSameReason; strMarkup = remark.StrMarkup; if (result != DialogResult.OK) { if (isSameReason) { num2 = num; while (num2 < list.Count) { item4 = list[num2] as DEBusinessItem; builder2.Append(item4.Id); builder2.Append(";"); list.RemoveAt(num2); num2--; num2++; } } else { builder2.Append(item3.Id); builder2.Append(";"); list.RemoveAt(num); num--; } } else { if (isSameReason) { for (num2 = num; num2 < list.Count; num2++) { item4 = list[num2] as DEBusinessItem; hashtable[item4] = strMarkup; num++; } break; } hashtable[item3] = strMarkup; } } if (list.Count > 0) { try { for (num = 0; num < list.Count; num++) { item3 = list[num] as DEBusinessItem; strMarkup = (hashtable[item3] == null) ? "" : hashtable[item3].ToString(); PlArchivManage.CancelPrint(item3, strMarkup); item3.Iteration = PLItem.UpdateItemIterationDirectly(item3, ClientData.LogonUser.Oid, true, ClientData.UserGlobalOption, false); builder.Append(item3.Id); builder.Append(";"); this.ReNewOpen(item3); } if (builder.Length > 0) { builder = builder.Remove(builder.Length - 1, 1); builder.Insert(0, "\r\n 打印取消"); FrmArchivManage.frmMian.DisplayTextInRichtBox(builder.ToString(), 1, true); } } finally { BizItemHandlerEvent.Instance.D_AfterIterationUpdated((IBizItem[]) list.ToArray(typeof(IBizItem))); } } else { MessageBox.Show("此次操作被取消"); } } } }
private void btnEndSent_Click(object sender, EventArgs e) { FrmInputRemark remark = new FrmInputRemark("完成" + this._theItem.Id + "有关图纸的收发", true, true); if (remark.ShowDialog() == DialogResult.OK) { StringBuilder builder; if (this.IsChange) { this.Save(); } PlArchivManage.EndSent(this._theItem, remark.StrMarkup, out builder); if (builder.Length == 0) { FrmArchivManage.frmMian.DisplayTextInRichtBox("完成" + this._theItem.Id + "有关图纸的收发", 1, false); } else { FrmArchivManage.frmMian.DisplayTextInRichtBox(string.Concat(new object[] { "未完成", this._theItem.Id, "有关图纸的收发:", builder }), 0, true); } } this.ReNewGetItem(); }