Exemplo n.º 1
0
 public ActionResult Edit(BookInfo bookInfo)
 {
     ReturnObj returnObj = new ReturnObj();
     bookInfo.upTime = DateTime.Now;
     bookInfo.upUser = ((UserInfo)Session["UserInfo"]).UserName;
     BookInfo old = iGenericRepository.GetById(bookInfo.book_id);
     Common.Clone.CloneBean<BookInfo>(old, bookInfo);
     iGenericRepository.Update(old);
     returnObj.State = 1;
     returnObj.Msg = "保存成功";
     return Json(returnObj, JsonRequestBehavior.AllowGet);
 }
Exemplo n.º 2
0
 public ActionResult Create(BookInfo bookInfo)
 {
     ReturnObj returnObj = new ReturnObj();
     bookInfo.AddTime = DateTime.Now;
     bookInfo.AddUser = "******";
     //bookInfo.state = "1";
     if (iGenericRepository.Save(bookInfo) > 0)
     {
         returnObj.State = 1;
         returnObj.Msg = "保存成功!";
     }
     else
     {
         returnObj.State = -1;
         returnObj.Msg = "保存失败!";
     }
     return Json(returnObj, JsonRequestBehavior.AllowGet);
 }