Example #1
0
        // GET: DownReports/Edit/5
        public ActionResult Edit(int?id)
        {
            var downreports = db.DownReports.SingleOrDefault(c => c.DownReportId == id);

            var downstatuses = db.DownStatuses.ToList();
            var mlsdivisions = db.MlsDivisions.ToList();

            var viewModel = new SaveDownViewModel()
            {
                DownReport   = downreports,
                MlsDivisions = mlsdivisions,
                DownStatuses = downstatuses
            };

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DownReport downReport = db.DownReports.Find(id);

            if (downReport == null)
            {
                return(HttpNotFound());
            }
            return(View("Edit", viewModel));
            //return View(downReport);
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            DownReport downReport = db.DownReports.Find(id);

            db.DownReports.Remove(downReport);
            db.SaveChanges();
            return(RedirectToAction("DownAlt"));
        }
Example #3
0
 //public ActionResult Edit([Bind(Include = "DownReportId,CreationDateTime,CustomerPn,QtyNeeded,MlsWo,CustomerPo,EstArrivalDateTime,Status,Reason,Notes")] DownReport downReport)
 public ActionResult Edit(DownReport downReport)
 {
     if (ModelState.IsValid)
     {
         db.Entry(downReport).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("DownAlt"));
     }
     //return View(downReport);
     return(View());
 }
Example #4
0
        //public ActionResult Create([Bind(Include = "DownReportId,CreationDateTime,CustomerPn,QtyNeeded,MlsWo,CustomerPo,EstArrivalDateTime,Status,Reason,Notes")] DownReport downReport)
        public ActionResult Create(DownReport downReport)
        {
            if (ModelState.IsValid)
            {
                db.DownReports.Add(downReport);
                db.SaveChanges();
                return(RedirectToAction("DownAlt", "WorkOrders"));
            }

            return(View());
            //return View(downReport);
        }
Example #5
0
        // GET: DownReports/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DownReport downReport = db.DownReports.Find(id);

            if (downReport == null)
            {
                return(HttpNotFound());
            }
            return(View(downReport));
        }