示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            CoKits coKits = db.CoKits.Find(id);

            db.CoKits.Remove(coKits);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
        public ActionResult Create([Bind(Include = "MasterKitID,GroupID,KitName,KitSku,KitDescription,KitDiscount,KitSummarize,AcctKitID,KitImage,Discontinued,SiteCoID")] CoKits coKits)
        {
            if (ModelState.IsValid)
            {
                coKits.SiteCoID = base.siteusercompanyid;
                db.InsertMasterKit(coKits.SiteCoID, coKits.KitName, coKits.KitSku, coKits.KitDescription);
                // db.CoKits.Add(coKits);
                db.SaveChanges();
                return(RedirectToAction("Index", "KitsOptions", new { area = "Options" }));
            }

            return(View(coKits));
        }
示例#3
0
        // GET: Common/Kits/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CoKits coKits = db.CoKits.Find(id);

            if (coKits == null)
            {
                return(HttpNotFound());
            }
            return(View("_Edit", coKits));
        }
示例#4
0
 public ActionResult Edit(CoKits coKits)
 {
     if (ModelState.IsValid)
     {
         var q = db.CoKits.Where(p => p.MasterKitID == coKits.MasterKitID).FirstOrDefault();
         q.SiteCoID       = base.siteusercompanyid;
         q.KitName        = coKits.KitName;
         q.KitSku         = coKits.KitSku;
         q.KitDescription = coKits.KitDescription;
         db.SaveChanges();
         return(Json(new { status = "success", MasterKitID = coKits.MasterKitID }));
     }
     return(View(coKits));
 }
示例#5
0
        // GET: Common/Kits/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CoKits coKits = db.CoKits.Find(id);

            ViewBag.KitItems   = db.GetKitItemsByKitID(id).ToList();
            ViewBag.AcctKitID  = coKits.AcctKitID;
            coKits.KitDiscount = coKits.KitDiscount * 100;
            if (coKits == null)
            {
                return(HttpNotFound());
            }
            ViewBag.KitItems = db.GetKitItemsByKitID(id).ToList();
            return(View(coKits));
        }