Example #1
0
        public Get_OutDeleteRunEvent DeleteRunEvent(string data)
        {
            Get_OutDeleteRunEvent json = new Get_OutDeleteRunEvent();

            try
            {
                Get_InDeleteRunEvent input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InDeleteRunEvent>(data);
                DBRunEvent           db    = new DBRunEvent();
                int i = db.DeleteRunEvent(input.EventGUID);
                if (i == 0)
                {
                    json.result    = "1";
                    json.resultStr = "删除失败!未找到该条记录!";
                }
                else
                {
                    json.result    = "0";
                    json.resultStr = "返回成功,共删除" + i + "条数据!";
                }
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Example #2
0
        public Get_OutComputeWorkTime ComputeWorkTime(string data)
        {
            Get_OutComputeWorkTime json = new Get_OutComputeWorkTime();

            try
            {
                Get_InComputeWorkTime input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InComputeWorkTime>(data);
                DBRunEvent            db    = new DBRunEvent();
                int i = db.ComputeWorkTime(input.strTrainPlanGUID);
                if (i != 0)
                {
                    json.result    = "0";
                    json.resultStr = "执行成功!";
                }
                else
                {
                    json.result    = "1";
                    json.resultStr = "执行失败!";
                }
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }
Example #3
0
        public Get_OutGetPlanRunEvents GetPlanRunEvents(string data)
        {
            Get_OutGetPlanRunEvents json = new Get_OutGetPlanRunEvents();

            try
            {
                Get_InGetPlanRunEvents input = Newtonsoft.Json.JsonConvert.DeserializeObject <Get_InGetPlanRunEvents>(data);
                DBRunEvent             db    = new DBRunEvent();
                RunEventResult         RE    = new RunEventResult();
                RE.eventArray  = db.GetPlanRunEvents(input.TrainPlanGUID);
                json.data      = RE;
                json.result    = "0";
                json.resultStr = "返回成功";
            }
            catch (Exception ex)
            {
                json.result    = "1";
                json.resultStr = "提交失败:" + ex.Message;
            }
            return(json);
        }