public void Edit(dynamic data) { dynamic insert_list = data.list.inserted; if (data.list.inserted.ToString() != "[]") { var PlanCode = MmsHelper.GetOrderNumber("SYS_DrawingApplication", "RequestCode", "TZSQ", "", ""); string PreCode = PlanCode.Substring(0, PlanCode.Length - 3); int StartNumber = Convert.ToInt32(PlanCode.Substring(PlanCode.Length - 3)); foreach (dynamic item in data.list.inserted) { item["RequestCode"] = PreCode + StartNumber.ToString().PadLeft(3, '0'); StartNumber++; } } var listWrapper = RequestWrapper.Instance().LoadSettingXmlString(@" <settings> <table> SYS_DrawingApplication </table> <where> <field name='ID' cp='equal'></field> </where> </settings>"); var service = new SYS_DrawingApplicationService(); var result = service.Edit(null, listWrapper, data); }
public dynamic Get(RequestWrapper query) { query.LoadSettingXmlString(@" <settings defaultOrderBy='CreateTime desc'> <select>*</select> <from>SYS_DrawingApplication</from> <where defaultForAll='true' defaultCp='equal' defaultIgnoreEmpty='true'> <field name='RequestCode' cp='like'></field> <field name='ContractCode' cp='like'></field> <field name='ProductName' cp='like'></field> <field name='FigureCode' cp='like'></field> <field name='RequestStatus' cp='equal'></field> </where> </settings>"); var service = new SYS_DrawingApplicationService(); var pQuery = query.ToParamQuery(); var result = service.GetDynamicListWithPaging(pQuery); return(result); }