//
        // GET: /ProductDecoration/Create
        public ActionResult Create()
        {
            var productList = db.Products.Where(p => p.ProductStatus != archived &&
                                                p.Campaign.CampaignStatus != archived &&
                                                p.Campaign.Company.CompanyStatus != archived);

            var decorationMethodList = db.DecorationMethods.Where(d => d.DecorationMethodStatus != archived)
                                                            .OrderBy(d => d.DecorationMethodName);

            ViewBag.ProductID = new SelectList(productList, "ProductID", "ProductName");
            ViewBag.DecorationMethodID = new SelectList(decorationMethodList, "DecorationMethodID", "DecorationMethodName");

            // Generate Decoration method for member initialization
            ProductDecoration productDecoration = new ProductDecoration();
            productDecoration.OnCreate();

            return View(productDecoration);
        }
        // ProductDecoration
        public AuditTrail(DateTime dateTime, string userName, ProductDecoration productDecoration, int id, string comment)
        {
            this.AuditTrailTimeStamp = dateTime;
            this.AuditTrailUserName = userName;
            this.AuditTrailComment = comment;

            if(id > 0)
            {
                this.DecorationID = id;
            }
            else
            {
                this.ProductDecoration = productDecoration;
            }
        }
        public ActionResult Create(ProductDecoration productdecoration)
        {
            if(ModelState.IsValid)
            {
                // Add Audit Entry
                AuditTrail audit = new AuditTrail(DateTime.Now, User.Identity.Name, productdecoration, productdecoration.DecorationID, "Create");
                db.AuditTrails.Add(audit);

                db.ProductDecorations.Add(productdecoration);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            var productList = db.Products.Where(p => p.ProductStatus != archived &&
                                                p.Campaign.CampaignStatus != archived &&
                                                p.Campaign.Company.CompanyStatus != archived);

            var decorationMethodList = db.DecorationMethods.Where(d => d.DecorationMethodStatus != archived)
                                                            .OrderBy(d => d.DecorationMethodName);

            ViewBag.ProductID = new SelectList(productList, "ProductID", "ProductName", productdecoration.ProductID);
            ViewBag.DecorationMethodID = new SelectList(decorationMethodList, "DecorationMethodID", "DecorationMethodName", productdecoration.DecorationMethodID);
            return View(productdecoration);
        }