public override void EndOperationTransaction(BOS.Core.DynamicForm.PlugIn.Args.EndOperationTransactionArgs e) { foreach (DynamicObject item in e.DataEntitys) { string formId = ""; if (item != null) { // formId = Convert.ToString(item["PAEZ_ICMO_Entry_Sales"]); DynamicObjectCollection detailsForContract = null; detailsForContract = item["PAEZ_ICMO_Entry_Sales"] as DynamicObjectCollection; //if (item["PAEZ_ICMO_Entry_Sales"]) foreach (DynamicObject ContractObj in detailsForContract) { ContractIDList.Add(Convert.ToString(ContractObj["F_PAEZ_ICContractNo"])); } //if (formId == "PAEZ_ICContract") //{ // ContractIDList.Add(Convert.ToString(item["FID"])); string SQLfilterSelect = string.Format(@"select FID from F_PAEZ_ICContract WHERE F_PAEZ_ICContractNo IN ({0})", string.Join(",", ContractIDList)); using (IDataReader rd = DBUtils.ExecuteReader(this.Context, SQLfilterSelect)) { while (rd.Read()) { lotIds.Add(rd.GetInt32(0)); } } string SQLfilter = string.Format(@"UPDATE F_PAEZ_ICContract SET FBILLSTATUS = 5 WHERE FID IN ({0})", string.Join(",", lotIds)); DBUtils.Execute(this.Context, SQLfilter); } } //DynamicObjectCollection detailsForContract = null; //detailsForContract = item["PAEZ_ICMO"] as DynamicObjectCollection; }
public override void EndOperationTransaction(BOS.Core.DynamicForm.PlugIn.Args.EndOperationTransactionArgs e) { lotIds.Clear(); List <SqlObject> sqlList = new List <SqlObject>(); foreach (var item in e.DataEntitys) { string formId = ""; if (item.DynamicObjectType.Name.Equals("InvInit")) { formId = "STK_InvInit"; } else { formId = item["FFormId"].ToString(); } DynamicObjectCollection details = null; switch (formId) { case "STK_MISCELLANEOUS": details = item["STK_MISCELLANEOUSENTRY"] as DynamicObjectCollection; break; case "STK_InStock": details = item["InStockEntry"] as DynamicObjectCollection; break; case "SP_InStock": details = item["Entity"] as DynamicObjectCollection; break; case "STK_OEMInStock": details = item["OEMInStockEntry"] as DynamicObjectCollection; break; case "STK_InitInStock": details = item["InitInStockEntry"] as DynamicObjectCollection; break; case "STK_InvInit": details = item["InvInitDetail"] as DynamicObjectCollection; break; default: break; } if (details == null) { return; } foreach (var entryItem in details) { Object lotObj = entryItem["LOT"]; if (null != lotObj && Convert.ToInt16((lotObj as DynamicObject)["BizType"]) == 1) { sqlList.Add(this.getSqlParams(formId, entryItem, item)); } } } if (sqlList.Count > 0 && lotIds.Count > 0) { DBUtils.ExecuteBatch(this.Context, sqlList); string filter = string.Format("FLOTID IN ({0})", string.Join(",", lotIds)); OQLFilter of = OQLFilter.CreateHeadEntityFilter(filter); DynamicObject[] lotMasters = BusinessDataServiceHelper.Load(this.Context, "BD_BatchMainFile", null, of); ISaveService service = Kingdee.BOS.App.ServiceHelper.GetService <ISaveService>(); service.Save(this.Context, lotMasters); } }