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