public string UpdateEntityXML(string Formid, string OldString, string ReplaceString) { try { TravelReimbursementBLL bll=new TravelReimbursementBLL(); ReplaceString = (from ent in bll.dal.GetObjects() where ent.TRAVELREIMBURSEMENTID == Formid select ent.NOBUDGETCLAIMS).FirstOrDefault(); if (string.IsNullOrEmpty(ReplaceString)) { Tracer.Debug("出差报销提交审核替换元数据单号,获取的单号为空:" + ReplaceString); return ""; } //更新元数据里的报销单号 SMT.SaaS.BLLCommonServices.FlowWFService.ServiceClient client = new SaaS.BLLCommonServices.FlowWFService.ServiceClient(); Tracer.Debug("开始调用元数据获取接口:FlowWFService.GetMetadataByFormid(" + Formid + ")"); string xml = string.Empty; xml = client.GetMetadataByFormid(Formid); Tracer.Debug("获取到的元数据:" + xml); xml = xml.Replace("自动生成", ReplaceString); Tracer.Debug("替换单号后的XML:" + xml); bool flag = client.UpdateMetadataByFormid(Formid, xml); if (flag) { Tracer.Debug("出差报销元数据替换单号成功:" + ReplaceString); return ""; } else { Tracer.Debug("出差报销元数据替换单号UpdateMetadataByFormid返回false:Formid:" + Formid + OldString + ReplaceString); return ""; } } catch (Exception ex) { Tracer.Debug(ex.ToString()); return ""; } }
public string UpdateEntityXML(string Formid, string OldString, string ReplaceString) { try { TravelReimbursementBLL bll = new TravelReimbursementBLL(); ReplaceString = (from ent in bll.dal.GetObjects() where ent.TRAVELREIMBURSEMENTID == Formid select ent.NOBUDGETCLAIMS).FirstOrDefault(); if (string.IsNullOrEmpty(ReplaceString)) { Tracer.Debug("出差报销提交审核替换元数据单号,获取的单号为空:" + ReplaceString); return(""); } //更新元数据里的报销单号 SMT.SaaS.BLLCommonServices.FlowWFService.ServiceClient client = new SaaS.BLLCommonServices.FlowWFService.ServiceClient(); Tracer.Debug("开始调用元数据获取接口:FlowWFService.GetMetadataByFormid(" + Formid + ")"); string xml = string.Empty; xml = client.GetMetadataByFormid(Formid); Tracer.Debug("获取到的元数据:" + xml); xml = xml.Replace("自动生成", ReplaceString); Tracer.Debug("替换单号后的XML:" + xml); bool flag = client.UpdateMetadataByFormid(Formid, xml); if (flag) { Tracer.Debug("出差报销元数据替换单号成功:" + ReplaceString); return(""); } else { Tracer.Debug("出差报销元数据替换单号UpdateMetadataByFormid返回false:Formid:" + Formid + OldString + ReplaceString); return(""); } } catch (Exception ex) { Tracer.Debug(ex.ToString()); return(""); } }
public static void AddAutoOrderCode(EntityObject entity) { string tablename = GetTableName(entity); T_FB_ORDERCODE orderCode = listOrderCode.FirstOrDefault(item => { return item.TABLENAME == tablename; }); if (orderCode == null) { Tracer.Debug("生成编号失败:在T_FB_ORDERCODE表中未找到此表配置项目:" + tablename); return; } //string code = GetOrderCode(orderCode);张秉福旧方法 //新方法 string code = string.Empty; using (OrderCodeBLL bll = new OrderCodeBLL()) { code = bll.GetAutoOrderCode(tablename); } string codePropertyName = orderCode.FIELDNAME; entity.SetValue(codePropertyName, code); //开始更新元数据单号 string Formid = string.Empty; Tracer.Debug("开始更新元数据:"+tablename); try { switch (tablename) { case "T_FB_TRAVELEXPAPPLYMASTER": //T_FB_TRAVELEXPAPPLYMASTER item = (T_FB_TRAVELEXPAPPLYMASTER)entity; //Formid = item.T_FB_EXTENSIONALORDER.ORDERID; //出差报销在OA中出差报销审核的业务逻辑中处理 break; default: Formid =entity.EntityKey.EntityKeyValues[0].Value.ToString(); SMT.SaaS.BLLCommonServices.FlowWFService.ServiceClient client = new SaaS.BLLCommonServices.FlowWFService.ServiceClient(); Tracer.Debug("开始调用元数据获取接口:FlowWFService.GetMetadataByFormid("+Formid+")"); string xml=string.Empty; xml=client.GetMetadataByFormid(Formid); if (string.IsNullOrEmpty(xml)) { Tracer.Debug("XML元数据为空,跳过:" + xml); break; } Tracer.Debug("获取到的元数据:"+xml); xml=xml.Replace("自动生成", code); Tracer.Debug("替换单号后的XML:"+xml); client.UpdateMetadataByFormid(Formid, xml); break; } } catch (Exception ex) { Tracer.Debug(ex.ToString()); } }
public static void AddAutoOrderCode(EntityObject entity) { string tablename = GetTableName(entity); T_FB_ORDERCODE orderCode = listOrderCode.FirstOrDefault(item => { return(item.TABLENAME == tablename); }); if (orderCode == null) { Tracer.Debug("生成编号失败:在T_FB_ORDERCODE表中未找到此表配置项目:" + tablename); return; } //string code = GetOrderCode(orderCode);张秉福旧方法 //新方法 string code = string.Empty; using (OrderCodeBLL bll = new OrderCodeBLL()) { code = bll.GetAutoOrderCode(tablename); } string codePropertyName = orderCode.FIELDNAME; entity.SetValue(codePropertyName, code); //开始更新元数据单号 string Formid = string.Empty; Tracer.Debug("开始更新元数据:" + tablename); try { switch (tablename) { case "T_FB_TRAVELEXPAPPLYMASTER": //T_FB_TRAVELEXPAPPLYMASTER item = (T_FB_TRAVELEXPAPPLYMASTER)entity; //Formid = item.T_FB_EXTENSIONALORDER.ORDERID; //出差报销在OA中出差报销审核的业务逻辑中处理 break; default: Formid = entity.EntityKey.EntityKeyValues[0].Value.ToString(); SMT.SaaS.BLLCommonServices.FlowWFService.ServiceClient client = new SaaS.BLLCommonServices.FlowWFService.ServiceClient(); Tracer.Debug("开始调用元数据获取接口:FlowWFService.GetMetadataByFormid(" + Formid + ")"); string xml = string.Empty; xml = client.GetMetadataByFormid(Formid); if (string.IsNullOrEmpty(xml)) { Tracer.Debug("XML元数据为空,跳过:" + xml); break; } Tracer.Debug("获取到的元数据:" + xml); xml = xml.Replace("自动生成", code); Tracer.Debug("替换单号后的XML:" + xml); client.UpdateMetadataByFormid(Formid, xml); break; } } catch (Exception ex) { Tracer.Debug(ex.ToString()); } }