Beispiel #1
0
 public ActionResult Edit([Bind(Include = "Id,StatusType,CreatedOn,CreatedBy,UpdatedOn,UpdatedBy")] LookupRxcStatu lookupRxcStatu)
 {
     if (ModelState.IsValid)
     {
         lookupRxcStatu.UpdatedBy       = CurrentUser.Id;
         lookupRxcStatu.UpdatedOn       = DateTime.UtcNow;
         db.Entry(lookupRxcStatu).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CreatedBy = new SelectList(db.Users, "Id", "UserName", lookupRxcStatu.CreatedBy);
     ViewBag.UpdatedBy = new SelectList(db.Users, "Id", "UserName", lookupRxcStatu.UpdatedBy);
     return(View(lookupRxcStatu));
 }
Beispiel #2
0
        // GET: Admin/RxcStatus/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LookupRxcStatu lookupRxcStatu = db.LookupRxcStatus.Find(id);

            if (lookupRxcStatu == null)
            {
                return(HttpNotFound());
            }
            return(View(lookupRxcStatu));
        }
Beispiel #3
0
        // GET: Admin/RxcStatus/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            LookupRxcStatu lookupRxcStatu = db.LookupRxcStatus.Find(id);

            if (lookupRxcStatu == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CreatedBy = new SelectList(db.Users, "Id", "UserName", lookupRxcStatu.CreatedBy);
            ViewBag.UpdatedBy = new SelectList(db.Users, "Id", "UserName", lookupRxcStatu.UpdatedBy);
            return(View(lookupRxcStatu));
        }
Beispiel #4
0
        public ActionResult DeleteConfirmed(int id)
        {
            LookupRxcStatu lookupRxcStatu = db.LookupRxcStatus.Find(id);

            try
            {
                db.LookupRxcStatus.Remove(lookupRxcStatu);
                db.SaveChanges();
            }
            catch (DbUpdateException ex)
            {
                ModelState.AddModelError("Error", "There are some releted item in database, please delete those first");
                return(View("Delete", lookupRxcStatu));
            }
            return(RedirectToAction("Index"));
        }