Ejemplo n.º 1
0
        /// <summary>
        /// 保存打印记录
        /// </summary>
        /// <param name="print"></param>
        public void SavePrintData(printModel print, string cid)
        {
            TF.RunSafty.Model.Tab_DeliverJSPrint modelPlan = new TF.RunSafty.Model.Tab_DeliverJSPrint();
            modelPlan.StrPlanGUID     = print.strPlanGUID;
            modelPlan.StrSiteGUID     = cid;
            modelPlan.StrTrainmanGUID = print.strTrainmanGUID;
            string   strPrintTime = print.dtPrintTime;
            DateTime dtPrint;

            if (DateTime.TryParse(strPrintTime, out dtPrint))
            {
                modelPlan.dtPrintTime = dtPrint;
            }
            bllPrint.Add(modelPlan);
        }
Ejemplo n.º 2
0
        public string Add(string cid, string data)
        {
            JsonModel1  model = new JsonModel1();
            ParamModel1 param = Newtonsoft.Json.JsonConvert.DeserializeObject <ParamModel1>(data);

            TF.RunSafty.BLL.Tab_DeliverJSPrint   bllPrint  = new TF.RunSafty.BLL.Tab_DeliverJSPrint();
            TF.RunSafty.Model.Tab_DeliverJSPrint modelPlan = new TF.RunSafty.Model.Tab_DeliverJSPrint();
            try
            {
                modelPlan.StrPlanGUID     = param.PlanGUID;
                modelPlan.StrSiteGUID     = cid;
                modelPlan.StrTrainmanGUID = param.TrainmanGUID;
                DateTime dtPrint;
                if (DateTime.TryParse(param.PrintTime, out dtPrint))
                {
                    modelPlan.dtPrintTime = dtPrint;
                }
                if (bllPrint.Add(modelPlan) > 0)
                {
                    model.result    = "0";
                    model.returnStr = "提交成功";
                }
                else
                {
                    model.result    = "1";
                    model.returnStr = "提交失败";
                }
            }
            catch (Exception ex)
            {
                TF.CommonUtility.LogClass.logex(ex, "");
                model.result    = "1";
                model.returnStr = "提交失败";
            }
            string result = Newtonsoft.Json.JsonConvert.SerializeObject(model);

            return(result);
        }