public MyTransactionModel CreateMyTransaction(MyTransactionModel Transaction) { var Trans = _mapper.Map <MyTransaction>(Transaction); _myTransactionsRepository.CreatMyTransaction(Trans); return(Transaction); }
public ActionResult SaveServiceTransaction(MyTransactionModel model) { try { return(Json(new { Msg = (new MyTransactionModel().SaveServiceTransaction(model)) }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { Msg = ex.Message }, JsonRequestBehavior.AllowGet)); } }
public ActionResult SaveUpdateTransaction(MyTransactionModel model, string NameOnCardString, string NumberOnCardString, string ExpirationMonthOnCardString, string ExpirationYearOnCardString) { try { return(Json(new { Msg = (new MyTransactionModel().SaveUpdateTransaction(model)) }, JsonRequestBehavior.AllowGet)); } catch (Exception ex) { return(Json(new { Msg = ex.Message }, JsonRequestBehavior.AllowGet)); } }
public string SaveUpdateAmenityRequestStatus(string AmenityName, int ARID, int Status) { string msg = ""; ShomaRMEntities db = new ShomaRMEntities(); if (ARID != 0) { var GetARRData = db.tbl_AmenityReservation.Where(p => p.ARID == ARID).FirstOrDefault(); if (GetARRData != null) { DateTime dtF = DateTime.Parse(GetARRData.DesiredTimeFrom != null ? GetARRData.DesiredTimeFrom : "00:00"); DateTime dtT = DateTime.Parse(GetARRData.DesiredTimeTo != null ? GetARRData.DesiredTimeTo : "00:00"); DesiredTimeFrom = dtF.ToString("HH:mm"); DesiredTimeTo = dtT.ToString("HH:mm"); GetARRData.Status = Status; db.SaveChanges(); msg = "Reservation Request Status Updated Successfully"; var GetTenantData = db.tbl_TenantInfo.Where(p => p.TenantID == GetARRData.TenantID).FirstOrDefault(); string reportHTML = ""; //string filePath = HttpContext.Current.Server.MapPath("~/Content/Template/"); string filePath = HttpContext.Current.Server.MapPath("~/Content/Templates/"); //reportHTML = System.IO.File.ReadAllText(filePath + "EmailTemplateAmenity.html"); reportHTML = System.IO.File.ReadAllText(filePath + "EmailTemplateProspect.html"); string message = ""; string phonenumber = ""; string payid = ""; if (GetTenantData != null) { phonenumber = GetTenantData.Mobile; DateTime?arDate = null; try { arDate = Convert.ToDateTime(GetARRData.DesiredDate); } catch { } var tm = new MyTransactionModel(); reportHTML = reportHTML.Replace("[%ServerURL%]", serverURL); reportHTML = reportHTML.Replace("[%TodayDate%]", DateTime.Now.ToString("dddd,dd MMMM yyyy")); //reportHTML = reportHTML.Replace("[%EmailHeader%]", "Amenity Reservation Request Status"); //reportHTML = reportHTML.Replace("[%TenantName%]", GetTenantData.FirstName + " " + GetTenantData.LastName); if (Status == 1) { //payment //ARID = " + ARID + " & FromAcc = 0 payid = new EncryptDecrypt().EncryptText(ARID.ToString() + ",0"); string emailBody = ""; emailBody += "<p style=\"margin-bottom: 0px;\">Dear " + GetTenantData.FirstName + " " + GetTenantData.LastName + "</p>"; emailBody += "<p style=\"margin-bottom: 0px;\">We hereby approve your reservation of the " + AmenityName + " (facility) on " + arDate.Value.ToString("MM/dd/yyyy") + " (date) at " + GetARRData.DesiredTimeFrom + "to " + GetARRData.DesiredTimeTo + " (time) for a total of " + GetARRData.Duration + " (hours). For your reservation to be confirmed, the security deposit and reservation fee must be paid. If you desire to make your payment now, kindly follow this link. Please note that the date will not be reserved in the system until payment is received.</p>"; emailBody += "<p style=\"margin-bottom: 20px;text-align: center;\"><a href=\"" + serverURL + "/PayLink/PayAmenityCharges/?pid=" + payid + "\" class=\"link-button\" target=\"_blank\">PAY NOW</a></p>"; reportHTML = reportHTML.Replace("[%EmailBody%]", emailBody); //reportHTML = reportHTML.Replace("[%EmailBody%]", " <p style='font-size: 14px; line-height: 21px; text-align: justify; margin: 0;'> We hereby approve your reservation of the " + AmenityName + " (facility) on " + arDate.Value.ToString("MM/dd/yyyy") + " (date) at " + GetARRData.DesiredTimeFrom + "to " + GetARRData.DesiredTimeTo + " (time) for a total of " + GetARRData.Duration + " (hours). For your reservation to be confirmed, the security deposit and reservation fee must be paid. If you desire to make your payment now, kindly follow this link. Please note that the date will not be reserved in the system until payment is received. </p>"); //reportHTML = reportHTML.Replace("[%LeaseNowButton%]", "<!--[if mso]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-spacing: 0; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;\"><tr><td style=\"padding-top: 25px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px\" align=\"center\"><v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"" + serverURL + "/PayLink/PayAmenityCharges/?pid=" + payid + "\" style=\"height:46.5pt; width:168.75pt; v-text-anchor:middle;\" arcsize=\"7%\" stroke=\"false\" fillcolor=\"#a8bf6f\"><w:anchorlock/><v:textbox inset=\"0,0,0,0\"><center style=\"color:#ffffff; font-family:'Trebuchet MS', Tahoma, sans-serif; font-size:16px\"><![endif]--> <a href=\"" + serverURL + "/PayLink/PayAmenityCharges/?pid=" + payid + "\" style=\"-webkit-text-size-adjust: none; text-decoration: none; display: inline-block; color: #ffffff; background-color: #a8bf6f; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; width: auto; width: auto; border-top: 1px solid #a8bf6f; border-right: 1px solid #a8bf6f; border-bottom: 1px solid #a8bf6f; border-left: 1px solid #a8bf6f; padding-top: 15px; padding-bottom: 15px; font-family: 'Montserrat', 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif; text-align: center; mso-border-alt: none; word-break: keep-all;\" target=\"_blank\"><span style=\"padding-left:15px;padding-right:15px;font-size:16px;display:inline-block;\"><span style=\"font-size: 16px; line-height: 32px;\">PAY NOW</span></span></a><!--[if mso]></center></v:textbox></v:roundrect></td></tr></table><![endif]-->"); message = "Your reservation to be confirmed, the security deposit and reservation fees must be paid. Please check the email for detail."; } else if (Status == 2) { //Desposte payid = new EncryptDecrypt().EncryptText(ARID.ToString() + ",0"); string emailBody = ""; emailBody += "<p style=\"margin-bottom: 0px;\">Dear " + GetTenantData.FirstName + " " + GetTenantData.LastName + "</p>"; emailBody += "<p style=\"margin-bottom: 0px;\">We hereby approve your reservation of the " + AmenityName + " (facility) on " + arDate.Value.ToString("MM/dd/yyyy") + " (date) at " + GetARRData.DesiredTimeFrom + "to " + GetARRData.DesiredTimeTo + " (time) for a total of " + GetARRData.Duration + " (hours). For your reservation to be Completed. Please pay your deposit. If you desire to make your payment now, kindly follow this link. Please note that the date will not be reserved in the system until payment is received.</p>"; emailBody += "<p style=\"margin-bottom: 20px;text-align: center;\"><a href=\"" + serverURL + "/PayLink/PayAmenityCharges/?pid=" + payid + "\" class=\"link-button\" target=\"_blank\">PAY NOW</a></p>"; reportHTML = reportHTML.Replace("[%EmailBody%]", emailBody); //reportHTML = reportHTML.Replace("[%EmailBody%]", " <p style='font-size: 14px; line-height: 21px; text-align: justify; margin: 0;'> We hereby approve your reservation of the " + AmenityName + " (facility) on " + arDate.Value.ToString("MM/dd/yyyy") + " (date) at " + GetARRData.DesiredTimeFrom + "to " + GetARRData.DesiredTimeTo + " (time) for a total of " + GetARRData.Duration + " (hours). For your reservation to be Completed. Please pay your deposit. If you desire to make your payment now, kindly follow this link. Please note that the date will not be reserved in the system until payment is received. </p>"); //reportHTML = reportHTML.Replace("[%LeaseNowButton%]", "<!--[if mso]><table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"border-spacing: 0; border-collapse: collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;\"><tr><td style=\"padding-top: 25px; padding-right: 10px; padding-bottom: 10px; padding-left: 10px\" align=\"center\"><v:roundrect xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:w=\"urn:schemas-microsoft-com:office:word\" href=\"" + serverURL + "/PayLink/PayAmenityCharges/?pid=" + payid + "\" style=\"height:46.5pt; width:168.75pt; v-text-anchor:middle;\" arcsize=\"7%\" stroke=\"false\" fillcolor=\"#a8bf6f\"><w:anchorlock/><v:textbox inset=\"0,0,0,0\"><center style=\"color:#ffffff; font-family:'Trebuchet MS', Tahoma, sans-serif; font-size:16px\"><![endif]--> <a href=\"" + serverURL + "/PayLink/PayAmenityCharges/?pid=" + payid + "\" style=\"-webkit-text-size-adjust: none; text-decoration: none; display: inline-block; color: #ffffff; background-color: #a8bf6f; border-radius: 4px; -webkit-border-radius: 4px; -moz-border-radius: 4px; width: auto; width: auto; border-top: 1px solid #a8bf6f; border-right: 1px solid #a8bf6f; border-bottom: 1px solid #a8bf6f; border-left: 1px solid #a8bf6f; padding-top: 15px; padding-bottom: 15px; font-family: 'Montserrat', 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif; text-align: center; mso-border-alt: none; word-break: keep-all;\" target=\"_blank\"><span style=\"padding-left:15px;padding-right:15px;font-size:16px;display:inline-block;\"><span style=\"font-size: 16px; line-height: 32px;\">PAY NOW</span></span></a><!--[if mso]></center></v:textbox></v:roundrect></td></tr></table><![endif]-->"); message = "Your reservation to be Completed. Please pay your deposit. Please check the email for detail."; } else { // Cancel string emailBody = ""; emailBody += "<p style=\"margin-bottom: 0px;\">Dear " + GetTenantData.FirstName + " " + GetTenantData.LastName + "</p>"; emailBody += "<p style=\"margin-bottom: 0px;\">We are sorry for your reservation of the " + AmenityName + " (facility) on " + arDate.Value.ToString("MM/dd/yyyy") + " (date) at " + GetARRData.DesiredTimeFrom + "to " + GetARRData.DesiredTimeTo + " (time) for a total of " + GetARRData.Duration + " (hours). Your reservation date is not be available.</p>"; reportHTML = reportHTML.Replace("[%EmailBody%]", emailBody); //reportHTML = reportHTML.Replace("[%EmailBody%]", " <p style='font-size: 14px; line-height: 21px; text-align: justify; margin: 0;'> We are sorry for your reservation of the " + AmenityName + " (facility) on " + arDate.Value.ToString("MM/dd/yyyy") + " (date) at " + GetARRData.DesiredTimeFrom + "to " + GetARRData.DesiredTimeTo + " (time) for a total of " + GetARRData.Duration + " (hours). Your reservation date is not be available. </p>"); //reportHTML = reportHTML.Replace("[%LeaseNowButton%]", ""); message = "Your reservation is cancelled due to date is not be available. Please check the email for detail."; } //reportHTML = reportHTML.Replace("[%TenantEmail%]", GetTenantData.Email); } string body = reportHTML; new ShomaRM.Models.EmailSendModel().SendEmail(GetTenantData.Email, "Amenity Reservation Request Status", body); if (SendMessage == "yes") { if (!string.IsNullOrWhiteSpace(phonenumber)) { new TwilioService().SMS(phonenumber, message); } } } } db.Dispose(); return(msg); }