public ActionResult InsertEditSource(CCENUMERATION oCCENUMERATION, string btnName) { var errors = ModelState.Values.SelectMany(v => v.Errors); try { if (ModelState.IsValid) { oCurrentUser = (CCUSER)Session["User"]; switch (btnName) { case "create": oDBContext.CCENUMERATIONs.Add(oCCENUMERATION); oDBContext.SaveChanges(); TempData["SuccessMsg"] = "Data Saved Successfully."; break; case "update": oDBContext.Entry(oCCENUMERATION).State = EntityState.Modified; oDBContext.SaveChanges(); TempData["SuccessMsg"] = "Data Updated Successfully."; break; } } } catch (Exception ex) { TempData["ErrorMsg"] = "Data is not saved due to " + ExceptionMsg(ex); } return(RedirectToAction("Index")); }
public ActionResult CreateProduct() { oCCENUMERATION = new CCENUMERATION(); oCCENUMERATION.TYPE = ProductEnumType; oCCENUMERATION.ISACTIVE = true; return(PartialView("_EditProductPartial", oCCENUMERATION)); }
public ActionResult CreateSource() { oCCENUMERATION = new CCENUMERATION(); oCCENUMERATION.TYPE = SourceEnumType; oCCENUMERATION.ISACTIVE = true; return(PartialView("_EditSourcePartial", oCCENUMERATION)); }
public ActionResult EditTicker(int id) { int enumDBType = 0; enumDBType = Convert.ToInt32(Enumaretion.DBEnumType.TickerMsg); oCCENUMERATION = oDBContext.CCENUMERATIONs.FirstOrDefault(t => t.ID == id && t.TYPE == enumDBType); return(PartialView("_EditTickerPartial", oCCENUMERATION)); }
public ActionResult CreateTicker() { int enumDBType = 0; enumDBType = Convert.ToInt32(Enumaretion.DBEnumType.TickerMsg); oCCENUMERATION = new CCENUMERATION(); oCCENUMERATION.TYPE = enumDBType; oCCENUMERATION.ISACTIVE = true; return(PartialView("_EditTickerPartial", oCCENUMERATION)); }
public ActionResult EditProduct(int id) { oCCENUMERATION = oDBContext.CCENUMERATIONs.FirstOrDefault(t => t.ID == id); return(PartialView("_EditProductPartial", oCCENUMERATION)); }