public ActionResult DeleteConfirmed(int id) { DesignSize designSize = db.DesignSizes.Find(id); db.DesignSizes.Remove(designSize); db.SaveChanges(); return(RedirectToAction("Index")); }
/// <summary> /// Ensure that value size is greater or equal to minSize. /// </summary> /// <param name="value"></param> /// <param name="minSize"></param> /// <returns></returns> internal static DesignSize RestrictAtMinSize(DesignSize value, DesignSize minSize) { if (value.Width < minSize.Width || value.Height < minSize.Height) { value = new DesignSize( value.Width < minSize.Width ? minSize.Width : value.Width, value.Height < minSize.Height ? minSize.Height : value.Height); } return(value); }
public ActionResult Edit([Bind(Include = "DsizeId,SizeName")] DesignSize designSize) { if (ModelState.IsValid) { db.Entry(designSize).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(designSize)); }
public ActionResult Create([Bind(Include = "DsizeId,SizeName")] DesignSize designSize) { if (ModelState.IsValid) { db.DesignSizes.Add(designSize); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(designSize)); }
/// <summary> /// Ensure that value size is less or equal to maxSize. If maxSize is empty, no restriction is applied. /// </summary> /// <param name="calendarDesigner"> </param> /// <param name="value"></param> /// <param name="maxSize"></param> /// <returns></returns> internal static DesignSize RestrictAtMaxSize(CalendarDesigner calendarDesigner, DesignSize value, DesignSize maxSize) { if (maxSize != DesignSize.Empty && (value.Width > maxSize.Width || value.Height > maxSize.Height)) { value = new DesignSize( value.Width > maxSize.Width && maxSize.Width.ToTwips() > 0 ? maxSize.Width : value.Width, value.Height > maxSize.Height && maxSize.Height.ToTwips() > 0 ? maxSize.Height : value.Height); } calendarDesigner.ResizeParents(value); return(value); }
// GET: DesignSizes/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } DesignSize designSize = db.DesignSizes.Find(id); if (designSize == null) { return(HttpNotFound()); } return(View(designSize)); }
/// <summary> /// Defines is need to paint fixed size. /// </summary> public static bool NeedsFixedSizePainted(CustomReportItem item, DesignSize fixedSize, Rectangle bounds, ConversionService conversionService) { return(IsFixedSizeApplicable(item) && (conversionService.ToDisplayWidth(fixedSize.Width) > bounds.Width || conversionService.ToDisplayHeight(fixedSize.Height) > bounds.Height)); }