public ActionResult Create(string reasonName, string isAdjust) { try { if (!string.IsNullOrEmpty(reasonName)) { ReasonAccepted reasonAccepted = new ReasonAccepted(); reasonAccepted.Name = reasonName; reasonAccepted.IsDeleted = false; if (isAdjust == "True") { reasonAccepted.IsAdjust = true; } if (ModelState.IsValid) { objBs.reasonAcceptedBs.Insert(reasonAccepted); } return(RedirectToAction("Index", new { sms = "Created Successfully !" })); } else { return(RedirectToAction("Index", new { sms = "reason is null or empty !" })); } } catch (Exception ex) { return(RedirectToAction("Index", new { sms = "Operation Create failed ! " + ex.InnerException.InnerException.Message.ToString() })); } }
//Delete public void Delete(int Id) { ReasonAccepted reasonAccepted = db.ReasonAccepteds.Find(Id); reasonAccepted.IsDeleted = true; db.Entry(reasonAccepted).State = EntityState.Modified; Save(); }
//Update public void Update(ReasonAccepted reasonAccepted) { objDb.Update(reasonAccepted); }
//Insert public void Insert(ReasonAccepted reasonAccepted) { objDb.Insert(reasonAccepted); }
//Update public void Update(ReasonAccepted reasonAccepted) { db.Entry(reasonAccepted).State = EntityState.Modified; Save(); }
//Insert public void Insert(ReasonAccepted reasonAccepted) { db.ReasonAccepteds.Add(reasonAccepted); Save(); }