コード例 #1
0
        //
        // 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);
        }
コード例 #2
0
        // 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;
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 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);
 }
コード例 #5
0
        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);
        }