//Get public ActionResult Create(int requisitionId) { try { if (requisitionId == 0) { return(View("Error")); } Requisition requisition = _requisitionManager.FindById(requisitionId); if (requisition == null) { return(HttpNotFound()); } RequisitionViewModel requisitionViewModel = Mapper.Map <RequisitionViewModel>(ViewBag.Requisition = requisition); AssignRequisitionViewModel assignRequisitionViewModel = new AssignRequisitionViewModel(); assignRequisitionViewModel.RequisitionId = requisitionId; assignRequisitionViewModel.VehicleTypes = _vehicleTypeManager.GetAll().ToList(); ViewBag.RequisitionNumber = requisition.RequisitionNumber; ViewBag.EmployeeId = new SelectList(_employeeManager.GetAllDriver(), "Id", "FullName"); ViewBag.VehicleId = new SelectListItem[] { new SelectListItem() { Value = "", Text = "Select Vehicle" } }; ViewBag.RequisitionStatusId = new SelectList(_requisitionStatusManager.GetAllStatusNew(), "Id", "StatusType"); return(View(assignRequisitionViewModel)); } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "AssignRequisitions", "Create"))); } }
// GET: Vehicles/Create public ActionResult Create() { try { ViewBag.VehicleTypeId = new SelectList(_vehicleTypeManager.GetAll(), "Id", "Name"); return View(); } catch (Exception ex) { return View("Error", new HandleErrorInfo(ex, "Vehicles", "Create")); } }
// GET: VehicleTypes public ActionResult Index() { try { ICollection <VehicleType> vehicleType = _vehicleTypeManager.GetAll(); IEnumerable <VehicleTypeViewModel> vehicleTypeViewModels = Mapper.Map <IEnumerable <VehicleTypeViewModel> >(vehicleType); return(View(vehicleTypeViewModels)); } catch (Exception ex) { ExceptionMessage(ex); return(View("Error", new HandleErrorInfo(ex, "VehicleTypes", "Index"))); } }
// GET: VehicleTypes public ActionResult Index() { ICollection <VehicleType> vehicleType = _vehicleTypeManager.GetAll(); IEnumerable <VehicleTypeViewModel> vehicleList = Mapper.Map <IEnumerable <VehicleTypeViewModel> >(vehicleType); return(View(vehicleList)); }
// GET: VehicleType/Create public ActionResult Create() { var model = new VehicleTypeViewModel(); model.vehicleCollection = _vehicleTypeManager.GetAll(); return(View(model)); }
// GET: VehicleTypes public ActionResult Index(string searchText) { if (searchText != null) { ICollection <VehicleType> vehicleType = _vehicleTypeManager.SearchByText(searchText); IEnumerable <VehicleTypeViewModel> vehicleTypeViewModels = Mapper.Map <IEnumerable <VehicleTypeViewModel> >(vehicleType); return(View(vehicleTypeViewModels)); } else { ICollection <VehicleType> vehicleType = _vehicleTypeManager.GetAll(); IEnumerable <VehicleTypeViewModel> vehicleTypeViewModels = Mapper.Map <IEnumerable <VehicleTypeViewModel> >(vehicleType); return(View(vehicleTypeViewModels)); } }
public ActionResult Index() { var vehicle = _vehicleManager.GetAll(); var vehicleType = _typeManager.GetAll(); List <VehicleViewModel> vehicleVM = new List <VehicleViewModel>(); foreach (var vehicledata in vehicle) { var vechileViewModel = new VehicleViewModel(); vechileViewModel.Id = vehicledata.Id; vechileViewModel.VehicleName = vehicledata.VehicleName; vechileViewModel.Description = vehicledata.Description; vechileViewModel.VehicleType = vehicleType.Where(x => x.Id == vehicledata.VehicleTypeId).FirstOrDefault(); vehicleVM.Add(vechileViewModel); } return(View(vehicleVM)); }
// GET: Setup All Queue public ActionResult SetupQueue() { try { ViewBag.OrganizationCount = _organizationManager.GetAll().Count; ViewBag.DepartmentCount = _departmentManager.GetAll().Count; ViewBag.DesignationCount = _designationManager.GetAll().Count; ViewBag.EmployeeTypeCount = _employeeTypeManager.GetAll().Count; ViewBag.EmployeeCount = _employeeManager.GetAllEmployees().Count; ViewBag.DriverCount = _employeeManager.GetAllDriver().Count; ViewBag.VehicleCount = _vehicleManager.GetAll().Count; ViewBag.VehicleTypeCount = _vehicleTypeManager.GetAll().Count; return(View()); } catch (Exception ex) { ExceptionMessage(ex); return(View("Error", new HandleErrorInfo(ex, "Queue", "SetupQueue"))); } }
public ActionResult RequisitionQueue() { ViewBag.requisitionCount = _requisitionManager.GetAll().Count; ViewBag.RequisitionStatusCount = _requisitionStatusManager.GetAllStatusNew().Count; ViewBag.CompleteRequisition = _requisitionStatusManager.GetAll().Where(c => c.StatusType == "Completed").Count(); ViewBag.OnProcessRequest = _requisitionStatusManager.GetAllStatusExecute().Count; ViewBag.EmployeeCount = _employeeManager.GetAllEmployees().Count; ViewBag.DriverCount = _employeeManager.GetAllDriver().Count; ViewBag.VehicleCount = _vehicleManager.GetAll().Count; ViewBag.VehicleTypeCount = _vehicleTypeManager.GetAll().Count; return(View()); }
// GET: VehicleTypes public ActionResult Index(string searchText) { try { if (searchText != null) { ICollection <VehicleType> vehicleType = _vehicleTypeManager.SearchByText(searchText); IEnumerable <VehicleTypeViewModel> vehicleTypeViewModels = Mapper.Map <IEnumerable <VehicleTypeViewModel> >(vehicleType); return(View(vehicleTypeViewModels)); } else { ICollection <VehicleType> vehicleType = _vehicleTypeManager.GetAll(); IEnumerable <VehicleTypeViewModel> vehicleTypeViewModels = Mapper.Map <IEnumerable <VehicleTypeViewModel> >(vehicleType); return(View(vehicleTypeViewModels)); } } catch (Exception ex) { return(View("Error", new HandleErrorInfo(ex, "VehicleTypes", "Index"))); } }
public ActionResult Car() { var vehicle = vehicleManager.GetAll(); var vehicleType = vehicleTypeManager.GetAll(); List <VehicleViewModel> vehicleViewModels = new List <VehicleViewModel>(); foreach (var data in vehicle) { var vehicleVM = new VehicleViewModel(); vehicleVM.Id = data.Id; vehicleVM.VehicleName = data.VehicleName; vehicleVM.VModel = data.VModel; vehicleVM.Description = data.Description; vehicleVM.VRegistrationNo = data.VRegistrationNo; vehicleVM.VChesisNo = data.VChesisNo; vehicleVM.VCapacity = data.VCapacity; vehicleVM.Status = data.Status; vehicleVM.VehicleType = vehicleType.Where(c => c.Id == data.VehicleTypeId).FirstOrDefault(); vehicleViewModels.Add(vehicleVM); } ViewBag.TotalCar = vehicle.Count; return(View(vehicleViewModels)); }
// GET: Vehicles/Create public ActionResult Create() { ViewBag.VehicleTypeId = new SelectList(_vehicleTypeManager.GetAll(), "Id", "TypeName"); return(View()); }
public ActionResult Index() { var data = _typeManager.GetAll(); return(View(data)); }