public ActionResult AddSourceOfFunds(SourceOfFunds sourceOfFunds) { try { DateTime dt = DateTime.Now; sourceOfFunds.SourceOfFundID = Guid.NewGuid(); sourceOfFunds.DateCreated = dt; sourceOfFunds.DateModified = dt; sourceOfFunds.CreatedBy = "Techspecialist"; db.SourceOfFunds.Add(sourceOfFunds); db.SaveChanges(); } catch (Exception ex) { LogHelper.Log(Log.Event.ADD_SOURCEOFFUNDS, ex.Message); ExceptionError(ex.Message, ex.StackTrace); } return(Json(new { success = true, message = "Source Of Fund added successfully!!!", data = db.SourceOfFunds.Select(x => new { x.SourceOfFundID, x.SourceOfFund, }) }, JsonRequestBehavior.AllowGet)); }
public ActionResult DeleteConfirmed(Guid id) { SourceOfFunds sourceOfFunds = db.SourceOfFunds.Find(id); db.SourceOfFunds.Remove(sourceOfFunds); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "SourceOfFundID,SourceOfFund,EnableSourceOfFund,DateModified,CreatedBy,DateCreated")] SourceOfFunds sourceOfFunds) { if (ModelState.IsValid) { sourceOfFunds.SourceOfFundID = Guid.NewGuid(); db.SourceOfFunds.Add(sourceOfFunds); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(sourceOfFunds)); }
// GET: SourceOfFunds/Details/5 public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SourceOfFunds sourceOfFunds = db.SourceOfFunds.Find(id); if (sourceOfFunds == null) { return(HttpNotFound()); } return(View(sourceOfFunds)); }