internal void PrintOrSentTsd(Guid useroid, DEBusinessItem item, string action, out StringBuilder strErr) { DBParameter dbParameter = DBUtil.GetDbParameter(true); try { dbParameter.Open(); new DaArchivManager(dbParameter).PrintOrSentTsd(useroid, item, action, out strErr); if (strErr.Length > 0) { dbParameter.Rollback(); } else { dbParameter.Commit(); } } catch (Exception exception) { dbParameter.Rollback(); throw new PLMException("托晒单发送打印失败", exception); } finally { dbParameter.Close(); } }
public void TemplateCompare(DEBusinessItem item1, DEBusinessItem item2) { new FrmTmpCompare(item1, item2, this.user) { MdiParent = ClientData.mainForm }.Show(); }
private void InitializeControls(DEBusinessItem item1, DEBusinessItem item2, DEUser user) { PPTmpControl control = null; PPTmpControl control2 = null; if (item1 != null) { control = new PPTmpControl(item1, user, true) { Dock = DockStyle.Fill }; this.panel1.Controls.Clear(); this.panel1.Controls.Add(control); } if (item2 != null) { control2 = new PPTmpControl(item2, user, true) { Dock = DockStyle.Fill }; this.panel2.Controls.Clear(); this.panel2.Controls.Add(control2); } if ((control != null) && (control2 != null)) { control.CompareControl = control2; control2.CompareControl = control; control.TemplateCompare(); } this.lab_Card1.Text = string.Concat(new object[] { "模板代号:", item1.Id, " 版本号:", item1.RevNum, ".", item1.IterNum }); this.lab_Card2.Text = string.Concat(new object[] { "模板代号:", item2.Id, " 版本号:", item2.RevNum, ".", item2.IterNum }); }
private void lvw_ItemDrag(object sender, ItemDragEventArgs e) { if (this.lvw.SelectedItems.Count >= 1) { CLCopyData data = new CLCopyData(); foreach (ListViewItem item in this.lvw.SelectedItems) { DataRowView tag = (DataRowView)item.Tag; try { DEBusinessItem item2 = PLItem.Agent.GetBizItemByMaster(new Guid((byte[])tag[0]), 0, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem) as DEBusinessItem; if (item2 != null) { data.Add(item2); } } catch (PLMException exception) { PrintException.Print(exception); return; } catch (Exception exception2) { MessageBoxPLM.Show("拖动资源数据出错:" + exception2.Message, "工程资源"); return; } } this.lvw.DoDragDrop(data, DragDropEffects.Link | DragDropEffects.Move | DragDropEffects.Copy); } }
public static string GetNewId(DEBusinessItem theItem, string oldId, BusinessItemType itemType, string className, out string codeId, out bool isGenIdInServer) { FrmNewID wid = new FrmNewID(oldId, itemType, className) { newId = false, curItem = theItem }; isGenIdInServer = false; codeId = null; if (ServiceSwitches.IsTiIntegratorTopMost) { wid.TopMost = true; } if (wid.ShowDialog() == DialogResult.OK) { isGenIdInServer = wid.isGenIdInServer; codeId = wid.txtId.Tag as string; if (isGenIdInServer) { wid.id = null; } } return(wid.id); }
private XmlDocument AddChildXmlDocument(XmlDocument doc, DEBusinessItem baseItem) { if (doc == null || baseItem == null) { return(doc); } var links = GetLinks(baseItem, "GXTORESOURCEDOC");//工序和资源 if (links == null || links.Count == 0) { return(doc); } for (int i = 0; i < links.BizItems.Count; i++) { var item = links.BizItems[i] as DEBusinessItem;//资源对象 if (item == null) { continue; } var relation = links.RelationList[i] as DERelation2;//工序和资源关系 var componentDt = GetOperationResDt(baseItem, item, relation); doc = AddComponentNode(doc, componentDt); } return(doc); }
/// <summary> /// 获取数据 /// </summary> /// <param name="dEBusinessItem"></param> /// <returns></returns> private DataTable GetDataTable(DEBusinessItem dEBusinessItem) { if (dEBusinessItem == null) { return(null); } var dt = BuildElementDt(); var row = dt.NewRow(); foreach (DataColumn col in dt.Columns) { var val = dEBusinessItem.GetAttrValue(dEBusinessItem.ClassName, col.ColumnName.ToUpper()); switch (col.ColumnName) { default: row[col] = val == null ? DBNull.Value : val; break; case "Description": row[col] = dEBusinessItem.Name; break; case "CalendarCode": row[col] = "SYSTEM"; break; case "ProductLineFlag": row[col] = val == null ? 1 : val; break; } } dt.Rows.Add(row); return(dt); }
private void EditProperties(bool readOnly) { if (this.lvwTemplates.SelectedItems.Count != 1) { MessageBoxPLM.Show("请选中一个模板。", "PPC - FrmBrowse", MessageBoxButtons.OK, MessageBoxIcon.Question); } else { DEBusinessItem tag = (DEBusinessItem)this.lvwTemplates.SelectedItems[0].Tag; if (!readOnly && (tag.Master.Holder != this.user.Oid)) { MessageBoxPLM.Show("请先检出该对象。", "PPC - FrmBrowse", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { Cursor current = Cursor.Current; Cursor.Current = Cursors.WaitCursor; FrmProperty property = null; try { property = new FrmProperty(this.user.Oid, readOnly, false, tag.Master.Oid); } catch (Exception exception) { MessageBoxPLM.Show("载入属性失败。\n" + exception.Message, "PPC - FrmBrowse", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } finally { Cursor.Current = current; } property.ShowDialog(); } } }
private void AfterRenamed(object sender, PLMOperationArgs e) { if (((e.BizItems != null) && (e.BizItems.Length != 0)) && (e.BizItems[0].ClassName == "PPCRDTEMPLATE")) { string templateType = ""; DEBusinessItem item = PSConvert.ToBizItem(e.BizItems[0], ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid); if (item.Iteration == null) { templateType = PLCardTemplate.GetTemplateType(item.Revision, this.user.Oid); } else { templateType = (string)item.Iteration.GetAttrValue("TEMPLATETYPE"); } if ((this.headClass == templateType) || (this.headClass == null)) { foreach (ListViewItem item2 in this.lvwTemplates.Items) { if (((DEBusinessItem)item2.Tag).Master.Oid == item.Master.Oid) { item2.Tag = e.BizItems[0]; if (!this.inDialog) { this.FillListViewItem(item2, item.Master, item.Revision); } break; } } } } }
private void AfterReleaseDescUpdated(IBizItem[] bizItems) { if ((bizItems != null) && (bizItems.Length != 0)) { DEBusinessItem item = PSConvert.ToBizItem(bizItems[0], ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid); string attrValue = (string)item.Iteration.GetAttrValue("TEMPLATETYPE"); if (ClientData.mainForm != null) { foreach (Form form in ClientData.mainForm.MdiChildren) { if (form is FrmBrowse) { FrmBrowse browse = form as FrmBrowse; if ((browse.headClass == attrValue) || (browse.headClass == null)) { foreach (ListViewItem item2 in browse.lvwTemplates.Items) { if (((DEBusinessItem)item2.Tag).Master.Oid == item.Master.Oid) { item2.Tag = item; if (!browse.inDialog) { browse.FillListViewItem(item2, item.Master, item.Revision); } break; } } } } } } } }
private void AfterItemCreated(object sender, PLMOperationArgs e) { if ((e.Items != null) && (((DEBusinessItem)e.Items[0]).ClassName == "PPCRDTEMPLATE")) { string className = ""; DEBusinessItem item = e.Items[0] as DEBusinessItem; if (item.Iteration == null) { className = PLCardTemplate.GetTemplateType(item.Revision, this.user.Oid); } else { className = (string)item.Iteration.GetAttrValue("TEMPLATETYPE"); } if ((this.headClass == className) || (((this.headClass == null) && !ModelContext.MetaModel.IsForm(className)) && !ModelContext.MetaModel.IsCard(className))) { int objectImage = ClientData.ItemImages.GetObjectImage(item.Master.ClassName, PLDataModel.GetStateByMasterInfo(item.Master.State, true)); ListViewItem lvi = new ListViewItem(item.Master.Id, objectImage); this.FillListViewItem(lvi, item.Master, item.Revision); lvi.Tag = item; this.lvwTemplates.Items.Add(lvi); lvi.Selected = true; } } }
private void SelectTemplate() { if (this.lvwTemplates.SelectedItems.Count == 0) { MessageBoxPLM.Show("尚未选中模板。", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else { DEBusinessItem item = null; if (this.SelectOldRevision) { if (this.selectedItem == null) { MessageBoxPLM.Show("尚未选中模板。", "警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } int revNum = Convert.ToInt32(this.numRevisions.Value); item = PLItem.Agent.GetBizItemByMaster(this.selectedItem.Master.Oid, revNum, PLOption.GetUserGlobalOption(this.user.Oid).CurView, this.user.Oid, BizItemMode.BizItem) as DEBusinessItem; this.SelectedTemplate = new CLCardTemplate(this.user.Oid, false, true, item); } else { item = PLItem.Agent.GetBizItemByMaster(this.selectedItem.Master.Oid, 0, PLOption.GetUserGlobalOption(ClientData.LogonUser.Oid).CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem) as DEBusinessItem; this.SelectedTemplate = new CLCardTemplate(this.user.Oid, false, true, item); } try { this.SelectedTemplate.CheckProperties(); } catch (Exception exception) { MessageBoxPLM.Show("严重警告:该模板有关属性填写有错,不能选择该模板,请联系定制人员更正。\n详细信息是:" + exception.Message, "PPM警告", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } base.DialogResult = DialogResult.OK; } }
public UcPrintItem(DEBusinessItem item) { this.InitializeComponent(); this._theItem = item; this.InitUc(); this.InitIvwRelItem(); }
/// <summary> /// 获取OperationRes数据 /// </summary> /// <param name="item"></param> /// <returns></returns> private DataTable GetOperationInspDt(DEBusinessItem item) { if (item == null) { return(null); } var dt = BuildOperationInspDt(); var row = dt.NewRow(); foreach (DataColumn col in dt.Columns) { var val = item.GetAttrValue(item.ClassName, col.ColumnName.ToUpper()); switch (col.ColumnName) { default: row[col] = val == null ? DBNull.Value : val; break; case "QTMethod": if (val == null) { return(null); } row[col] = val; break; } } dt.Rows.Add(row); return(dt); }
/// <summary> /// 添加新行 /// </summary> /// <param name="dt">数据</param> /// <param name="item">当前对象</param> /// <returns></returns> private DataTable AddNewRow(DataTable dt, DEBusinessItem item) { if (dt == null || dt.Columns.Count == 0 || item == null) { return(null); } var row = dt.NewRow(); foreach (DataColumn col in dt.Columns) { if (col == null) { continue; } if (string.IsNullOrEmpty(col.ColumnName) || col.ColumnName == IS_SELECTED) { continue; } var sp = col.ColumnName.Split('.'); if (sp == null || sp.Length < 2) { continue; } var category = sp[0]; var attrName = sp[1]; var val = GetAttrValue(category, attrName, item, col); row[col] = val; } dt.Rows.Add(row); return(dt); }
internal void PrintOrSentTsd(Guid useroid, DEBusinessItem item, string action, out StringBuilder strErr) { this.cmd.Parameters.Clear(); strErr = new StringBuilder(); this.cmd.CommandType = CommandType.StoredProcedure; Guid ssoid = Guid.NewGuid(); this.cmd.CommandText = "PLM_DQ_DOSSIER.TsdToPrintOrSent"; this.cmd.Parameters.Add(":ssoid", OracleDbType.Raw).Value = ssoid.ToByteArray(); this.cmd.Parameters.Add(":tAction", OracleDbType.Varchar2).Value = action; this.cmd.Parameters.Add(":useroid", OracleDbType.Raw).Value = useroid.ToByteArray(); this.cmd.Parameters.Add(":mOid", OracleDbType.Raw).Value = item.MasterOid.ToByteArray(); this.cmd.Parameters.Add(":tId", OracleDbType.Varchar2).Value = item.Id; this.cmd.Parameters.Add(":clentip", OracleDbType.Varchar2).Value = DAItem.GetClientIp(); this.cmd.ExecuteNonQuery(); this.cmd.Parameters.Clear(); this.cmd.CommandType = CommandType.Text; this.cmd.CommandText = "select PLM_ID,PLM_INFO from plm_tmp_archivmanage where plm_ssoid =:ssoid"; this.cmd.Parameters.Add(":ssoid", OracleDbType.Raw).Value = ssoid.ToByteArray(); OracleDataReader reader = this.cmd.ExecuteReader(); while (reader.Read()) { string str = reader.GetOracleString(0).Value; if (!reader.IsDBNull(1)) { strErr.Append("托晒单:" + str + ":"); strErr.Append(reader.GetOracleString(1).Value); } } this.ClearTmpData(ssoid); }
/// <summary> /// 获取数据 /// </summary> /// <param name="item"></param> /// <returns></returns> private DataTable GetParentDt(DEBusinessItem item) { if (item == null) { return(null); } var dt = BuildParentDt(); var row = dt.NewRow(); foreach (DataColumn col in dt.Columns) { var val = item.GetAttrValue(item.ClassName, col.ColumnName.ToUpper()); switch (col.ColumnName) { default: row[col] = val == null ? DBNull.Value : val; break; case "InvCode": val = item.GetAttrValue(item.ClassName, "CODE"); row[col] = val == null ? DBNull.Value : val; break; case "ParentScrap": row[col] = val == null ? 0m : val; break; } } dt.Rows.Add(row); return(dt); }
/// <summary> /// 获取当前对象 /// </summary> /// <param name="iItem"></param> /// <returns></returns> public DEBusinessItem GetDEBusinessItem(IBizItem iItem) { IActionContext context = ActionContext2.GetInstance().GetCurrentContext(); DEPSOption option = null; if (context != null && context.NavContext.Option != null) { option = context.NavContext.Option; } if (option == null) { option = ClientData.UserGlobalOption; } if (iItem == null) { return(null); } DEBusinessItem bItem = iItem as DEBusinessItem; if (bItem == null && iItem is DESmartBizItem) { DESmartBizItem sb = iItem as DESmartBizItem; bItem = (DEBusinessItem)PLItem.Agent.GetBizItem(sb.MasterOid, sb.RevOid, sb.IterOid, option.CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem); } return(bItem); }
/// <summary> /// 获取数据 /// </summary> /// <param name="dEBusinessItem"></param> /// <returns></returns> private DataTable GetDataTable(DEBusinessItem dEBusinessItem) { if (dEBusinessItem == null) { return(null); } var dt = BuildElementDt(); var row = dt.NewRow(); foreach (DataColumn col in dt.Columns) { var val = dEBusinessItem.GetAttrValue(dEBusinessItem.ClassName, col.ColumnName.ToUpper()); switch (col.ColumnName) { default: row[col] = val == null ? DBNull.Value : val; break; case "group_code": row[col] = val == null ? "01" : val; break; } } dt.Rows.Add(row); return(dt); }
/// <summary> /// 获取数据 /// </summary> /// <param name="item"></param> /// <returns></returns> private DataTable GetHeadDt(DEBusinessItem item) { if (item == null) { return(null); } var dt = BuildHeadDt(); var row = dt.NewRow(); foreach (DataColumn col in dt.Columns) { var val = item.GetAttrValue(item.ClassName, col.ColumnName.ToUpper()); switch (col.ColumnName) { default: row[col] = val == null ? DBNull.Value : val; break; case "Description": row[col] = item.Name; break; case "ResType": case "FeeType": case "BaseType": row[col] = val == null ? 1 : val;; break; } } dt.Rows.Add(row); return(dt); }
/// <summary> /// 获取数据 /// </summary> /// <param name="item"></param> /// <returns></returns> private DataTable GetVertionDt(DEBusinessItem item) { if (item == null) { return(null); } var dt = BuildVersionDt(); var row = dt.NewRow(); foreach (DataColumn col in dt.Columns) { var val = item.GetAttrValue(item.ClassName, col.ColumnName.ToUpper()); switch (col.ColumnName) { default: row[col] = val == null ? DBNull.Value : val; break; case "Version": row[col] = item.LastRevision; break; case "Status": row[col] = val == null ? 3 : val; break; case "BomType": row[col] = val == null ? 1 : val; break; } } dt.Rows.Add(row); return(dt); }
/// <summary> /// 创建xml框架(ufinterface节点和父节点) /// </summary> /// <param name="dt"></param> /// <returns></returns> protected XmlDocument CreateXmlSchema(string tableName, DEBusinessItem dEBusinessItem, string operatorStr) { if (string.IsNullOrEmpty(tableName) || dEBusinessItem == null) { return(null); } XmlDocument doc = new XmlDocument(); var dec = doc.CreateXmlDeclaration("1.0", "utf-8", "yes"); doc.AppendChild(dec); //var node = doc.SelectSingleNode(tableName); var root = doc.CreateElement("ufinterface"); #region 默认,无需修改 root.SetAttribute("receiver", "U8");//接收方 //档案或单据模版名,填档案或单据的唯一标识,如:客商档案:customer,客商分类:customerclass ,具体名称由总体确定,在数据交换中该名称要经常使用; root.SetAttribute("roottag", tableName); //proc:操作类型,分为“增删改查”,对应填Add / Delete /Edit /Query(必填),该字段导入操作,请填写Add / Delete /Edit,导出操作,请填写Query; root.SetAttribute("proc", operatorStr); //编码是否已转换,该字段在导入的时候使用,如果已转换即已和U8基础数据编码一致填Y,将不会通过对照表的转换,如果没有转换即和U8基础数据编码不一致填N,将会自动通过对照表转换之后,进行相应的操作 root.SetAttribute("codeexchanged", "N"); root.SetAttribute("paginate", "0"); root.SetAttribute("family", GetFamilyStr(tableName)); #endregion //发送方,填外部系统注册码(必填) root.SetAttribute("sender", "001"); var tableNode = doc.CreateElement(tableName); root.AppendChild(tableNode); doc.AppendChild(root); return(doc); }
/// <summary> /// 构建子结构 /// </summary> /// <param name="doc"></param> /// <param name="_dEBusinessItem"></param> /// <returns></returns> private XmlDocument BuildChildXmlDoc(XmlDocument doc, DEBusinessItem baseItem) { if (baseItem == null || doc == null) { return(doc); } var linkItems = GetLinks(baseItem, "RESOURCETOWORKCEN");//todo:修改关系名(资源和工作中心) if (linkItems == null || linkItems.Count == 0) { return(doc); } for (int i = 0; i < linkItems.BizItems.Count; i++) { var item = linkItems.BizItems[i] as DEBusinessItem;//工作中心对象 if (item == null) { continue; } var relation = linkItems.RelationList[i] as DERelation2;//资源和工作中心关系 var dt = GetBodyDt(baseItem, item, relation); AddComponentNode(doc, dt); } return(doc); }
public UcTsdItem(string bpmName) { this._isChg = false; this._theItem = null; this.context = new ObjectNavigateContext(); this.hsCols = null; this.input = null; this.lstDocCode = null; this.lstOrder = null; this.lstUnits = null; this.ucAttr = null; this.ucNewItem = null; this._bpmName = ""; this.components = null; this.InitializeComponent(); this._bNew = true; this.lstDocCode = new ArrayList(); this.resWkTsd = new ResWkInfo(); this.resWkTsd.Dock = DockStyle.Fill; this.panel2.Controls.Add(this.resWkTsd); this.SetBtnAndPnlStatue(); this.InitUc(); this.InitIvwRelItem(); this.InitLvwBom(); if (!string.IsNullOrEmpty(bpmName)) { this._bpmName = bpmName; } }
public UcPrintItem(DEBusinessItem item) { this.InitializeComponent(); this._theItem = item; this.InitUc(); this.InitIvwRelItem(); }
private void AfterDeleted(object sender, PLMOperationArgs e) { if ((this.lvwTSD.Items.Count != 0) && (((e != null) && (e.BizItems != null)) && (e.BizItems.Length != 0))) { ArrayList list = new ArrayList(e.BizItems); for (int i = 0; i < this.lvwTSD.Items.Count; i++) { ListViewItem item = this.lvwTSD.Items[i]; DEBusinessItem dest = null; if (item.Tag is DEBusinessItem) { dest = (DEBusinessItem)item.Tag; } else if (item.Tag is DERelationBizItem) { dest = ((DERelationBizItem)item.Tag).BizItem; } if (dest != null) { if (PSStart.EqualMaster((IBizItem[])list.ToArray(typeof(IBizItem)), dest) != null) { this.lvwTSD.Items.RemoveAt(i); i--; } this.CloseTsdTab(dest.Id); } } } }
/// <summary> /// 导入到ERP /// </summary> /// <param name="xml"></param> private bool DoExportImplement(DEBusinessItem bItem, string typeStr, out string errText) { if (bItem == null) { errText = ""; return(false); } XmlDocument doc = new XmlDocument(); errText = ""; var dal = DalFactory.Instance.CreateDal(bItem, typeStr, IgnoreClasses); bool succeed = true; string hasStr = "重复"; string oprt = "Add"; // added by kexp bug:未找到类型时会报空引用错误; if (dal == null) { return(false); } doc = dal.CreateXmlDocument(oprt); if (doc == null) { return(false); } //20181102 added by kexp 添加账套属性配置 if (_senderSeq == null || _senderSeq.Length == 0) { succeed = DoConnect(doc.OuterXml, ref errText); if (!succeed && errText.Contains(hasStr)) { oprt = "Edit"; doc = dal.CreateXmlDocument(oprt); succeed = DoConnect(doc.OuterXml, ref errText); } } else { for (int i = 0; i < _senderSeq.Length; i++) { var xml = ModifyXmlHeaderByConfig(doc.OuterXml, _senderSeq[i]); succeed = DoConnect(xml, ref errText); if (!succeed && errText.Contains(hasStr)) { oprt = "Edit"; doc = dal.CreateXmlDocument(oprt); xml = ModifyXmlHeaderByConfig(doc.OuterXml, _senderSeq[i]); succeed = DoConnect(xml, ref errText); } if (!succeed) { return(succeed); } } } return(succeed); }
private void UpdateTsdItem(object obj) { DEBusinessItem item = obj as DEBusinessItem; if (item != null) { PlArchivManage.UpdateLvwValues(this.hsCols, this.lvwTSD, this.lstOrder, item); } }
private void D_OPEN_TSD_Click(object sender, EventArgs e) { if (this.lvwTSD.SelectedItems.Count == 1) { ListViewItem item = this.lvwTSD.SelectedItems[0]; DEBusinessItem tag = item.Tag as DEBusinessItem; this.OpenTsdEdit(tag); } }
public AttributeSelectorFrm(DEBusinessItem theItem, object sender, PLMOperationArgs args) { InitializeComponent(); // TODO: Complete member initialization this._currentItem = theItem; this._sender = sender; this._args = args; InitData(); }
public void OnMatch(object sender, PLMOperationArgs args) { if (((args != null) && (args.BizItems != null)) && (args.BizItems.Length != 0)) { IBizItem item = args.BizItems[0]; DEBusinessItem theItem = PSConvert.ToBizItem(item, args.Option.CurView, ClientData.LogonUser.Oid); AttributeSelectorFrm frm = new AttributeSelectorFrm(theItem, sender, args); frm.ShowDialog(); } }
public ExportService(DEBusinessItem item) { if (item == null) { throw new ArgumentNullException("item"); } _bItem = item; //20181102 added by kexp 添加账套属性 GetSenderSeq(item); }
public void StartOutPut(Guid iroid, DEBusinessItem item, string wk) { this._name = item.Name; this._id = item.Id; this._item = item; this._wk = wk; this.frmBar = new FrmBar(this.bkwMain); this.bkwMain.RunWorkerAsync(iroid); this.frmBar.ToAStart(); this._YCT = (item.Iteration.GetAttrValue("YCT") == null) ? "" : item.Iteration.GetAttrValue("YCT").ToString(); this._SM = (item.Iteration.GetAttrValue("SM") == null) ? "" : item.Iteration.GetAttrValue("SM").ToString(); this._TSTYPE = (item.Iteration.GetAttrValue("TSTYPE") == null) ? "" : item.Iteration.GetAttrValue("TSTYPE").ToString(); }
public static DERelationBizItem AddNewRelation(DEBusinessItem item, string relName, DEBusinessItem cItem) { DERelation2 relation = new DERelation2 { LeftClass = item.Master.ClassName, LeftObj = item.Iteration.Oid, RelationName = relName, RightClass = cItem.Master.ClassName, RightObj = cItem.Master.Oid, RightObjRev = 0, CreatorName = ClientData.LogonUser.Name, CreateTime = DateTime.Now, View = PSStart.GetLinkView(item.Master, relName, ClientData.UserGlobalOption, ClientData.LogonUser.Oid) }; DERelationBizItemList relationBizItemList = item.Iteration.LinkRelationSet.GetRelationBizItemList(relName); if (relationBizItemList == null) { try { relationBizItemList = PLItem.Agent.GetLinkRelationItems(item.Iteration.Oid, item.Master.ClassName, relName, ClientData.LogonUser.Oid, ClientData.UserGlobalOption); item.Iteration.LinkRelationSet.AddRelationList(relName, relationBizItemList); } catch { } } if (relationBizItemList != null) { relation.Order = GetPossibleOrder(relationBizItemList); item.Iteration.LinkRelationSet.GetRelationBizItemList(relName).AddLinkRelationItem(relation, cItem, RevOccurrenceType.Effective); } ArrayList relationBizItems = item.Iteration.LinkRelationSet.GetRelationBizItemList(relName).RelationBizItems; foreach (DERelationBizItem item2 in relationBizItems) { if (item2.Id == cItem.Id) { return item2; } } return null; }
public static void ResetZsAndFsOfTsd(DEBusinessItem tsdItem) { DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(tsdItem, ConstAm.TDSBOM_RELCLASS); int attrValue = 0; int num2 = 0; int num3 = 0; if (relListOfDEBizItem.Count != 0) { foreach (DERelationBizItem item in relListOfDEBizItem.RelationBizItems) { if (item.Relation.State != RelationState.Deleted) { num3 += (item.Relation.GetAttrValue(ConstAm.TDS_ATTR_MTZS) == null) ? 0 : ((int) item.Relation.GetAttrValue(ConstAm.TDS_ATTR_MTZS)); attrValue += GetTsdBomAllFs(item); if (item.Relation.GetAttrValue("ZS") == null) { ResetZSofTdsBom(item); } object obj2 = item.Relation.GetAttrValue("ZS"); if (obj2 != null) { num2 += Convert.ToInt32(obj2); } } } tsdItem.Iteration.SetAttrValue("FS", attrValue); tsdItem.Iteration.SetAttrValue("ZS", num2); tsdItem.Iteration.SetAttrValue(ConstAm.TDS_ATTR_MTZS, num3); } }
internal static StringBuilder CheckSentRight(DEBusinessItem item, bool isEnd) { string str; StringBuilder builder = new StringBuilder(); DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(item, ConstAm.SENTBOM_RELCLS); foreach (DERelationBizItem item2 in relListOfDEBizItem.RelationBizItems) { str = CheckSentRelItemRight(item2, true); if (!string.IsNullOrEmpty(str)) { builder.Append("\r" + item2.Id + "\n" + str); } } relListOfDEBizItem = GetRelListOfDEBizItem(item, ConstAm.SENTRBOM_RELCLS); foreach (DERelationBizItem item2 in relListOfDEBizItem.RelationBizItems) { str = CheckSentRelItemRight(item2, false); if (!string.IsNullOrEmpty(str)) { builder.Append("\r" + item2.Id + "\n" + str); } } return builder; }
private DataTable GetNewTableForOutPut(DEBusinessItem item, DataTable tb, string username) { string str = item.Iteration.GetAttrValue("TSTYPE").ToString(); string str2 = (item.Iteration.GetAttrValue("DOCCODE") == null) ? "" : item.Iteration.GetAttrValue("DOCCODE").ToString(); string str3 = (item.Iteration.GetAttrValue("DOCNAME") == null) ? "" : item.Iteration.GetAttrValue("DOCNAME").ToString(); string str4 = (item.Iteration.GetAttrValue("VERIT") == null) ? "" : item.Iteration.GetAttrValue("VERIT").ToString(); string str5 = (item.Iteration.GetAttrValue("WKFLINFO") == null) ? "" : item.Iteration.GetAttrValue("WKFLINFO").ToString(); if (string.IsNullOrEmpty(str2)) { str2 = str5; } if (tb.Rows.Count != 0) { DataRow row; DataTable table = tb.Clone(); table.TableName = tb.TableName; ArrayList unit = this.GetUnit(tb); ArrayList docLst = this.GetDocLst(tb); ArrayList allDocUnit = this.GetAllDocUnit(tb, unit); for (int i = 0; i < allDocUnit.Count; i++) { string str6 = allDocUnit[i].ToString(); unit.Remove(str6); row = table.NewRow(); this.ResetNewRowValue(row, tb, str6, username); if (i == 0) { row["图号"] = str2; } else { row["图号"] = ""; } row["收发类型"] = str; if (table.Columns.Contains("名称")) { row["名称"] = str3; } if (table.Columns.Contains("版本")) { row["版本"] = str4; } if (table.Columns.Contains("流程信息")) { row["流程信息"] = str5; } table.Rows.Add(row); } foreach (string str7 in docLst) { foreach (string str6 in unit) { DataRow[] rowArray = tb.Select("图号='" + str7 + "'"); if (rowArray.Length == 0) { break; } DataRow row2 = rowArray[0]; row = table.NewRow(); this.ResetNewRowValue(ref row, row2, str6, username); if (row != null) { row["收发类型"] = str; table.Rows.Add(row); } } } return table; } return null; }
internal void PrintOrSentTsd(Guid useroid, DEBusinessItem item, string action, out StringBuilder strErr) { DBParameter dbParameter = DBUtil.GetDbParameter(true); try { dbParameter.Open(); new DaArchivManager(dbParameter).PrintOrSentTsd(useroid, item, action, out strErr); if (strErr.Length > 0) { dbParameter.Rollback(); } else { dbParameter.Commit(); } } catch (Exception exception) { dbParameter.Rollback(); throw new PLMException("托晒单发送打印失败", exception); } finally { dbParameter.Close(); } }
public static bool ToPrintOrSent(DEBusinessItem item, bool isPrint, out StringBuilder strErr) { string action = isPrint ? "ToPrint" : "ToSent"; string str2 = isPrint ? "发送打印" : "直接回收"; Agent.PrintOrSentTsd(ClientData.LogonUser.Oid, item, action, out strErr); if (strErr.Length > 0) { return false; } item = PLItem.Agent.GetBizItem(item.MasterOid, 0, 0, ClientData.UserGlobalOption.CurView, ClientData.LogonUser.Oid, BizItemMode.BizItem) as DEBusinessItem; return true; }
public static Hashtable ConvertItem(Hashtable hsCols, DEBusinessItem item) { Hashtable hashtable = new Hashtable(); IDictionaryEnumerator enumerator = hsCols.GetEnumerator(); enumerator.Reset(); while (enumerator.MoveNext()) { string attrName = enumerator.Key.ToString(); string str2 = enumerator.Value.ToString(); if (attrName == "ID") { hashtable[str2] = item.Id; } else { object attrValue = item.Iteration.GetAttrValue(attrName); if (attrValue != null) { DEMetaAttribute attribute = ModelContext.MetaModel.GetAttribute(item.Master.ClassName, attrName); if (attribute != null) { if ((attribute.DataType2 == PLMDataType.Guid) && (attribute.Label.IndexOf("人") != -1)) { Guid userId = (Guid) attrValue; if (!userId.Equals(Guid.Empty)) { DEUser userByOid = PLUser.Agent.GetUserByOid(userId); hashtable[str2] = (userByOid != null) ? userByOid.Name : ""; } else { hashtable[str2] = ""; } } else if (attribute.DataType2 == PLMDataType.DateTime) { hashtable[str2] = Convert.ToDateTime(attrValue).ToString("yyyy.MM.dd HH:mm"); } else { hashtable[str2] = attrValue.ToString(); } } } } } return hashtable; }
public static bool CheckItemCanPrintOrSent(bool bToPrint, DEBusinessItem item, out StringBuilder strErr) { string action = bToPrint ? "ToPrint" : "ToSent"; string str2 = bToPrint ? "发送打印" : "直接回收"; ArrayList lstItems = new ArrayList(); lstItems.Add(item); Agent.CheckTsdRight(lstItems, action, out strErr, "托晒"); if (strErr.Length > 0) { return false; } return true; }
private static string GetGetAttrValue(DEBusinessItem item, string attrName) { return ((item.Iteration.GetAttrValue(attrName) == null) ? "" : item.Iteration.GetAttrValue(attrName).ToString()); }
internal static void ResetRealfsOfSent(DEBusinessItem sentItemItem) { int num; int num2; int num3; int attrValue = 0; DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(sentItemItem, ConstAm.SENTBOM_RELCLS); if (relListOfDEBizItem.Count > 0) { foreach (DERelationBizItem item in relListOfDEBizItem.RelationBizItems) { if (item.Relation.State != RelationState.Deleted) { GetSentBomAllFs(item, out num, out num2, out num3); item.Relation.SetAttrValue(ConstAm.SENTBOM_ATTR_REALFS, num3); item.Relation.SetAttrValue("FS", num3); attrValue += num3; } } sentItemItem.Iteration.SetAttrValue("REALFFFS", attrValue); } if (GetRelListOfDEBizItem(sentItemItem, ConstAm.SENTRBOM_RELCLS).Count > 0) { attrValue = 0; foreach (DERelationBizItem item in relListOfDEBizItem.RelationBizItems) { if (item.Relation.State != RelationState.Deleted) { GetSentBomAllFs(item, out num, out num2, out num3); item.Relation.SetAttrValue(ConstAm.SENTBOM_ATTR_REALFS, num3); item.Relation.SetAttrValue("FS", num3); attrValue += num3; } } sentItemItem.Iteration.SetAttrValue("REALHSFS", attrValue); } }
internal static void QuickSign(DEBusinessItem item, string unit, string signer, string sm, out StringBuilder strErr) { ArrayList quickSentRelItems = GetQuickSentRelItems(item, unit); strErr = new StringBuilder(); if (quickSentRelItems.Count == 0) { strErr.Append(unit + "不需要签收或已经签收"); } else { StringBuilder builder; StringBuilder builder2; EndOrCancelSent("", unit, sm, signer, quickSentRelItems, true, out builder, out builder2); if (builder.Length > 0) { strErr.Append(builder.ToString()); } else { ResetRealfsOfSent(item); } } }
public static DERelationBizItem AddNewRelItem(DEBusinessItem docItem, string relName, DEBusinessItem parentItem) { DERelationBizItem item = AddNewRelation(parentItem, relName, docItem); if (item == null) { return null; } item.Relation.SetAttrValue("DOCREV", docItem.RevNum + "." + docItem.IterNum); item.Relation.SetAttrValue("DOCCODE", docItem.Id); item.Relation.SetAttrValue("DOCNAME", docItem.Name); item.Relation.SetAttrValue("MTZS", 1); return item; }
public static void EndPrint(DEBusinessItem item, string sm, bool isPowerPrintBomAll) { string str = ""; DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(item, ConstAm.TDSBOM_RELCLASS); object attrValue = null; attrValue = item.Iteration.GetAttrValue("FFSM"); if (attrValue != null) { str = attrValue.ToString(); } foreach (DERelationBizItem item2 in relListOfDEBizItem.RelationBizItems) { string str2 = ""; attrValue = item2.Relation.GetAttrValue(ConstAm.TDSBOM_ATTR_TSSTATUE); if (attrValue != null) { str2 = attrValue.ToString(); } if ((string.IsNullOrEmpty(str2) || (str2 == "未打印")) || ((str2 == "已取消") && isPowerPrintBomAll)) { item2.Relation.SetAttrValue(ConstAm.TDSBOM_ATTR_TSSTATUE, "已打印"); item2.Relation.SetAttrValue(ConstAm.TDSBOM_ATTR_PRINTER, ClientData.LogonUser.Name); item2.Relation.SetAttrValue(ConstAm.TDSBOM_ATTR_PRINTERTIME, DateTime.Now); if (!string.IsNullOrEmpty(sm)) { item2.Relation.SetAttrValue("FFSM", sm); } } } if (!string.IsNullOrEmpty(str)) { str = str + "\r\n 打印完成:" + sm; } else { str = str + " 打印完成:" + sm; } item.Iteration.SetAttrValue("FFSM", str); item.Iteration.SetAttrValue("PRINTER", ClientData.LogonUser.Name); item.Iteration.SetAttrValue("PRINTTIME", DateTime.Now); }
public static void SetLvwValues(Hashtable hsCols, ListView lvw, ArrayList lstOrd, DEBusinessItem item) { Hashtable hashtable = ConvertItem(hsCols, item); ListViewItem item2 = new ListViewItem { Tag = item }; int num = 0; foreach (string str in lstOrd) { if (lvw.Columns.ContainsKey(str)) { if (num == 0) { item2.Name = item2.Text = (hashtable[str] == null) ? "" : hashtable[str].ToString(); } else { item2.SubItems.Add((hashtable[str] == null) ? "" : hashtable[str].ToString()); } num++; } } lvw.Items.Add(item2); }
public static void EndSent(DEBusinessItem theItem, string mark, out StringBuilder strErr) { strErr = CheckSentRight(theItem, true); if (strErr.Length <= 0) { string attrValue = (theItem.Iteration.GetAttrValue("SM") == null) ? "" : theItem.Iteration.GetAttrValue("SM").ToString(); attrValue = attrValue + "\r\n收发结束:" + mark; theItem.Iteration.SetAttrValue("SM", attrValue); theItem.Iteration.SetAttrValue(ConstAm.SENT_ATTR_SENTSTATUS, "已收发"); ResetRealfsOfSent(theItem); if ((theItem.State == ItemState.CheckOut) && (theItem.Holder == ClientData.LogonUser.Oid)) { theItem.Iteration = PLItem.UpdateItemIteration(theItem.Iteration, ClientData.LogonUser.Oid, true, ClientData.UserGlobalOption); theItem = PLItem.Agent.CheckIn(theItem.MasterOid, theItem.ClassName, ClientData.LogonUser.Oid, "结束收发"); } else { theItem.Iteration = PLItem.UpdateItemIterationDirectly(theItem, ClientData.LogonUser.Oid, true, ClientData.UserGlobalOption, false); } theItem = PLItem.Agent.Release(theItem.MasterOid, theItem.ClassName, ClientData.LogonUser.Oid, "结束收发"); if (BizItemHandlerEvent.Instance.D_AfterReleased != null) { BizItemHandlerEvent.Instance.D_AfterReleased(BizOperationHelper.ConvertPLMBizItemDelegateParam(theItem)); } } }
public static void UpdateLvwValues(Hashtable hsCols, ListView lvw, ArrayList lstOrd, DEBusinessItem item) { Hashtable hashtable = ConvertItem(hsCols, item); List<string> list = new List<string> { "MOID", "ROID", "IROID" }; ListViewItem item2 = null; bool flag = false; foreach (ListViewItem item3 in lvw.Items) { DEBusinessItem tag = item3.Tag as DEBusinessItem; if (tag.MasterOid == item.MasterOid) { item2 = item3; flag = true; break; } } if (item2 == null) { item2 = new ListViewItem(); } item2.Tag = item; int num = 0; foreach (string str in lstOrd) { if (lvw.Columns.ContainsKey(str)) { if (num == 0) { item2.Text = item2.Name = (hashtable[str] == null) ? "" : hashtable[str].ToString(); } else if (!flag) { item2.SubItems.Add((hashtable[str] == null) ? "" : hashtable[str].ToString()); } else { item2.SubItems[lvw.Columns[str].Index].Text = (hashtable[str] == null) ? "" : hashtable[str].ToString(); } num++; } } if (!flag) { lvw.Items.Insert(0, item2); } }
public static DERelationBizItem GetRelItemById(string id, DEBusinessItem item, string relName) { DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(item, relName); foreach (DERelationBizItem item2 in relListOfDEBizItem.RelationBizItems) { if (item2.Id == id) { return item2; } } return null; }
internal DataSet GetSentResultForOutPut(DEBusinessItem item, string username) { DataSet set2; DBParameter dbParameter = DBUtil.GetDbParameter(false); try { dbParameter.Open(); DataSet sentResultForOutPut = new DaArchivManager(dbParameter).GetSentResultForOutPut(item.IterOid); if (sentResultForOutPut.Tables.Contains("FF")) { DataTable table = sentResultForOutPut.Tables["FF"]; sentResultForOutPut.Tables.Remove(table); if (table.Rows.Count > 0) { DataTable table2 = this.GetNewTableForOutPut(item, table, username); sentResultForOutPut.Tables.Add(table2); } } if (sentResultForOutPut.Tables.Contains("HS")) { DataTable table3 = sentResultForOutPut.Tables["HS"]; sentResultForOutPut.Tables.Remove(table3); if (table3.Rows.Count > 0) { DataTable table4 = this.GetNewTableForOutPut(item, table3, username); sentResultForOutPut.Tables.Add(table4); } } sentResultForOutPut.AcceptChanges(); set2 = sentResultForOutPut; } catch (Exception exception) { throw new PLMException("获取用于收发登记的收发帐明细失败", exception); } finally { dbParameter.Close(); } return set2; }
public static DERelationBizItemList GetRelListOfDEBizItem(DEBusinessItem item, string relName) { DERelationBizItemList relationBizItemList = item.Iteration.LinkRelationSet.GetRelationBizItemList(relName); if (relationBizItemList == null) { relationBizItemList = PLItem.Agent.GetLinkRelationItems(item.IterOid, item.ClassName, relName, ClientData.LogonUser.Oid, ClientData.UserGlobalOption); item.Iteration.LinkRelationSet.AddRelationList(relName, relationBizItemList); } return relationBizItemList; }
private void GetNewRowByUnit(DEBusinessItem item, DataTable tbOrg, bool isall, DataTable tbObj, string unit, string username) { string str = item.Iteration.GetAttrValue("TSTYPE").ToString(); string str2 = (item.Iteration.GetAttrValue("DOCCODE") == null) ? "" : item.Iteration.GetAttrValue("DOCCODE").ToString(); string str3 = (item.Iteration.GetAttrValue("DOCNAME") == null) ? "" : item.Iteration.GetAttrValue("DOCNAME").ToString(); string str4 = (item.Iteration.GetAttrValue("VERIT") == null) ? "" : item.Iteration.GetAttrValue("VERIT").ToString(); string str5 = (item.Iteration.GetAttrValue("WKFLINFO") == null) ? "" : item.Iteration.GetAttrValue("WKFLINFO").ToString(); if (string.IsNullOrEmpty(str2)) { str2 = str5; } if (isall) { DataRow rNew = tbObj.NewRow(); rNew["总图号"] = str2; this.ResetNewRowValue(rNew, tbOrg, unit, username); rNew["图号"] = ""; rNew["收发类型"] = str; if (tbObj.Columns.Contains("名称")) { rNew["名称"] = str3; } if (tbObj.Columns.Contains("版本")) { rNew["版本"] = str4; } if (tbObj.Columns.Contains("流程信息")) { rNew["流程信息"] = str5; } tbObj.Rows.Add(rNew); } else { this.ResetNewRowValue(tbObj, tbOrg, unit, str2, username); } }
public static bool IsUnSent(DEBusinessItem item, string unit) { DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(item, ConstAm.SENTBOM_RELCLS); foreach (DERelationBizItem item2 in relListOfDEBizItem.RelationBizItems) { bool flag = false; string getRelAttrValue = GetGetRelAttrValue(item2, ConstAm.SENTBOM_ATTR_FFDW); if (!string.IsNullOrEmpty(getRelAttrValue)) { ArrayList list2 = new ArrayList(getRelAttrValue.Split(new char[] { ';' })); foreach (string str2 in list2) { if (GetUnitName(str2) == unit) { flag = true; break; } } if (flag) { ArrayList list3; string str3 = GetAttrByUnit(GetGetRelAttrValue(item2, ConstAm.SENTBOM_ATTR_SENTSTATUS), unit, false, out list3, true); if (string.IsNullOrEmpty(str3) || (str3 == "未收发")) { return true; } } } } return false; }
private string GetTH(DEBusinessItem item) { string str = (item.Iteration.GetAttrValue("DOCCODE") == null) ? "" : item.Iteration.GetAttrValue("DOCCODE").ToString(); string str2 = (item.Iteration.GetAttrValue("WKFLINFO") == null) ? "" : item.Iteration.GetAttrValue("WKFLINFO").ToString(); if (string.IsNullOrEmpty(str)) { str = str2; } return str; }
public static void RePrint(DEBusinessItem item) { item.Iteration.SetAttrValue("TSSTATUS", "开始打印"); string attrValue = ""; object obj2 = item.Iteration.GetAttrValue("FFSM"); if (obj2 != null) { attrValue = obj2.ToString(); int index = attrValue.IndexOf("打印取消:"); if (index != -1) { attrValue = attrValue.Substring(0, index); item.Iteration.SetAttrValue("FFSM", attrValue); } } DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(item, ConstAm.TDSBOM_RELCLASS); foreach (DERelationBizItem item2 in relListOfDEBizItem.RelationBizItems) { item2.Relation.SetAttrValue(ConstAm.TDSBOM_ATTR_TSSTATUE, "未打印"); item2.Relation.SetAttrValue("FFSM", ""); } }
internal static void CommitWorkItem(DEBusinessItem item) { BPMProcessor processor = new BPMProcessor(); ArrayList processInstanceListByObject = processor.GetProcessInstanceListByObject(item.MasterOid, item.RevNum); if ((processInstanceListByObject != null) && (processInstanceListByObject.Count != 0)) { ArrayList list2 = new ArrayList(); DELProcessInsProperty property = null; foreach (DELProcessInsProperty property2 in processInstanceListByObject) { if (!(property2.State != "Running")) { property = property2; break; } } if (property != null) { DELBPMEntityList theActivityInstanceList = new DELBPMEntityList(); BPMClient client = new BPMClient(); processor.GetActivityInstancesList(item.Revision.Creator, property.ID, out theActivityInstanceList, false); foreach (DELActivityInstance instance in theActivityInstanceList) { DELBPMEntityList theWorkItemList = new DELBPMEntityList(); processor.GetWorkItemList(item.Revision.Creator, instance.ID, out theWorkItemList, false); if (instance.DState == "Activated") { foreach (DELWorkItem item2 in theWorkItemList) { if ((item2.State == "Running") || (item2.State == "Accepted")) { client.CompleteWorkItem(item2); } else if (item2.State == "Assigned") { client.CompleteWorkItem(item2); break; } } } } } } }
internal static void CancelSent(DEBusinessItem theItem, string mark) { DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(theItem, ConstAm.SENTBOM_RELCLS); foreach (DERelationBizItem item in relListOfDEBizItem.RelationBizItems) { CancelSent(item, mark); } relListOfDEBizItem = GetRelListOfDEBizItem(theItem, ConstAm.SENTRBOM_RELCLS); foreach (DERelationBizItem item in relListOfDEBizItem.RelationBizItems) { CancelSent(item, mark); } string attrValue = (theItem.Iteration.GetAttrValue("SM") == null) ? "" : theItem.Iteration.GetAttrValue("SM").ToString(); attrValue = attrValue + "\r\n取消收发:" + mark; theItem.Iteration.SetAttrValue("SM", attrValue); theItem.Iteration.SetAttrValue(ConstAm.SENT_ATTR_SENTSTATUS, "已取消"); if ((theItem.State == ItemState.CheckOut) && (theItem.Holder == ClientData.LogonUser.Oid)) { theItem.Iteration = PLItem.UpdateItemIteration(theItem.Iteration, ClientData.LogonUser.Oid, true, ClientData.UserGlobalOption); theItem = PLItem.Agent.CheckIn(theItem.MasterOid, theItem.ClassName, ClientData.LogonUser.Oid, "取消收发"); } else { theItem.Iteration = PLItem.UpdateItemIterationDirectly(theItem, ClientData.LogonUser.Oid, true, ClientData.UserGlobalOption, false); } }
internal static void CheckPrintItem(DEBusinessItem item, out int iEnd, out int iUndo, out int iCancel) { iEnd = 0; iUndo = 0; iCancel = 0; DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(item, ConstAm.TDSBOM_RELCLASS); foreach (DERelationBizItem item2 in relListOfDEBizItem.RelationBizItems) { string str = ""; object attrValue = item2.Relation.GetAttrValue(ConstAm.TDSBOM_ATTR_TSSTATUE); if (attrValue != null) { str = attrValue.ToString(); } if (str == "未打印") { iUndo++; } if (str == "已打印") { iEnd++; } if (str == "已取消") { iCancel++; } } }
public static void CancelPrint(DEBusinessItem item, string sm) { item.Iteration.SetAttrValue("TSSTATUS", "打印取消"); string str = ""; object attrValue = item.Iteration.GetAttrValue("FFSM"); if (attrValue != null) { str = attrValue.ToString(); } if (!string.IsNullOrEmpty(str)) { str = str + "\r\n 打印取消:" + (string.IsNullOrEmpty(sm) ? ("(" + ClientData.LogonUser.Name + ")") : sm); } else { str = str + " 打印取消:" + (string.IsNullOrEmpty(sm) ? ("(" + ClientData.LogonUser.Name + ")") : sm); } item.Iteration.SetAttrValue("FFSM", str); DERelationBizItemList relListOfDEBizItem = GetRelListOfDEBizItem(item, ConstAm.TDSBOM_RELCLASS); foreach (DERelationBizItem item2 in relListOfDEBizItem.RelationBizItems) { if (GetTsStatue(item2) != "已取消") { item2.Relation.SetAttrValue(ConstAm.TDSBOM_ATTR_TSSTATUE, "已取消"); if (!string.IsNullOrEmpty(sm)) { item2.Relation.SetAttrValue("FFSM", sm); } } } }