Esempio n. 1
0
        public ActionResult BackToRepairsTable(int repairId)
        {
            var queryResult   = repairService.GetSingleRepairModel(repairId);
            int?repairFaultId = queryResult.id_usterki;

            if (repairFaultId != null)
            {
                return(RedirectToAction("Index", "Repairs", new{ faultId = repairFaultId }));
            }
            else
            {
                return(View("CouldNotFindFault"));
            }
        }
Esempio n. 2
0
        public ActionResult EditRepair(int repairId)
        {
            var queryResult        = repairsService.GetSingleRepairModel(repairId);
            var companyQueryResult = companyService.GetSingleCompany(queryResult.id_firmy);
            var viewModel          = new RepairEditViewModel();

            viewModel.Repair = ViewModelMapper.Mapper.Map <RepairViewModel>(queryResult);
            if (companyQueryResult != null)
            {
                viewModel.CommissionedCompany = ViewModelMapper.Mapper.Map <CompanyViewModel> (companyQueryResult);
            }
            else
            {
                viewModel.CommissionedCompany = new CompanyViewModel();
            }

            return(View(viewModel));
        }