public static string FncSendReminderMailToClient(string emailAddress, string AdminEmailIds, long stratasBoardId, string message) { try { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); StrataBoardModel strataBoardModel = new StrataBoardModel(); strataBoardModel = strataBoardHelper.GetStratasBoardByID(stratasBoardId); //string url = ConfigurationManager.AppSettings["WebsiteRootPath"].ToString(); //EmailSender objClsMail = GetCommonDataForSendMail(emailAddress, "Reminder from StratasFair"); //StringBuilder mailBody = new StringBuilder(); //mailBody.Append(getConfigValue("stratasboard-reminder-mail").Replace("{NAME}", strataBoardModel.StratasBoardName)); //mailBody.Replace("{BASEPATH}", url); //mailBody.Replace("{MESSAGE}", message); //objClsMail.Body = mailBody.ToString(); //objClsMail.Bcc = AdminEmailIds; //for attachment //objClsMail.AttachmentList = new ArrayList(1); //objClsMail.AttachmentList.Add(System.Web.HttpContext.Current.Server.MapPath(objOrder.InvoiceFilePath)); //objClsMail = FncSendMail(objClsMail); //return objClsMail.ErrorMessage; return("success"); } catch { return(""); } }
private ActionResult BindSubscriptionList(SubscriptionModel subscriptionModel) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); var List = strataBoardHelper.GetStrataBoardSubscription(subscriptionModel.StratasBoardId); SubscriptionActiveList = List.OrderByDescending(x => x.Status).ToList(); return(View(Tuple.Create(SubscriptionActiveList, subscriptionModel))); }
public ActionResult Add(StrataBoardModel strataBoardModel) { if (ModelState.IsValid) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); long stratasBoardId = strataBoardHelper.AddUpdate(strataBoardModel); if (stratasBoardId > 0) { // stratas board admin added successfully try { // send mail to stratas board admin with auto generate password. string result = EmailSender.FncSend_StratasBoard_RegistrationMail_ToClient(stratasBoardId); if (result == "success") { TempData["CommonMessage"] = AppLogic.setMessage(0, "Record added successfully."); } else { TempData["CommonMessage"] = AppLogic.setMessage(2, "Error, while sending email to stratasboard administrator. Resend mail again."); } } catch (Exception ex) { new AppError().LogMe(ex); } return(RedirectToAction("Index")); } else if (stratasBoardId == -4) { TempData["CommonMessage"] = AppLogic.setMessage(1, "Stratasboard name already exists."); ViewBag.StatusList = AppLogic.BindDDStatus(1); return(View(strataBoardModel)); } else if (stratasBoardId == -5) { TempData["CommonMessage"] = AppLogic.setMessage(1, "Unique name already exists."); ViewBag.StatusList = AppLogic.BindDDStatus(1); return(View(strataBoardModel)); } else if (stratasBoardId == -6) { TempData["CommonMessage"] = AppLogic.setMessage(1, "Email address already exists."); ViewBag.StatusList = AppLogic.BindDDStatus(1); return(View(strataBoardModel)); } else { ViewBag.StatusList = AppLogic.BindDDStatus(1); TempData["CommonMessage"] = AppLogic.setMessage(2, "Error, Please try again."); return(View(strataBoardModel)); } } ViewBag.StatusList = AppLogic.BindDDStatus(1); return(View(strataBoardModel)); }
public ActionResult Index() { DashBoardModel dashBoardModel = new DashBoardModel(); StrataBoardHelper helper = new StrataBoardHelper(); dashBoardModel.StrataBoardExpiringList = helper.GetStrataBoardToBeExpired(); return(View(dashBoardModel)); }
private ActionResult BindList(StrataBoardModel strataBoardModel) { StrataBoardHelper _Helper = new StrataBoardHelper(); var List = _Helper.GetAll(strataBoardModel); ActiveList = List.Where(x => x.Status == 1).ToList(); InActiveList = List.Where(x => x.Status == 0).ToList(); return(View(Tuple.Create(ActiveList, InActiveList, strataBoardModel))); }
public ActionResult Edit(long?Id) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); StrataBoardModel strataBoardModel = new StrataBoardModel(); strataBoardModel = strataBoardHelper.GetStratasBoardByID(Id.Value); ViewBag.StatusList = AppLogic.BindDDStatus(Convert.ToInt32(strataBoardModel.Status)); return(View(strataBoardModel)); }
public ActionResult UniqueURLRequest(RequestPortalLinkModel model) { int result = 0; if (ClientSessionData.UserClientId != 0) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); result = strataBoardHelper.UpdateURLRequestPortalLink(model); } return(Redirect(Url.Content("~/" + ClientSessionData.ClientPortalLink + "/settings/UniqueURLRequest"))); }
public ActionResult UniqueURLRequest() { RequestPortalLinkModel model = new RequestPortalLinkModel(); if (ClientSessionData.UserClientId != 0) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); model = strataBoardHelper.GetStratasBoardPortalLinkDetails(ClientSessionData.ClientStrataBoardId); } return(View(model)); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { // check sessions here if (filterContext.ActionDescriptor.ActionName.ToLower() != "fileuploads") { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); var urlBuilder = new System.UriBuilder(HttpContext.Current.Request.Url.AbsoluteUri); Uri uri = urlBuilder.Uri; string Url = urlBuilder.Path; string PortalUrl = string.Empty; if (urlBuilder.Uri.Authority.Contains("demo2projects")) { PortalUrl = urlBuilder.Uri.AbsolutePath.Replace("/stratasfair/", "").ToString(); } else { PortalUrl = urlBuilder.Uri.AbsolutePath.TrimStart('/').ToString(); } int endIndex = PortalUrl.IndexOf('/'); PortalUrl = PortalUrl.Substring(0, endIndex); bool IsValid = strataBoardHelper.IsValidPortalLink(PortalUrl); if (IsValid) { if (ClientSessionData.UserClientId == 0) { filterContext.Result = new RedirectResult(ConfigurationManager.AppSettings["WebsiteRootPath"].ToString() + PortalUrl + "/login"); } else if (ClientSessionData.UserClientId > 0) { if (ClientSessionData.ClientPortalLink != PortalUrl) { filterContext.Result = new RedirectResult(ConfigurationManager.AppSettings["WebsiteRootPath"].ToString() + PortalUrl + "/logon/notbelonguser"); } else if (ClientSessionData.ClientRoleName.ToLower() == "owner" && !ClientSessionData.ClientIsProfileCompleted) { filterContext.Result = new RedirectResult(ConfigurationManager.AppSettings["WebsiteRootPath"].ToString() + PortalUrl + "/logon/completeprofile"); } } } else { filterContext.Result = new RedirectResult(ConfigurationManager.AppSettings["WebsiteRootPath"].ToString() + PortalUrl + "/logon/invalidportallink"); // redirect to page not found } } base.OnActionExecuting(filterContext); }
public ActionResult Edit(StrataBoardModel strataBoardModel) { ModelState.Remove("SubscriptionId"); if (ModelState.IsValid) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); long stratasBoardId = strataBoardHelper.AddUpdate(strataBoardModel); if (stratasBoardId > 0) { // send mail to stratas board admin with updated unique URL. if (strataBoardModel.OldPortalLink.Trim() != strataBoardModel.PortalLink.Trim()) { string result = EmailSender.FncSend_StratasBoard_UniqueURLUpdate_ToClient(stratasBoardId); } TempData["CommonMessage"] = AppLogic.setMessage(0, "Record updated successfully."); return(RedirectToAction("Index")); } else if (stratasBoardId == -4) { TempData["CommonMessage"] = AppLogic.setMessage(1, "Stratasboard name already exists."); } else if (stratasBoardId == -5) { TempData["CommonMessage"] = AppLogic.setMessage(1, "Unique name already exists."); } else if (stratasBoardId == -6) { TempData["CommonMessage"] = AppLogic.setMessage(1, "Email address already exists."); } else if (stratasBoardId == -7) { TempData["CommonMessage"] = AppLogic.setMessage(1, "Unique name can't be updated."); } else { TempData["CommonMessage"] = AppLogic.setMessage(2, "Error, Please try again."); } } ViewBag.StatusList = AppLogic.BindDDStatus(Convert.ToInt32(strataBoardModel.Status)); return(View(strataBoardModel)); }
public ActionResult Deactive(long Id) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); StrataBoardModel strataBoardModel = new StrataBoardModel(); strataBoardModel = strataBoardHelper.GetStratasBoardByID(Id); strataBoardModel.Status = 0; int count = strataBoardHelper.ActDeact(strataBoardModel); if (count == 0) { TempData["CommonMessage"] = AppLogic.setMessage(count, "Record deactivated successfully."); } else { TempData["CommonMessage"] = AppLogic.setMessage(count, "Record deactivation failed."); } return(RedirectToAction("Index")); }
public ActionResult UniqueURLRequest(RequestPortalLinkModel objModel) { int result = 0; if (ClientSessionData.UserClientId != 0) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); result = strataBoardHelper.UpdateURLRequestPortalLink(objModel); if (result == 1) { TempData["CommonMessage"] = AppLogic.setFrontendMessage(0, "Request has been sent sucessfully"); } else if (result == 0) { TempData["CommonMessage"] = AppLogic.setFrontendMessage(0, "The Url have already once before"); } } return(Redirect(Url.Content("~/" + ClientSessionData.ClientPortalLink + "/settings/UniqueURLRequest"))); }
public ActionResult Delete(long Id) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); StrataBoardModel strataBoardModel = new StrataBoardModel(); strataBoardModel = strataBoardHelper.GetStratasBoardByID(Id); int count = strataBoardHelper.Delete(strataBoardModel); if (count == 0) { TempData["CommonMessage"] = AppLogic.setMessage(count, "Record deleted successfully."); } else if (count == -2) { TempData["CommonMessage"] = AppLogic.setMessage(count, "Record can't be deleted as other users exists."); } else { TempData["CommonMessage"] = AppLogic.setMessage(count, "Record deletion failed."); } return(RedirectToAction("Index")); }
public ActionResult AddSubscription(RenewSubscriptionModel renewSubscriptionModel) { if (ModelState.IsValid) { StrataBoardHelper strataBoardHelper = new StrataBoardHelper(); int stratasBoardSubscriptionId = strataBoardHelper.RenewSubscription(renewSubscriptionModel); if (stratasBoardSubscriptionId > 0) { TempData["CommonMessage"] = AppLogic.setMessage(0, "Record updated successfully."); return(RedirectToAction("listsubscription/" + renewSubscriptionModel.StratasBoardId)); } else if (stratasBoardSubscriptionId == -1) { TempData["CommonMessage"] = AppLogic.setMessage(2, "StratasBoard Users are more than subscription package allowed user. select another subscription."); return(View(renewSubscriptionModel)); } else { TempData["CommonMessage"] = AppLogic.setMessage(2, "Error, Please try again."); return(View(renewSubscriptionModel)); } } return(View(renewSubscriptionModel)); }
public ActionResult ClientExportToPdf(string dfrom, string dto, string kw) { try { ConvertToPdf convertToPdf = new ConvertToPdf(); string filename = "stratasboard_" + DateTime.Now.Day.ToString() + "-" + DateTime.Now.Month.ToString() + "-" + DateTime.Now.Year.ToString() + ".pdf"; string FilePath = "~/Content/Resources/Reports/" + filename; convertToPdf.FncDeleteFile(FilePath); StrataBoardHelper objLedgerHelper = new StrataBoardHelper(); StrataBoardModel objLedgerModel = new StrataBoardModel { PageNumber = 1, PageSize = 100000000 }; objLedgerModel.ExpiredOnFrom = DateTime.Parse(dfrom); objLedgerModel.ExpiredOnTo = DateTime.Parse(dto); objLedgerModel.Keyword = kw; List <StrataBoardModel> listLedgerModel = objLedgerHelper.GetAll(objLedgerModel); DataTable dt = new DataTable(); dt.Columns.Add("Stratasboard name"); dt.Columns.Add("Unique name"); dt.Columns.Add("Name"); dt.Columns.Add("Email address"); dt.Columns.Add("Contact number"); dt.Columns.Add("Created on"); dt.Columns.Add("Subscription name"); dt.Columns.Add("Validity"); dt.Columns.Add("Expiration date"); dt.Columns.Add("Allowed user"); dt.Columns.Add("IsSmsForAlert"); dt.Columns.Add("IsSmsForReminder"); dt.Columns.Add("Status"); if (listLedgerModel.Count() != 0) { foreach (var item in listLedgerModel) { DataRow row = dt.NewRow(); row["Stratasboard name"] = item.StratasBoardName; row["Unique name"] = item.PortalLink; row["Name"] = item.FirstName + " " + item.LastName; row["Email address"] = item.EmailId; row["Contact number"] = item.ContactNumber; row["Created on"] = AppLogic.GetDateFromatForCsv(Convert.ToDateTime(item.CreatedOn)); row["Subscription name"] = item.SubscriptionName; row["Validity"] = item.ValidityText; row["Expiration date"] = AppLogic.GetDateFromatForCsv(Convert.ToDateTime(item.ExpiryDate)); row["Allowed user"] = item.AllowedUser; row["IsSmsForAlert"] = AppLogic.GetYesNo(item.IsSmsForAlert); row["IsSmsForReminder"] = AppLogic.GetYesNo(item.IsSmsForReminder); row["Status"] = AppLogic.GetStatus(item.Status.ToString()); dt.Rows.Add(row); } } if (dt.Rows.Count > 0) { FileStream fs = new FileStream(Server.MapPath(FilePath), FileMode.Create, FileAccess.Write, FileShare.None); iTextSharp.text.Rectangle rec = new iTextSharp.text.Rectangle(PageSize.A4); //Rectangle rec = new Rectangle(PageSize.A4.Rotate()); //rec.BackgroundColor = new BaseColor(System.Drawing.Color.WhiteSmoke); //rec2.BackgroundColor = new CMYKColor(25, 90, 25, 0); //72 points = 1 inch //Left Margin: 36pt => 0.5 inch //Right Margin: 72pt => 1 inch //Top Margin: 108pt => 1.5 inch //Bottom Margini: 180pt => 2.5 inch Document doc = new Document(rec, 18, 18, 72, 72); PdfWriter writer = PdfWriter.GetInstance(doc, fs); doc.Open(); doc.AddTitle("stratasboard listing"); doc.AddCreator("stratafair"); //doc.AddSubject("This is an Example 4 of Chapter 1 of Book 'iText in Action'"); //doc.AddKeywords("Metadata, iTextSharp 5.4.4, Chapter 1, Tutorial"); //doc.AddAuthor("pankaj jain"); //doc.AddHeader("Nothing", "No Header"); //Paragraph para = new Paragraph("Hello World"); // Setting paragraph's text alignment using iTextSharp.text.Element class // para.Alignment = Element.ALIGN_JUSTIFIED; // Adding this 'para' to the Document object // doc.Add(para); PdfPTable table = new PdfPTable(13); table.HorizontalAlignment = 0; table.TotalWidth = 550f; table.LockedWidth = true; // Font fontHeader = FontFactory.GetFont("ARIAL", 8); // sum must equal to Total Width of table // number of sizes must equal to number of columns float[] widths = new float[] { 80f, 80f, 50f, 80f, 50f, 80f, 80f, 40f, 50f, 50f, 50f, 40f, 40f }; table.SetWidths(widths); int iColCount = dt.Columns.Count; for (int i = 0; i < iColCount; i++) { //PdfPCell pdfPCell = new PdfPCell(new Phrase(new Chunk(dt.Columns[i].ToString(), fontHeader))); //table.AddCell(pdfPCell); ConvertToPdf.AddHeaderCell(table, dt.Columns[i].ToString(), 1, 7, "C", "C"); } foreach (DataRow dr in dt.Rows) { for (int i = 0; i < iColCount; i++) { ConvertToPdf.AddCell(table, dr[i].ToString(), 1, 7, "C", "C"); } } doc.Add(table); doc.Close(); convertToPdf.FncDownLoadPDFFile(FilePath); } } catch (Exception Ex) { string Err = Ex.Message.ToString(); } return(Redirect(Url.Content(ConfigurationManager.AppSettings["WebsiteRootPathAdmin"] + "securehost/rootlogin/client"))); }
public ActionResult ClientExportToCsv(string dfrom, string dto, string kw) { try { ConvertToCSV objCSV = new ConvertToCSV(); string FilePath = "~/Content/Resources/Reports/csvData.csv"; objCSV.fncDeleteFile(FilePath); StrataBoardHelper objLedgerHelper = new StrataBoardHelper(); StrataBoardModel objLedgerModel = new StrataBoardModel { PageNumber = 1, PageSize = 100000000 }; objLedgerModel.ExpiredOnFrom = DateTime.Parse(dfrom); objLedgerModel.ExpiredOnTo = DateTime.Parse(dto); objLedgerModel.Keyword = kw; List <StrataBoardModel> listLedgerModel = objLedgerHelper.GetAll(objLedgerModel); DataTable dt = new DataTable(); dt.Columns.Add("Stratasboard name"); dt.Columns.Add("Unique name"); dt.Columns.Add("Name"); dt.Columns.Add("Email address"); dt.Columns.Add("Contact number"); dt.Columns.Add("Created on"); dt.Columns.Add("Subscription name"); dt.Columns.Add("Validity"); dt.Columns.Add("Expiration date"); dt.Columns.Add("Allowed user"); dt.Columns.Add("IsSmsForAlert"); dt.Columns.Add("IsSmsForReminder"); dt.Columns.Add("Status"); if (listLedgerModel.Count() != 0) { foreach (var item in listLedgerModel) { DataRow row = dt.NewRow(); row["Stratasboard name"] = item.StratasBoardName; row["Unique name"] = item.PortalLink; row["Name"] = item.FirstName + " " + item.LastName; row["Email address"] = item.EmailId; row["Contact number"] = item.ContactNumber; row["Created on"] = AppLogic.GetDateFromatForCsv(Convert.ToDateTime(item.CreatedOn)); row["Subscription name"] = item.SubscriptionName; row["Validity"] = item.ValidityText; row["Expiration date"] = AppLogic.GetDateFromatForCsv(Convert.ToDateTime(item.ExpiryDate)); row["Allowed user"] = item.AllowedUser; row["IsSmsForAlert"] = AppLogic.GetYesNo(item.IsSmsForAlert); row["IsSmsForReminder"] = AppLogic.GetYesNo(item.IsSmsForReminder); row["Status"] = AppLogic.GetStatus(item.Status.ToString()); dt.Rows.Add(row); } } if (dt.Rows.Count > 0) { objCSV.CreateCSVFile(dt, Server.MapPath("~/Content/Resources/Reports/") + "csvData.csv"); objCSV.FncDownLoadFiles("stratasboard_" + DateTime.Now.ToShortDateString() + ".csv", FilePath); } } catch (Exception Ex) { string Err = Ex.Message.ToString(); } return(Redirect(Url.Content(ConfigurationManager.AppSettings["WebsiteRootPath"] + "securehost/rootlogin/client"))); }