Пример #1
0
        public async Task <ActionResult> Edit([Bind(Include = "idCostsCarWashAndDeteyling,nameExpenses,amount,dateExpenses,expenseCategoryId,typeServicesId")] CostsCarWashAndDeteylingView costsCarWashAndDeteylingView)
        {
            if (ModelState.IsValid)
            {
                CostsCarWashAndDeteylingBll costsCarWashAndDeteyling = Mapper.Map <CostsCarWashAndDeteylingView, CostsCarWashAndDeteylingBll>(costsCarWashAndDeteylingView);
                await _costsCarWashAndDeteyling.Update(costsCarWashAndDeteyling);

                return(RedirectToAction("Index"));
            }

            ViewBag.Category = new SelectList(await _expenseCategory.GetTableAll(), "idExpenseCategory", "name");
            return(View(costsCarWashAndDeteylingView));
        }
Пример #2
0
        // GET: CostsCarWashAndDeteyling/Edit/5
        public async Task <ActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CostsCarWashAndDeteylingView costsCarWashAndDeteylingView = Mapper.Map <CostsCarWashAndDeteylingView>(await _costsCarWashAndDeteyling.SelectId(id));

            if (costsCarWashAndDeteylingView == null)
            {
                return(HttpNotFound());
            }

            ViewBag.Category = new SelectList(await _expenseCategory.GetTableAll(), "idExpenseCategory", "name");
            return(View(costsCarWashAndDeteylingView));
        }
Пример #3
0
        // GET: CostsCarWashAndDeteyling/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            CostsCarWashAndDeteylingView costsCarWashAndDeteylingView = Mapper.Map <CostsCarWashAndDeteylingView>(await _costsCarWashAndDeteyling.SelectId(id));

            if (costsCarWashAndDeteylingView == null)
            {
                return(HttpNotFound());
            }

            return(View(costsCarWashAndDeteylingView));
        }