public async Task <IActionResult> Create() { var types = this.offertService.GetAllOffertTypes().MapTo <OffertTypeInputModel[]>(); var result = new OffertInputModel() { Categories = types, }; return(this.View(result)); }
public async Task <IActionResult> Create(OffertInputModel input) { if (!this.ModelState.IsValid) { return(await this.Create()); } var user = this.userService.GetApplicationUserByName(this.User.Identity.Name); await this.offertService.CreateOffert(input.Title, input.Type, input.Review, input.Features, input.Contract, user.Id, input.Tel, input.Price, input.Town); return(this.Redirect(Common.GlobalConstants.HomeUrl)); }