public ActionResult Create(string reasonName, string isAdjust) { try { if (!string.IsNullOrEmpty(reasonName)) { ReasonInbound reasonInbound = new ReasonInbound(); reasonInbound.Name = reasonName; reasonInbound.IsDeleted = false; if (isAdjust == "True") { reasonInbound.IsAdjust = true; } if (ModelState.IsValid) { objBs.reasonInboundBs.Insert(reasonInbound); } 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) { ReasonInbound reasonInbound = db.ReasonInbounds.Find(Id); reasonInbound.IsDeleted = true; db.Entry(reasonInbound).State = EntityState.Modified; Save(); }
//Update public void Update(ReasonInbound reasonInbound) { db.Entry(reasonInbound).State = EntityState.Modified; Save(); }
//Insert public void Insert(ReasonInbound reasonInbound) { db.ReasonInbounds.Add(reasonInbound); Save(); }
//Update public void Update(ReasonInbound reasonInbound) { objDb.Update(reasonInbound); }
//Insert public void Insert(ReasonInbound reasonInbound) { objDb.Insert(reasonInbound); }