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)); }
public Find_Out GetTrainnoByID(string data) { Find_Out json = new Find_Out(); Find_In input = Newtonsoft.Json.JsonConvert.DeserializeObject <Find_In>(data); try { TF.RunSafty.BLL.VIEW_Base_TrainNo bllPlace = new TF.RunSafty.BLL.VIEW_Base_TrainNo(); List <TF.RunSafty.Model.VIEW_Base_TrainNo> list = bllPlace.GetTrainnosByID(input.trainnoID); json.result = "0"; json.resultStr = "提交成功"; if (list != null && list.Count > 0) { json.data = GetTrainNo(list[0]); } } catch (Exception ex) { TF.CommonUtility.LogClass.logex(ex, ""); json.result = "1"; json.resultStr = "提交失败" + ex.Message; } return(json); }