Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }