예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            DesignSize designSize = db.DesignSizes.Find(id);

            db.DesignSizes.Remove(designSize);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 /// <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);
 }
예제 #3
0
 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));
 }
예제 #4
0
        public ActionResult Create([Bind(Include = "DsizeId,SizeName")] DesignSize designSize)
        {
            if (ModelState.IsValid)
            {
                db.DesignSizes.Add(designSize);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(designSize));
        }
예제 #5
0
        /// <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);
        }
예제 #6
0
        // 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));
        }
예제 #7
0
 /// <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));
 }