Exemplo n.º 1
0
        public OutputParam CalcWorkTime(string data)
        {
            InputParam  inputParam = Newtonsoft.Json.JsonConvert.DeserializeObject <InputParam>(data);
            OutputParam result     = new OutputParam();

            try
            {
                DBWorkTime dbWorkTime = new DBWorkTime();
                dbWorkTime.CalcWorkTime(inputParam.TrainPlanGUID);
            }
            catch (Exception ex)
            {
                result.result    = "1";
                result.resultStr = ex.Message.ToString();
            }

            return(result);
        }
Exemplo n.º 2
0
        public OutputParam GetWorkTime(string data)
        {
            InputParam     inputParam     = Newtonsoft.Json.JsonConvert.DeserializeObject <InputParam>(data);
            OutputParam    result         = new OutputParam();
            OutputWorkTime outputWorkTime = new OutputWorkTime();

            try
            {
                result.data = outputWorkTime;

                DBWorkTime dbWorkTime = new DBWorkTime();
                outputWorkTime.workTime = dbWorkTime.GetWorkTime(inputParam.TrainPlanGUID);
                outputWorkTime.bExist   = outputWorkTime.workTime != null;
            }
            catch (Exception ex)
            {
                result.result    = "1";
                result.resultStr = ex.Message.ToString();
            }

            return(result);
        }