public string Modifysignplan(string input) { EditTrainplanJsonModel jsonModel = new EditTrainplanJsonModel(); TF.Api.Utilities.Validation validater = new TF.Api.Utilities.Validation(); try { PlanRestModels paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <PlanRestModels>(input); //验证数据正确性,非空字段不能为空 if (validater.IsNotNullPropertiesValidated(paramModel)) { Bll_Plan_Rest bllPlace = new Bll_Plan_Rest(); if (bllPlace.UpdateByParamModel(paramModel, "")) { jsonModel.result = 0; jsonModel.resultStr = "返回成功"; } else { jsonModel.result = 2; jsonModel.resultStr = "返回失败"; } } } catch (Exception ex) { TF.CommonUtility.LogClass.logex(ex, ""); jsonModel.result = 1; jsonModel.resultStr = "提交失败" + ex.Message; } string result = Newtonsoft.Json.JsonConvert.SerializeObject(jsonModel); return(result); }
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); }
public string Getsignplanlistbyjiaoluary(string input) { OutJsonModel jsonModel = new OutJsonModel(); try { TrainmanData paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <TrainmanData>(input); Bll_Plan_Rest bllPlace = new Bll_Plan_Rest(); string strJiaoLu = ""; foreach (JiaoLu JiaoLuId in paramModel.JiaoLuAry) { strJiaoLu += "'" + JiaoLuId.strTrainJiaoLuGUID + "',"; } strJiaoLu = strJiaoLu.Substring(0, strJiaoLu.Length - 1); List <Modal_Plan_Rest> placeList = bllPlace.GetPlanListByTimeAndWorkShop(strJiaoLu, paramModel.dtStartTime, paramModel.dtEndTime); jsonModel.result = 0; jsonModel.resultStr = "提交成功"; ArrayName an = new ArrayName(); jsonModel.data = an; an.signplanary = 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)); }