public async Task <IActionResult> Edit(int id, DriveCreateEditViewModel model, [FromServices] IDriveHelperService driveHelperService, [FromServices] IDrivesService drivesService, [FromServices] UserManager <ApplicationUser> userManager, [FromServices] ICarsService carsService) { int userId = int.Parse(userManager.GetUserId(User)); if (this.ModelState.IsValid) { try { await driveHelperService.ProcessEditDriveAsync(model, id); return(Json(new { success = "true", message = "Drive successfully edited." })); } catch (Exception ex) { return(Json(new { success = "false", message = "An error has occured." })); } } var cars = carsService.GetSelectionListByDriver(userId); model.Cars = cars; return(this.PartialView("_EditPartial", model)); }
/// <summary> /// The user renews access token and refresh token /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='renewTokenRequest'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <AccessTokenResponse> RenewTokenAsync(this ICarsService operations, RenewTokenRequest renewTokenRequest, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RenewTokenWithHttpMessagesAsync(renewTokenRequest, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public CarsController(UserManager <ApplicationUser> userManager, ICarsService carsService, IConfiguration configuration) { this.userManager = userManager; this.carsService = carsService; this.configuration = configuration; this.imagePathPrefix = string.Format(this.cloudinaryPrefix, this.configuration["Cloudinary:AppName"]); }
public InvoicesController(IInvoicesService invoicesService, IUsersService usersService, ICarsService carsService, UserManager <ApplicationUser> userManager) { this.invoicesService = invoicesService; this.usersService = usersService; this.carsService = carsService; this.userManager = userManager; }
public RidesController(ICarsService carsService, IRidesService ridesService, IInvitationsService invitationsService) { this.carsService = carsService; this.ridesService = ridesService; this.invitationsService = invitationsService; }
public CarsController(ILogger <CarsController> logger, AutomobileDbContext dbContext, ICarsService carsService, UserManager <ApplicationUser> userManager) { _logger = logger; this.dbContext = new AutomobileDbContext(); this.carsService = carsService; _userManager = userManager; }
public CarsController(IMakesService makesService, ITransmissionsService transmissionsService, ICarsService carsService, IMapper mapper) { this.transmissionsService = transmissionsService; this.makesService = makesService; this.mapper = mapper; this.carsService = carsService; }
public CarsController( ICarsService carsService, IUsersService usersService) { this.carsService = carsService; this.usersService = usersService; }
public CarsController( IValidator validator, ICarsService carsService) { this.validator = validator; this.carsService = carsService; }
public ManageCarsController( IManageCarsService manageCarsService, ICarsService carsService) { this.manageCarsService = manageCarsService; this.carsService = carsService; }
/// <summary> /// Gets a specific file from an execution in carsService. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='executionId'> /// Execution id of the execution /// </param> /// <param name='index'> /// Index of the execution in the batch. /// </param> /// <param name='fileName'> /// Name of the file to be returned. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <System.IO.Stream> GetBatchExecutionFileAsync(this ICarsService operations, string executionId, int index, string fileName, CancellationToken cancellationToken = default(CancellationToken)) { var _result = await operations.GetBatchExecutionFileWithHttpMessagesAsync(executionId, index, fileName, null, cancellationToken).ConfigureAwait(false); _result.Request.Dispose(); return(_result.Body); }
/// <summary> /// Gets all files from an individual execution in carsService. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='executionId'> /// Execution id of the execution /// </param> /// <param name='index'> /// Index of the execution in the batch. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IList <string> > GetBatchExecutionFilesAsync(this ICarsService operations, string executionId, int index, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetBatchExecutionFilesWithHttpMessagesAsync(executionId, index, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Consume the carsService web service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='webServiceParameters'> /// Input parameters to the web service. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <WebServiceResult> ManualTransmissionAsync(this ICarsService operations, InputParameters webServiceParameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ManualTransmissionWithHttpMessagesAsync(webServiceParameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
public SearchController( IAdditionsService additionsService, ICarsService carsService) { this.additionsService = additionsService; this.carsService = carsService; }
public HelperController(IMakesService makesService, IModelsService modelsService, IGenerationsService generationsService, ICarsService carsService) { this.makesService = makesService; this.modelsService = modelsService; this.generationsService = generationsService; this.carsService = carsService; }
public CustomerController( ICustomerRepository _Customer , IContactRepository _Contact , IUserRepository _user , IProductInvoiceRepository _ProductInvoice , IvwProvinceService _ProvinceService , IvwDistrictService _DistrictService , IvwWardService _IWardService , IMemberCardService _MemberCardService , IvwCarService _vwCarService , ICarLineRepository _CarLine , ICarsService _Cars , IMemberCardTypeService _MemberCardTypeService ) { ContactRepository = _Contact; CustomerRepository = _Customer; userRepository = _user; productInvoiceRepository = _ProductInvoice; ProvinceService = _ProvinceService; DistrictService = _DistrictService; WardService = _IWardService; MemberCardService = _MemberCardService; vwCarsService = _vwCarService; CarLineRepository = _CarLine; CarsService = _Cars; MemberCardTypeService = _MemberCardTypeService; }
public CarsController(ICarsService carsService, UserManager <ApplicationUser> userManager, IUsersService usersService, ICarUsersService carUsersService) { this.carsService = carsService; this.userManager = userManager; this.usersService = usersService; this.carUsersService = carUsersService; }
public PriceService(ICarsService carsService, IYearDiscount yearDiscount, INumberOfCarsDiscount numberOfCarsDiscount, ITotalAmountDiscount totalAmountDiscount) { _carsService = carsService; _yearDiscount = yearDiscount; _numberOfCarsDiscount = numberOfCarsDiscount; _totalAmountDiscount = totalAmountDiscount; }
public SalesController( IWebHostEnvironment webHostEnvironment, ICarsService carsService, ISalesService salesService, ICategoriesService categoriesService, IMakesService makesService, IModelsService modelsService, IFuelTypesService fuelTypesService, IEuroStandartsService euroStandartsService, IGearboxesService gearboxesService, IColorsService colorsService, ICountriesService countriessService, ICitiesService citiesService, UserManager <ApplicationUser> userManager, ICaptchaValidator captchaValidator) { this.webHostEnvironment = webHostEnvironment; this.carsService = carsService; this.salesService = salesService; this.categoriesService = categoriesService; this.makesService = makesService; this.modelsService = modelsService; this.fuelTypesService = fuelTypesService; this.euroStandartsService = euroStandartsService; this.gearboxesService = gearboxesService; this.colorsService = colorsService; this.countriesService = countriessService; this.citiesService = citiesService; this.userManager = userManager; this.captchaValidator = captchaValidator; }
public CustomerAddingAd() { InitializeComponent(); _adService = InstanceFactory.GetInstance <IAdService>(); _cityService = InstanceFactory.GetInstance <ICityService>(); _carsService = InstanceFactory.GetInstance <ICarsService>(); }
public void Init() { this.ConfigureMapper(); this.cars = new List <Car>() { new Car() { Id = 1, Price = 20, Name = "Volga" }, new Car() { Id = 2, Price = 30, Name = "Chaika" } }; this._context = new FakeCarsDbContext(); foreach (var car in cars) { this._context.Cars.Add(car); } HttpConfiguration config = new HttpConfiguration(); this._service = new CarsService(this._context); this._controller = new CarsController(this._service); this._controller.Configuration = config; }
public AllCarsPresenter(IAllCarsViewModel view, ICarsService service) : base(view) { this.service = service; this.View.OnCarsGetData += this.View_OnCarsGetData; }
public AdminForm() { InitializeComponent(); _adService = InstanceFactory.GetInstance <IAdService>(); _cityService = InstanceFactory.GetInstance <ICityService>(); _carsService = InstanceFactory.GetInstance <ICarsService>(); }
public IActionResult IndexPartial([FromServices] ICarsService carsService, [FromServices] UserManager <ApplicationUser> userManager) { int userId = int.Parse(userManager.GetUserId(User)); var cars = carsService.GetAllCarsIndex(userId); return(this.View("_IndexPartial", cars)); }
public void ThrowNullReferenceException_WhenCarsService_IsNull() { // Arrange ICarsService service = null; // Act & Assert Assert.Throws <NullReferenceException>(() => new AddUserController(service)); }
public UserAllRegisteredVehiclesViewComponent( ICarsService carsService, UserManager <ApplicationUser> userManager, IUsersService usersService) { this.carsService = carsService; this.userManager = userManager; this.usersService = usersService; }
public CarsController(IBodyTypesService bodyTypesService, ICarModelsService carModelsService, ICarsService carsService, UserManager <ApplicationUser> userManager, IWebHostEnvironment environment) { this.bodyTypesService = bodyTypesService; this.carModelsService = carModelsService; this.carsService = carsService; this.userManager = userManager; this.environment = environment; }
public CarsController(ILocationsService locationsService, IMapper mapper, ICarsService carsService, Cloudinary cloudinary, IImagesService imagesService) { this.locationsService = locationsService; this.mapper = mapper; this.carsService = carsService; this.cloudinary = cloudinary; this.imagesService = imagesService; }
public CarDetailsPresenter(ICarDetailsViewModel view, ICarsService carsService, IUsersService usersService) : base(view) { this.carsService = carsService; this.usersService = usersService; this.View.OnCarGetData += this.View_OnCarGetData; }
public CustomerDetailsPresenter(ICustomerDetailsViewModel view, IUsersService userService, ICarsService carService) : base(view) { this.userService = userService; this.carService = carService; this.View.OnCustomerDetails += this.View_OnCustomerDetails; }
public CarsController(ICarsService carsService) { _carsService = carsService; }
public CarsCountService (ICarsService carsService) { _carsService = carsService; }
public CarsController(ICarsService carsService) { if (carsService == null) throw new ArgumentNullException(nameof(carsService)); this.carsService = carsService; }