public bool ApproveReservation(int id) { SportsSide.DAL.RESERVATION model = new SportsSide.DAL.RESERVATION(); model = webApi.GetReservationFromReservationId(id); model.STATUS = "A"; var result = webApi.PutReservation(model); TempData["selectedTab"] = 1; //Bilgilendirme Maili MailMessage mesajim = new MailMessage(); SmtpClient istemci = new SmtpClient(); istemci.Credentials = new System.Net.NetworkCredential("*****@*****.**", "CunMerMus123"); istemci.Port = 587; istemci.Host = "mail.sportsside.net"; istemci.EnableSsl = false; mesajim.IsBodyHtml = true; mesajim.To.Add(model.USERS.USER_MAIL); mesajim.From = new MailAddress("*****@*****.**", "SportsSide"); mesajim.Subject = "Rezervasyonunuz Onaylanmıştır"; mesajim.Body = "<table style='background-color: #f6f6f6;width: 100%;'><tr><td></td><td style='display: block !important;max-width: 600px !important;margin: 0 auto !important;clear: both !important;' width='600'><div style='max-width: 600px;margin: 0 auto;display: block;padding: 20px;'><table style='background: #fff;border: 1px solid #e9e9e9;border-radius: 3px;' width='100%' cellpadding='0' cellspacing='0'><tr><td style='background: #68b90f;font-size: 16px;color: #fff;font-weight: 500;padding: 20px;text-align: center;border-radius: 3px 3px 0 0;'>Rezervasyonunuz Onaylanmıştır!</td></tr><tr><td style='padding: 20px;'><table width = '100%' cellpadding='0' cellspacing='0'><tr><td style='padding: 0 0 20px; color:#000;'>Merhaba<strong> " + model.USERS.USER_FIRST_NAME + " " + model.USERS.USER_SURNAME + "</strong> ,</td></tr><tr><td style='padding: 0 0 20px; color:#000;'>Rezervasyonunuz tesis sahibi tarafından onaylanmıştır. Keyifli zaman geçirmenizi dileriz :)</td></tr><tr><td style='padding: 0 0 20px; color:#000;'><strong>Tesis Adı :</strong> " + model.FACILITY.FACILITY_NAME + " <br><strong>Başlangıç Tarihi :</strong> " + model.DT_BEGIN.ToString("dd/MM/yyyy H:mm") + " <br><strong>Bitiş Tarihi :</strong> " + model.DT_END.ToString("dd/MM/yyyy H:mm") + " <br><strong>Oluşturulma Tarihi :</strong> " + model.CREATED_DATE.ToString("dd/MM/yyyy H:mm") + " <br><strong>Kişi Sayısı :</strong> " + model.COUNT + " <br><strong>Tesis Adresi :</strong> " + model.FACILITY.FACILITY_ADDRESS + "<br></td></tr><tr><td style='padding: 0 0 20px;'><a href = 'http://localhost:30471/Member/Index' style='text-decoration: none;color: #FFF;background-color: #348eda;border: solid #348eda;border-width: 10px 20px;line-height: 2;font-weight: bold;text-align: center;cursor: pointer;display: inline-block;border-radius: 5px;text-transform: capitalize;'>Rezervasyonları Görüntüle</a></td></tr><tr><td style='padding: 0 0 20px; color:#000;'>SportsSide'ı seçtiğiniz için teşekkür ederiz.</td></tr></table></td></tr></table></td><td></td></tr></table>"; //mesajim.Body = "Merhaba <b>" + user.USER_FIRST_NAME + "</b> " + user.USER_SURNAME + ", rezervasyonunuz tesis sahibine iletilmiştir. Tesis sahibinden geri dönüş aldığımız an size tekrar mail yoluyla bilgilendirme yapılacaktır. Bizi seçtiğiniz için teşekkür ederiz!"; object userState = mesajim; istemci.Send(mesajim); // return(result); }
public bool RejectReservation(int id) { SportsSide.DAL.RESERVATION model = new SportsSide.DAL.RESERVATION(); model = webApi.GetReservationFromReservationId(id); model.STATUS = "R"; var result = webApi.PutReservation(model); return(result); }
public JsonResult Create(int facilityId, DateTime date, string hour, int count) { string cookieName = FormsAuthentication.FormsCookieName; //Find cookie name HttpCookie authCookie = HttpContext.Request.Cookies[cookieName]; //Get the cookie by it's name FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value); //Decrypt it string UserName = ticket.Name; //You have the UserName! var user = webApi.GetUser(UserName); //var facility = webApi.GetFacility(model.Facility.FACILITY_ID); var newBeginDate = new DateTime(date.Year, date.Month, date.Day, int.Parse(hour), 0, 0); if (hour == "23") { date = date.AddDays(1); hour = "-1"; } var newEndDate = new DateTime(date.Year, date.Month, date.Day, int.Parse(hour) + 1, 0, 0); SportsSide.DAL.RESERVATION rsvModel = new SportsSide.DAL.RESERVATION(); rsvModel.USER_ID = user.USER_ID; rsvModel.FACILITY_ID = facilityId; rsvModel.DT_BEGIN = newBeginDate; rsvModel.DT_END = newEndDate; rsvModel.CREATED_DATE = System.DateTime.Now; rsvModel.STATUS = "P"; rsvModel.COUNT = count; //rsvModel.USERS = user; //rsvModel.FACILITY = facility; var result = webApi.PostReservation(rsvModel); var facility = webApi.GetFacility(facilityId); //Bilgilendirme Maili MailMessage mesajim = new MailMessage(); SmtpClient istemci = new SmtpClient(); istemci.Credentials = new System.Net.NetworkCredential("*****@*****.**", "CunMerMus123"); istemci.Port = 587; istemci.Host = "mail.sportsside.net"; istemci.EnableSsl = false; mesajim.IsBodyHtml = true; mesajim.To.Add(user.USER_MAIL); mesajim.From = new MailAddress("*****@*****.**", "SportsSide"); mesajim.Subject = "Rezervasyonunuz İletilmiştir"; mesajim.Body = "<table style='background-color: #f6f6f6;width: 100%;'><tr><td></td><td style='display: block !important;max-width: 600px !important;margin: 0 auto !important;clear: both !important;' width='600'><div style='max-width: 600px;margin: 0 auto;display: block;padding: 20px;'><table style='background: #fff;border: 1px solid #e9e9e9;border-radius: 3px;' width='100%' cellpadding='0' cellspacing='0'><tr><td style='background: #68b90f;font-size: 16px;color: #fff;font-weight: 500;padding: 20px;text-align: center;border-radius: 3px 3px 0 0;'>Rezervasyonunuz iletilmiştir!</td></tr><tr><td style='padding: 20px;'><table width = '100%' cellpadding='0' cellspacing='0'><tr><td style='padding: 0 0 20px; color:#000;'>Merhaba<strong> " + user.USER_FIRST_NAME + " " + user.USER_SURNAME + "</strong> ,</td></tr><tr><td style='padding: 0 0 20px; color:#000;'>Rezervasyonunuz tesis sahibine iletilmiştir.Tesis sahibinden geri dönüş aldığımız an size tekrar mail yoluyla bilgilendirme yapılacaktır.</td></tr><tr><td style='padding: 0 0 20px; color:#000;'><strong>Tesis Adı :</strong> " + facility.FACILITY_NAME + " <br><strong>Başlangıç Tarihi :</strong> " + newBeginDate.ToString("dd/MM/yyyy H:mm") + " <br><strong>Bitiş Tarihi :</strong> " + newEndDate.ToString("dd/MM/yyyy H:mm") + " <br><strong>Oluşturulma Tarihi :</strong> " + System.DateTime.Now.ToString("dd/MM/yyyy H:mm") + " <br><strong>Kişi Sayısı :</strong> " + count + " <br><strong>Tesis Adresi :</strong> " + facility.FACILITY_ADDRESS + "<br></td></tr><tr><td style='padding: 0 0 20px;'><a href = 'http://localhost:30471/Member/Index' style='text-decoration: none;color: #FFF;background-color: #348eda;border: solid #348eda;border-width: 10px 20px;line-height: 2;font-weight: bold;text-align: center;cursor: pointer;display: inline-block;border-radius: 5px;text-transform: capitalize;'>Rezervasyonları Görüntüle</a></td></tr><tr><td style='padding: 0 0 20px; color:#000;'>SportsSide'ı seçtiğiniz için teşekkür ederiz.</td></tr></table></td></tr></table></td><td></td></tr></table>"; //mesajim.Body = "Merhaba <b>" + user.USER_FIRST_NAME + "</b> " + user.USER_SURNAME + ", rezervasyonunuz tesis sahibine iletilmiştir. Tesis sahibinden geri dönüş aldığımız an size tekrar mail yoluyla bilgilendirme yapılacaktır. Bizi seçtiğiniz için teşekkür ederiz!"; object userState = mesajim; istemci.Send(mesajim); // return(Json(result)); //return RedirectToAction("Index", "Member"); }