Ejemplo n.º 1
0
        public ActionResult Create(FankuiAddViewModel model)
        {
            try
            {
                FankuiDto dto = new FankuiDto();
                dto.FankuiResult = model.FankuiResult;
                dto.FankuiSource = model.FankuiSource;
                dto.FankuiDescription = model.FankuiDescription;
                dto.FankuiSendTime = System.DateTime.Now;
                dto.FankuiTime = System.DateTime.Now;
                dto.FankuiStatus = "已查看";
                dto.FankuiCustomerId = model.FankuiCustomerId;
                dto.FankuiDoctor = int.Parse(System.Web.HttpContext.Current.Request.Cookies["UserId"].Value);
                // TODO: Add insert logic here
                string JsonString = JsonHelper.JsonSerializerBySingleData(dto);
                Message msg = CMSService.Insert("Fankui", JsonString);
                return RedirectTo("/Fankui/Index/" + model.FankuiCustomerId, msg.MessageInfo);
               // return RedirectToAction("Index");
            }
            catch
            {
                Message msg = new Message();
                msg.MessageInfo = "插入操作失败了,请检查是否输入错误";

                return RedirectTo("/Fankui/Create/" + model.FankuiCustomerId, msg.MessageInfo);
            }
        }
Ejemplo n.º 2
0
 //
 // GET: /Fankui/Create
 public ActionResult Create(int id)
 {
     FankuiAddViewModel model = new FankuiAddViewModel();
      ViewData["FankuiCategory"] = MyService.GetCategorySelectList("CategoryParentId=44");
      ViewData["Source"] = MyService.GetCategorySelectList("CategoryParentId=50");
      model.FankuiCustomerId = id;
      ViewBag.CustomerName = MyService.CustomerIdToName("CustomerId=" + id);
      return View(model);
 }