Exemple #1
0
        // GET: CheckRequests/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            var checkrequests = db.CheckRequests.SingleOrDefault(c => c.CheckRequestId == id);

            var checkstatus = db.CheckStatuses.ToList();

            var viewModel = new SaveCheckRequestViewModel()
            {
                CheckRequest  = checkrequests,
                CheckStatuses = checkstatus
            };

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CheckRequest checkRequest = await db.CheckRequests.FindAsync(id);

            if (checkRequest == null)
            {
                return(HttpNotFound());
            }
            return(View("Edit", viewModel));
            //return View(checkRequest);
        }
Exemple #2
0
        // GET: CheckRequests/Create
        public ActionResult Create()
        {
            var checkstatuses = db.CheckStatuses.ToList();

            var viewModel = new SaveCheckRequestViewModel()
            {
                CheckStatuses = checkstatuses,
            };

            return(View("Create", viewModel));
            //return View();
        }