public Trainjiaolu_Out GetTrainnosOfTrainjiaolu(string data) { Trainjiaolu_Out json = new Trainjiaolu_Out(); TrainJiaolu_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <TrainJiaolu_In>(data); try { TF.RunSafty.BLL.VIEW_Base_TrainNo bllPlace = new TF.RunSafty.BLL.VIEW_Base_TrainNo(); List <TF.RunSafty.Model.VIEW_Base_TrainNo> placeList = bllPlace.GetTrainnosByTrainJiaolu(input.trainjiaoluID); json.result = "0"; json.resultStr = "提交成功"; json.data = bllPlace.GetPlaceList(placeList); } catch (Exception ex) { TF.CommonUtility.LogClass.logex(ex, ""); json.result = "1"; json.resultStr = "提交失败" + ex.Message; } return(json); }
public override string QueryResult() { JsonModel jsonModel = new JsonModel(); try { ParamModel paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <ParamModel>(this.Data); TF.RunSafty.BLL.VIEW_Base_TrainNo bllPlace = new TF.RunSafty.BLL.VIEW_Base_TrainNo(); List <TF.RunSafty.Model.VIEW_Base_TrainNo> placeList = bllPlace.GetTrainnosByID(paramModel.data.trainnoID); jsonModel.result = 0; jsonModel.returnStr = "提交成功"; jsonModel.data = bllPlace.GetPlaceList(placeList)[0]; } catch (Exception ex) { TF.CommonUtility.LogClass.logex(ex, ""); jsonModel.result = 1; jsonModel.returnStr = "提交失败" + 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)); }