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

            db.SectionSizes.Remove(sectionSize);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 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));
 }
        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));
        }
        // 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));
        }
Beispiel #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;
            }
        }
        // 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));
        }
Beispiel #7
0
 public SectionBuilder Size(SectionSize size)
 {
     this.Component.Size = size;
     return(this);
 }