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

            try
            {
                ParamModel paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <ParamModel>(this.Data);
                TF.RunSafty.Model.TAB_Base_TrainNo train = new TF.RunSafty.Model.TAB_Base_TrainNo();
                TF.RunSafty.BLL.TAB_Base_TrainNo   bllTrain = new TF.RunSafty.BLL.TAB_Base_TrainNo();
                DateTime dtBegin, dtEnd;
                string   strTrainjiao = paramModel.data.trainjiaoluID;
                dtBegin = DateTime.Parse(paramModel.data.beginTime);
                dtEnd   = DateTime.Parse(paramModel.data.endTime);
                int PlanState = paramModel.data.planState <= 0 ? 1 : paramModel.data.planState;

                bllTrain.GetTrainnoByTime(strTrainjiao, dtBegin, dtEnd, PlanState);
                jsonModel.result    = 0;
                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);
        }
コード例 #2
0
        public LoadTrainnos_Out LoadTrainnos(string data)
        {
            LoadTrainnos_Out json  = new LoadTrainnos_Out();
            LoadTrainnos_In  input = Newtonsoft.Json.JsonConvert.DeserializeObject <LoadTrainnos_In>(data);

            try
            {
                TF.RunSafty.BLL.TAB_Base_TrainNo bllTrain = new TF.RunSafty.BLL.TAB_Base_TrainNo();
                DateTime dtBegin, dtEnd;
                string   strTrainjiao = input.trainjiaoluID;
                dtBegin = DateTime.Parse(input.beginTime);
                dtEnd   = DateTime.Parse(input.endTime);
                int PlanState = input.planState <= 0 ? 1 : input.planState;

                bllTrain.GetTrainnoByTime(strTrainjiao, dtBegin, dtEnd, PlanState);
                json.result    = 0;
                json.resultStr = "返回成功";
            }
            catch (Exception ex)
            {
                TF.CommonUtility.LogClass.logex(ex, "");
                json.result    = 1;
                json.resultStr = "提交失败" + ex.Message;
            }
            return(json);
        }