public Sync_Out RecordSync(string input) { Sync_Out model = new Sync_Out(); DataTable table = null; DataTable tblFile = null; Sync_In param = Newtonsoft.Json.JsonConvert.DeserializeObject <Sync_In>(input); //this.clientid = param.cid; TF.RunSafty.BLL.TAB_FileGroup bllFileGroup = new TF.RunSafty.BLL.TAB_FileGroup(); TF.RunSafty.BLL.TAB_ReadDoc bllFile = new TF.RunSafty.BLL.TAB_ReadDoc(); try { table = bllFileGroup.GetAllList().Tables[0]; tblFile = bllFile.GetAllListWithFileType(param.cid).Tables[0]; model.result = "0"; model.returnStr = "返回成功"; model.TypeList = table; model.FileList = tblFile; } catch (Exception ex) { TF.CommonUtility.LogClass.logex(ex, ""); model.result = "1"; model.returnStr = "提交失败:" + ex.Message; } return(model); }
public override string QueryResult() { JsonModel model = new JsonModel(); ParamModel p = new ParamModel(); DataTable table = null; DataTable tblFile = null; ParamModel param = Newtonsoft.Json.JsonConvert.DeserializeObject <ParamModel>(this.Data); this.clientid = param.cid; TF.RunSafty.BLL.TAB_FileGroup bllFileGroup = new TF.RunSafty.BLL.TAB_FileGroup(); TF.RunSafty.BLL.TAB_ReadDoc bllFile = new TF.RunSafty.BLL.TAB_ReadDoc(); try { table = bllFileGroup.GetAllList().Tables[0]; tblFile = bllFile.GetAllListWithFileType(clientid).Tables[0]; model.result = "0"; model.returnStr = "返回成功"; model.TypeList = table; model.FileList = tblFile; } catch (Exception ex) { TF.CommonUtility.LogClass.logex(ex, ""); } Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; string result = Newtonsoft.Json.JsonConvert.SerializeObject(model, timeConverter).Replace(":null", ":\"\""); return(result); }
public override string QueryResult() { JsonModel model = new JsonModel(); DataTable table = null; JsonData data = new JsonData(); List <TypeList> typeList = new List <TypeList>(); data.data = new InnerData(); data.data.TypeList = typeList; DataTable tblReading = null; ParamModel param = Newtonsoft.Json.JsonConvert.DeserializeObject <ParamModel>(this.Data); TF.RunSafty.BLL.TAB_FileGroup bllGroup = new TF.RunSafty.BLL.TAB_FileGroup(); TF.RunSafty.BLL.TAB_ReadDocPlan bllPlan = new TF.RunSafty.BLL.TAB_ReadDocPlan(); try { string where = string.Format(" strTypeName='{0}'", "记名式传达"); table = bllGroup.GetList(where).Tables[0]; //table = bllGroup.GetAllList().Tables[0]; if (table != null) { foreach (DataRow row in table.Rows) { TypeList list = new TypeList(); list.strTypeGUID = row["strTypeGUID"].ToString(); list.strTypeName = row["strTypeName"].ToString(); tblReading = bllPlan.GetReadingHistoryOfTrainman(param.strTrainmanGUID, list.strTypeGUID); list.FileList = tblReading; typeList.Add(list); } } model.result = "0"; model.returnStr = "返回成功"; model.Data = data; } catch (Exception ex) { TF.CommonUtility.LogClass.logex(ex, ""); } Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter(); //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式 timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss"; string result = Newtonsoft.Json.JsonConvert.SerializeObject(model, timeConverter).Replace(":null", ":\"\""); return(result); }
public Record_Out GetReadingRecord(string input) { Record_Out model = new Record_Out(); DataTable table = null; JsonData data = new JsonData(); List <TypeList> typeList = new List <TypeList>(); data.data = new InnerData(); data.data.TypeList = typeList; DataTable tblReading = null; Record_In param = Newtonsoft.Json.JsonConvert.DeserializeObject <Record_In>(input); TF.RunSafty.BLL.TAB_FileGroup bllGroup = new TF.RunSafty.BLL.TAB_FileGroup(); TF.RunSafty.BLL.TAB_ReadDocPlan bllPlan = new TF.RunSafty.BLL.TAB_ReadDocPlan(); try { table = bllGroup.GetAllList().Tables[0]; if (table != null) { foreach (DataRow row in table.Rows) { TypeList list = new TypeList(); list.strTypeGUID = row["strTypeGUID"].ToString(); list.strTypeName = row["strTypeName"].ToString(); tblReading = bllPlan.GetReadingHistoryOfTrainman(param.strTrainmanGUID, list.strTypeGUID); list.FileList = tblReading; typeList.Add(list); } } model.result = "0"; model.returnStr = "返回成功"; model.Data = data; } catch (Exception ex) { TF.CommonUtility.LogClass.logex(ex, ""); model.result = "1"; model.returnStr = "提交失败:" + ex.Message; } return(model); }