示例#1
0
        public ActionResult Create(RequestRelease requestrelease)
        {
            if (ModelState.IsValid)
            {
                db.RequestReleases.Add(requestrelease);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(requestrelease);
        }
示例#2
0
        public ActionResult Edit(RequestRelease request)
        {
            try
            {
                using (TransactionScope transaction = new TransactionScope())
                {
                    RequestRelease model = db.RequestReleases.Where(a => a.RequestID == request.RequestID).SingleOrDefault();
                    model.StartDate = request.StartDate;
                    model.EndDate = request.EndDate;
                    db.Entry(model).State = EntityState.Modified;
                    db.SaveChanges();

                    transaction.Complete();
                }
                return View("SuccessEdit");
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#3
0
 public ActionResult Edit(RequestRelease requestrelease)
 {
     if (ModelState.IsValid)
     {
         db.Entry(requestrelease).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(requestrelease);
 }