// // GET: /FeeName/Create public ActionResult Create(string returnUrl) { ViewBag.ReturnUrl = returnUrl; // Generate Decoration method for member initialization FeeName feeName = new FeeName(); feeName.OnCreate(); return View(feeName); }
// FeeName public AuditTrail(DateTime dateTime, string userName, FeeName feeName, int id, string comment) { this.AuditTrailTimeStamp = dateTime; this.AuditTrailUserName = userName; this.AuditTrailComment = comment; if(id > 0) { this.FeeNameID = id; } else { this.FeeName = feeName; } }
public ActionResult Create(FeeName feename, string returnUrl) { if (ModelState.IsValid) { // Add Audit Entry AuditTrail audit = new AuditTrail(DateTime.Now, User.Identity.Name, feename, feename.FeeNameID, "Create"); db.AuditTrails.Add(audit); db.FeeNames.Add(feename); db.SaveChanges(); if(returnUrl == null) { return RedirectToAction("Index"); } return Redirect(returnUrl); } return View(feename); }
public Fee(FeeName name, string type, string calculationStep, int sellPriceID, decimal feePercent, decimal feeDollarAmount) { // TODO: Complete member initialization this.FeeName = name; this.FeeType = type; this.FeeCalculation = calculationStep; this.ProductSellPriceID = sellPriceID; this.FeePercent = feePercent; this.FeeDollarAmount = feeDollarAmount; this.FeeLevel = 0; this.AuditTrails = new HashSet<AuditTrail>(); this.FeeStatus = MyExtensions.GetEnumDescription(Status.Active); }
public ActionResult Edit(FeeName feename) { if (ModelState.IsValid) { // Add Audit Entry AuditTrail audit = new AuditTrail(DateTime.Now, User.Identity.Name, feename, feename.FeeNameID, "Edit"); db.AuditTrails.Add(audit); var current = db.FeeNames.Find(feename.FeeNameID); db.Entry(current).CurrentValues.SetValues(feename); db.SaveChanges(); return RedirectToAction("Index"); } return View(feename); }