예제 #1
0
        public async Task <IActionResult> Create()
        {
            var types = this.offertService.GetAllOffertTypes().MapTo <OffertTypeInputModel[]>();

            var result = new OffertInputModel()
            {
                Categories = types,
            };

            return(this.View(result));
        }
예제 #2
0
        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));
        }