Exemplo n.º 1
0
        public async Task <IActionResult> PutNewUserSignUpModel(int id, NewUserSignUpModel newUserSignUpModel)
        {
            if (id != newUserSignUpModel.Id)
            {
                return(BadRequest());
            }

            _context.Entry(newUserSignUpModel).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!NewUserSignUpModelExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Exemplo n.º 2
0
        public async Task Send(NewUserSignUpModel newUserSignUpModel)
        {
            EmailMessage message = new EmailMessage();

            message.To = new MailboxAddress(newUserSignUpModel.Email);
            // Console.WriteLine(newUserSignUpModel.Email);
            message.Subject = "Booking Order Details";
            message.Content = string.Format("Dear {0}.\n " +
                                            "Firstly, Thank You for placing an order by using 7 Hills Application. \n" +
                                            "Your Booking Order Id is : {1}. \n" +
                                            "But Currently we are not taking any order and this application is under contruction may be you can meet us in Future.\n " +
                                            "If you find any problem with this application or if you any suggestions for us you are contact us by [email protected].\n" +
                                            "\n Thank You and Best Regards.\n Bharath", newUserSignUpModel.UserName, newUserSignUpModel.Id);
            await _emailSenderInterface.SendEmailAsync(message);
        }
Exemplo n.º 3
0
        public async Task <ActionResult <NewUserSignUpModel> > PostNewUserSignUpModel([FromForm] NewUserSignUpModel newUserSignUpModel)
        {
            try
            {
                //NewUserSignUpModel newUserSignUpModel = new NewUserSignUpModel();
                await Send(newUserSignUpModel);

                Console.WriteLine(newUserSignUpModel);
                _context.newUserSignUps.Add(newUserSignUpModel);
                await _context.SaveChangesAsync();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(StatusCode(201));
            //return CreatedAtAction("GetNewUserSignUpModel", new { id = newUserSignUpModel.Id }, newUserSignUpModel);
        }