Пример #1
0
        public OutAddSignPlan Addsignplan(string input)
        {
            OutAddSignPlan jsonModel = new OutAddSignPlan();

            TF.Api.Utilities.Validation validater = new TF.Api.Utilities.Validation();
            try
            {
                TF.RunSafty.Model.InterfaceModel.PlanSign paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <TF.RunSafty.Model.InterfaceModel.PlanSign>(input);
                //验证数据正确性,非空字段不能为空

                AddPlanSign     bllSignPlan = new AddPlanSign();
                Modal_Plan_Rest PlanSign    = new Modal_Plan_Rest();
                DataAddSignPlan t           = new DataAddSignPlan();
                if (bllSignPlan.AddByParamModel(paramModel, PlanSign) != 0)
                {
                    t.SignPlanGUID      = PlanSign.strGUID;
                    jsonModel.result    = 0;
                    jsonModel.resultStr = "返回成功";
                    jsonModel.data      = t;
                }
            }
            catch (Exception ex)
            {
                TF.CommonUtility.LogClass.logex(ex, "");
                jsonModel.result    = 1;
                jsonModel.resultStr = "提交失败" + ex.Message;
            }
            return(jsonModel);
        }
Пример #2
0
        public string Delsignplan(string input)
        {
            DelJsonModel jsonModel = new DelJsonModel();

            TF.Api.Utilities.Validation validater = new TF.Api.Utilities.Validation();
            try
            {
                DelSinPlan paramModel = Newtonsoft.Json.JsonConvert.DeserializeObject <DelSinPlan>(input);

                AddPlanSign     bllSignPlan = new AddPlanSign();
                Modal_Plan_Rest PlanSign    = new Modal_Plan_Rest();
                strSignPlans    t           = new strSignPlans();
                if (bllSignPlan.DelParamModel(paramModel.strGUID) != 0)
                {
                    t.strSignPlan       = "删除成功";
                    jsonModel.result    = 0;
                    jsonModel.resultStr = "返回成功";
                    jsonModel.data      = t;
                }
            }
            catch (Exception ex)
            {
                TF.CommonUtility.LogClass.logex(ex, "");
                jsonModel.result    = 1;
                jsonModel.resultStr = "提交失败" + ex.Message;
            }
            string result = Newtonsoft.Json.JsonConvert.SerializeObject(jsonModel);

            return(result);
        }