public bool Post(string email, GisbuyModel model) { bool added = false; // string email = "*****@*****.**"; added = bl.AddtoCart(email, model.Proid, model.Proname, model.Proprice, model.Proimage); return(added); }
// [SkipMyGlobalActionFilter] // GET api/values/5 public bool Post(GisbuyModel user) { bool log = bl.AdminLogin(user.Adminid, user.Adminpass); return(log); //if(log) //{ // IAuthContainerModel model = GetJWTContainerModel(user.Adminid); // IAuthService authService = new JWTService(model.SecretKey); // string token = authService.GenerateToken(model); // var message = Request.CreateResponse(HttpStatusCode.OK, "Authentication successful"); // message.Headers.Add("JWT_TOKEN", token); // return token; //} //else //{ // throw new HttpResponseException(HttpStatusCode.Unauthorized); //// return Request.CreateErrorResponse(HttpStatusCode.Forbidden, "Authentication Failed"); //} }
// PUT api/values/5 public bool Put([FromBody] GisbuyModel model) { bool updated = false; updated = bl.UpdateTheProduct(model); if (updated) { MailMessage mail = new MailMessage(); SmtpClient SmtpServer = new SmtpClient("smtp.gmail.com"); mail.From = new MailAddress("*****@*****.**"); mail.To.Add("*****@*****.**"); mail.Subject = "Test Mail"; mail.Body = "This is for testing SMTP mail from GMAIL"; SmtpServer.Port = 587; SmtpServer.Credentials = new System.Net.NetworkCredential("*****@*****.**", "TRIPLE A"); SmtpServer.EnableSsl = true; SmtpServer.Send(mail); // MessageBox.Show("mail Send"); } return(updated); }