Пример #1
0
        public ActionResult MCM_J(int jobId)
        {
            var dal  = new MCMDAL();
            var mcmE = dal.GetMCM(jobId);
            var mcm  = JsonConvert.DeserializeObject <MCMVM>(mcmE.MCMInfo);

            mcm.JobID      = jobId;
            Session["mcm"] = mcm;
            return(RedirectToAction("MCM", mcm));
        }
Пример #2
0
        public JsonResult MCMSave(MCMVM mcm)
        {
            foreach (var n in mcm.Diss)
            {
                if (n.Name.ToUpper() == "Y")
                {
                    return(Json(new { message = "参数名称不能够为y" }));
                }
            }
            var userid = Convert.ToInt32(HttpContext.Request.Cookies["userid"].Value);

            Script.DeleteJob(mcm.JobID);
            var jobid = Script.CreateJob(userid, -mcm.MCMType, mcm.Title, mcm.DecimalDigitCount);
            var dal   = new MCMDAL();
            var mcmID = dal.SaveMCM(new MCM {
                JobID = jobid, MCMInfo = JsonConvert.SerializeObject(mcm)
            });

            return(Json(new { message = "success", mcmID, jobid }));
        }