コード例 #1
0
    public override string QueryResult()
    {
        JsonModel jsonModel = new JsonModel();

        try
        {
            ParamModel paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <ParamModel>(this.Data);
            TF.RunSafty.BLL.Tab_Plan_Rest          bllPlace  = new TF.RunSafty.BLL.Tab_Plan_Rest();
            List <TF.RunSafty.Model.TAB_Plan_Rest> placeList = bllPlace.GetPlanTrain(paramModel.data.dtStartTime, paramModel.data.dtEndTime, paramModel.data.strJiaoluGUID);
            jsonModel.result    = 0;
            jsonModel.resultStr = "提交成功";
            planArrays p = new planArrays();
            jsonModel.data       = p;
            p.strTrainJiaoLuGUID = paramModel.data.strJiaoluGUID;
            p.strCurPlanGUID     = "";
            p.planArray          = bllPlace.GetPlaceList(placeList);
        }
        catch (Exception ex)
        {
            TF.CommonUtility.LogClass.logex(ex, "");
            jsonModel.result    = 1;
            jsonModel.resultStr = "提交失败" + ex.Message;
        }
        Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter();
        //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式
        timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
        return(Newtonsoft.Json.JsonConvert.SerializeObject(jsonModel, timeConverter));
    }
コード例 #2
0
        public JsonModel Getsignplanlist(string input)
        {
            JsonModel jsonModel = new JsonModel();

            try
            {
                ParamModel             paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <ParamModel>(input);
                Bll_Plan_Rest          bllPlace   = new Bll_Plan_Rest();
                List <Modal_Plan_Rest> placeList  = bllPlace.GetPlanTrain(paramModel.dtStartTime, paramModel.dtEndTime, paramModel.strJiaoluGUID);
                jsonModel.result    = 0;
                jsonModel.resultStr = "提交成功";
                planArrays p = new planArrays();
                jsonModel.data       = p;
                p.strTrainJiaoLuGUID = paramModel.strJiaoluGUID;
                p.strCurPlanGUID     = "";
                p.planArray          = bllPlace.GetPlaceList(placeList);
            }
            catch (Exception ex)
            {
                TF.CommonUtility.LogClass.logex(ex, "");
                jsonModel.result    = 1;
                jsonModel.resultStr = "提交失败" + ex.Message;
            }
            Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter();
            //这里使用自定义日期格式,如果不使用的话,默认是ISO8601格式
            timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm:ss";
            return(jsonModel);
        }