public override string QueryResult()
        {
            JsonModel jsonModel = new JsonModel();

            TF.RunSafty.BLL.TAB_MsgCallWork bllCallWork = new TF.RunSafty.BLL.TAB_MsgCallWork();
            TF.Api.Utilities.Validation     validater   = new TF.Api.Utilities.Validation();
            try
            {
                pCallWork paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <pCallWork>(this.Data);
                //验证数据正确性,非空字段不能为空
                if (validater.IsNotNullPropertiesValidated(paramModel.data))
                {
                    TF.RunSafty.Model.TAB_MsgCallWork work = new TAB_MsgCallWork();

                    work.strTrainmanGUID   = paramModel.data.strTrainmanGUID;
                    work.strPlanGUID       = paramModel.data.strPlanGUID;
                    work.strSendMsgContent = paramModel.data.strMsgContent;
                    work.dtCallTime        = DateTime.Parse(paramModel.data.dtCreateTime);
                    work.strMsgGUID        = paramModel.data.strMsgGUID;
                    work.eCallType         = paramModel.data.eCallType;
                    work.strRecvUser       = paramModel.data.strRecvUser;
                    work.dtRecvTime        = paramModel.data.dtRecvTime;
                    work.strSendUser       = paramModel.data.strSendUser;
                    work.dtSendTime        = paramModel.data.dtSendTime;


                    work.nCallTimes = 0;
                    work.nRecvCount = 0;
                    work.nSendCount = 0;
                    work.eCallState = 1;
                    bllCallWork.Add(work);

                    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 NeedCallWork_Out SubmitNeededCallWork(string input)
        {
            NeedCallWork_Out jsonModel = new NeedCallWork_Out();

            TF.RunSafty.BLL.TAB_MsgCallWork bllCallWork = new TF.RunSafty.BLL.TAB_MsgCallWork();
            TF.Api.Utilities.Validation     validater   = new TF.Api.Utilities.Validation();
            try
            {
                NeedCallWork_In paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <NeedCallWork_In>(input);
                //验证数据正确性,非空字段不能为空
                if (validater.IsNotNullPropertiesValidated(paramModel.data))
                {
                    TF.RunSafty.Model.TAB_MsgCallWork work = new TF.RunSafty.Model.TAB_MsgCallWork();

                    work.strTrainmanGUID   = paramModel.data.strTrainmanGUID;
                    work.strPlanGUID       = paramModel.data.strPlanGUID;
                    work.strSendMsgContent = paramModel.data.strMsgContent;
                    work.dtCallTime        = DateTime.Parse(paramModel.data.dtCreateTime);
                    //work.strGUID = "";//paramModel.data.strMsgGUID;
                    work.nCallTimes = 0;
                    work.nRecvCount = 0;
                    work.nSendCount = 0;
                    //work.nState = 1;
                    bllCallWork.Add(work);

                    jsonModel.result    = 0;
                    jsonModel.resultStr = "提交成功";
                }
            }
            catch (Exception ex)
            {
                TF.CommonUtility.LogClass.logex(ex, "");
                jsonModel.result    = 1;
                jsonModel.resultStr = "提交失败" + ex.Message;
            }
            return(jsonModel);
        }