Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SectionSize sectionSize = db.SectionSizes.Find(id);

            db.SectionSizes.Remove(sectionSize);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "Id,SectionId,SizeId")] SectionSize sectionSize)
 {
     if (ModelState.IsValid)
     {
         db.Entry(sectionSize).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.SectionId = new SelectList(db.Sections, "Id", "Name", sectionSize.SectionId);
     ViewBag.SizeId    = new SelectList(db.Sizes, "Id", "Name", sectionSize.SizeId);
     return(View(sectionSize));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "Id,SectionId,SizeId")] SectionSize sectionSize)
        {
            if (ModelState.IsValid)
            {
                db.SectionSizes.Add(sectionSize);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.SectionId = new SelectList(db.Sections, "Id", "Name", sectionSize.SectionId);
            ViewBag.SizeId    = new SelectList(db.Sizes, "Id", "Name", sectionSize.SizeId);
            return(View(sectionSize));
        }
Example #4
0
        // GET: Admin/SectionSizes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SectionSize sectionSize = db.SectionSizes.Find(id);

            if (sectionSize == null)
            {
                return(HttpNotFound());
            }
            return(View(sectionSize));
        }
Example #5
0
        public TableSize(TableView table, AbstractTableViewDataSource datasource)
        {
            sections = new SectionSize[datasource.GetNumberOfSections(table)];
            float offset = 0;

            Empty = true;
            for (int i = 0; i < sections.Length; i++)
            {
                var section = new SectionSize(table, datasource, i, offset);
                sections[i] = section;
                offset      = section.Bottom;
                Empty       = Empty && section.Empty;
            }
        }
Example #6
0
        // GET: Admin/SectionSizes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SectionSize sectionSize = db.SectionSizes.Find(id);

            if (sectionSize == null)
            {
                return(HttpNotFound());
            }
            ViewBag.SectionId = new SelectList(db.Sections, "Id", "Name", sectionSize.SectionId);
            ViewBag.SizeId    = new SelectList(db.Sizes, "Id", "Name", sectionSize.SizeId);
            return(View(sectionSize));
        }
Example #7
0
 public SectionBuilder Size(SectionSize size)
 {
     this.Component.Size = size;
     return(this);
 }