Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MasterSize masterSize = db.masterSizes.Find(id);

            db.masterSizes.Remove(masterSize);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Edit(MasterSize cvm)
        {
            var cat = db.masterSizes.Where(x => x.SizeID == cvm.SizeID).FirstOrDefault();

            cat.Size     = cvm.Size;
            cat.isActive = false;
            if (cvm.statusex == "Yes")
            {
                cat.isActive = true;
            }
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MasterSize masterSize = db.masterSizes.Find(id);

            if (masterSize == null)
            {
                return(HttpNotFound());
            }
            return(View(masterSize));
        }
Beispiel #4
0
        public ActionResult Create(MasterSize cvm)
        {
            MasterSize cat = new MasterSize();

            cat.Size     = cvm.Size;
            cat.isActive = false;
            if (cvm.statusex == "Yes")
            {
                cat.isActive = true;
            }
            db.masterSizes.Add(cat);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #5
0
 /// <summary>
 /// Verifies that the master and sample images match in size.
 /// Otherwise, the difference is added to the result.
 /// </summary>
 /// <param name="result">The comparison result to add the difference
 /// to. May be null.</param>
 /// <returns>true if the sizes match, false otherwise.</returns>
 protected bool RequireSizeMatch(ComparisonResult result)
 {
     if (MasterSize.Equals(SampleSize))
     {
         return(true);
     }
     else
     {
         result.AddDifference(
             new SizeDifference(MasterSize, SampleSize));
         result.SetIdentical(false);
         result.SetCriteriaMet(false);
         return(false);
     }
 }