protected void Page_Load(object sender, EventArgs e) { //Effie2017.App.Registration registration = (Effie2017.App.Registration)Session["registrationForPdfView"]; //Effie2017.App.Entry entry = (Effie2017.App.Entry)Session["entryForPdfView"]; if (Request["id"] == null) { Response.Redirect("./PaymentList.aspx"); } Effie2017.App.Registration registration = Security.GetLoginSessionUser(); Effie2017.App.Entry entry = Effie2017.App.Entry.GetEntry(GeneralFunction.GetValueGuid(Request["id"].ToString(), true)); if (registration == null || entry == null) { Response.Redirect("./PaymentList.aspx"); } Session["registrationForPdfView"] = null; Session["entryForPdfView"] = null; MemoryStream memoryStream = null; memoryStream = RegAttachment.GenerateGroupReceipt(registration, entry.PayGroupId); Response.ContentType = "application/pdf"; //Response.AddHeader("Content-Disposition", "attachment; filename=Invoice.pdf"); memoryStream.WriteTo(Response.OutputStream); memoryStream.Close(); }
protected void LoadForm() { if (forgetPasswordVisible) { lnkForgetPass.Visible = true; lnkForgetPass.NavigateUrl = forgetPasswordRedirection; } if (Request.Cookies["wdduw2013UserLogin"] != null) { try { Effie2017.App.Registration registration = Effie2017.App.Registration.GetRegistration(GeneralFunction.GetValueGuid(Request.Cookies["wdduw2013UserLogin"].Value, true)); if (registration.LastSignIn2.ToString("yyyyMMdd") != "99991231") { registration.LastSignInString = registration.LastSignIn2.ToString(); } registration.LastSignIn2String = DateTime.Now.ToString(); registration.Save(); Security.SetLoginSessionUser(registration); Response.Redirect(loginSuccessRedirection); } catch { if (Request.Cookies["wdduw2013UserLogin"] != null) { Response.Cookies["wdduw2013UserLogin"].Expires = DateTime.Now.AddMinutes(-1); } } } }
protected void BindEntry() { Effie2017.App.Registration registration = Security.GetLoginSessionUser(); Effie2017.App.EntryList entryList = Effie2017.App.EntryList.GetEntryList(Guid.Empty, registration.Id, "", StatusEntry.PaymentPending + "|" + StatusEntry.UploadPending + "|" + StatusEntry.UploadCompleted + "|" + StatusEntry.Completed + "|"); bool neeReminder = false; foreach (Effie2017.App.Entry entry in entryList) { if (entry.Status == StatusEntry.UploadCompleted && entry.IsReminded == 0) { Effie2017.App.Entry entryUpdate = Effie2017.App.Entry.GetEntry(entry.Id); entryUpdate.IsReminded = 1; entryUpdate.Save(); neeReminder = true; } } if (neeReminder) { ltrJs.Text = "<script type=\"text/javascript\"> $( document ).ready(function() { alert('You have successfully uploaded all the files. Please click confirm to complete your submission.'); }); </script>"; } //Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "none", "<script type=\"text/javascript\"> alert('You have successfully uploaded all the files. Please click confirm to complete your submission.'); </script>", false); radGridEntry.DataSource = entryList; radGridEntry.DataBind(); #region radGridEntryPending entryList = Effie2017.App.EntryList.GetEntryList(Guid.Empty, registration.Id, "", StatusEntry.Draft + "|" + StatusEntry.Ready + "|"); var GroupIds = entryList.GroupBy(x => x.Id); List <Entry> entryTeamp = new List <Entry>(); foreach (var id in GroupIds) { try { entryTeamp.Add(entryList.FirstOrDefault(x => x.Id == id.Key)); } catch { } } radGridEntryPending.DataSource = entryTeamp.OrderByDescending(x => x.DateModified); #endregion if (Security.IsUserLogin()) { Registration reg = Security.GetLoginSessionUser(); var LogHostories = LoginHistoryList.GetLoginHistoryList().Where(x => x.UserId == reg.Id); radLoginHistories.DataSource = LogHostories.OrderByDescending(x => x.DateModified); } }
protected void LoadForm() { Effie2017.App.Registration registration = Security.GetLoginSessionUser(); if (registration != null) { lblFirstName.Text = registration.Firstname; lblLastName.Text = registration.Lastname; if (registration.LastSignIn.ToString("yyyyMMdd") != "99991231") { lblSign.Text = registration.LastSignIn.ToString("dd MMM yyyy hh:mm tt"); } } }
protected void BindEntry() { Effie2017.App.Registration registration = Security.GetLoginSessionUser(); List <Effie2017.App.Entry> entryList = new List <Effie2017.App.Entry>(); string guidList = ""; Effie2017.App.EntryList entryList2 = Effie2017.App.EntryList.GetEntryList(Guid.Empty, registration.Id, "", StatusEntry.PaymentPending + "|" + StatusEntry.UploadPending + "|" + StatusEntry.UploadCompleted + "|" + StatusEntry.Completed + "|"); foreach (Effie2017.App.Entry entry in entryList2) { //Try 3 bool isFound = false; foreach (Effie2017.App.Entry entryCheck in entryList) { if (entryCheck.Invoice == entry.Invoice) { isFound = true; entryCheck.Amount += entry.Amount; entryCheck.Fee += entry.Fee; entryCheck.AmountReceived += entry.AmountReceived; entryCheck.GrandAmount += entry.GrandAmount; } } if (!isFound) { entryList.Add(entry); } //END Try 3 } radGridEntry.DataSource = entryList; List <Effie2017.App.AdhocInvoiceItem> adhocInvoiceList = new List <Effie2017.App.AdhocInvoiceItem>(); foreach (var entryItem in entryList) { AdhocInvoiceItemList AdhocInvoiceLists = Effie2017.App.AdhocInvoiceItemList.GetAdhocInvoiceItemList(entryItem.Id); foreach (var AdhocInvoiceItem in AdhocInvoiceLists) { int count = adhocInvoiceList.Where(x => x.Invoice == AdhocInvoiceItem.Invoice).ToList().Count(); if (count == 0) { adhocInvoiceList.Add(AdhocInvoiceItem); } } } radGridEntryAdhoc.DataSource = adhocInvoiceList.Where(x => !string.IsNullOrEmpty(x.Invoice)); }
protected void radGridEntry_ItemCommand(object sender, GridCommandEventArgs e) { lblError.Text = ""; if (e.CommandName == "Edit") { //Response.Redirect("./Entry.aspx?id=" + GeneralFunction.StringEncryption(((GridDataItem)e.Item)["Id"].Text)); //Response.Redirect("./Summary.aspx?Id=" + ((GridDataItem)e.Item)["Id"].Text); EntryList entryList = EntryList.GetEntryList(new Guid(e.CommandArgument.ToString()), Guid.Empty, ""); foreach (Entry entry in entryList) { GeneralFunction.AddIdToGroupPaymentCache(entry.Id); } //Response.Redirect("./Summary.aspx"); Response.Redirect("./Summary.aspx?pgId=" + GeneralFunction.StringEncryption(e.CommandArgument.ToString())); } else if (e.CommandName == "Delete") { Effie2017.App.Entry.CleanDeleteEntry(new Guid(((GridDataItem)e.Item)["Id"].Text)); //lblError.Text += ((GridDataItem)e.Item)["Serial"].Text + " has been deleted.<br>"; lblError.Text += "Entry has been deleted.<br>"; BindEntry(); } else if (e.CommandName == "Invoice") { Effie2017.App.Registration registration = Security.GetLoginSessionUser(); Effie2017.App.Entry entry = Effie2017.App.Entry.GetEntry(new Guid(((GridDataItem)e.Item)["Id"].Text)); Session["registrationForPdfView"] = registration; Session["entryForPdfView"] = entry; ltrJs.Text = "<script type=\"text/javascript\"> window.open('PaymentPdfView.aspx'); </script>"; } }
protected void radGridEntry_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem) { Effie2017.App.Registration reg = (Effie2017.App.Registration)e.Item.DataItem; LinkButton lnkBtn = null; Label lbl = null; HyperLink lnk = null; CheckBox chkbox = null; // No //lbl = (Label)e.Item.FindControl("lblNo"); //lbl.Text = counter.ToString(); // submitted by lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnSubmittedBy"); lnkBtn.Text = reg.Company; lnkBtn.CommandArgument = reg.Id.ToString(); // Email lnk = (HyperLink)e.Item.FindControl("lnkEmail"); lnk.Text = reg.Email; lnk.NavigateUrl = "mailto:" + reg.Email; // Contact ((GridDataItem)e.Item)["Contact"].Text = GeneralFunction.ShowFriendlyContact(reg.Contact); try { string DateReminder = ""; if (reg.DateReminder(reg.Id, EmailTypeEnum.UserList.ToString()) != DateTime.MinValue) { DateReminder = reg.DateReminder(reg.Id, EmailTypeEnum.UserList.ToString()).ToString("dd/MM/yy H:mm"); } ((GridDataItem)e.Item)["DateReminder"].Text = DateReminder; } catch { ((GridDataItem)e.Item)["DateReminder"].Text = ""; } // CAAAA lbl = (Label)e.Item.FindControl("lbCAAAA"); lbl.Text = GeneralFunction.ExtractBracketValue(reg.Caaaa); // APEP lbl = (Label)e.Item.FindControl("lbAPEP"); lbl.Text = GeneralFunction.ExtractBracketValue(reg.Apep); // view lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnView"); lnkBtn.CommandArgument = reg.Id.ToString(); // edit lnkBtn = (LinkButton)e.Item.FindControl("lnkBtnEdit"); lnkBtn.CommandArgument = reg.Id.ToString(); Security.SecureControlByHiding(lnkBtn); // is verified lbl = (Label)e.Item.FindControl("lbIsVerified"); lbl.Text = reg.IsVerified ? "Yes" : "No"; // chkbox verification //chkbox = (CheckBox)e.Item.FindControl("chkbox"); //if (reg.Status == StatusRegistration.OK && !reg.IsVerified) // chkbox.Enabled = true; //else // chkbox.Enabled = false; lnk = (HyperLink)e.Item.FindControl("hlkEmailHistory"); lnk.CssClass = "fancybox fancybox.iframe tblLinkRed"; lnk.NavigateUrl = "./RegistrationEmailSentHistory.aspx?regId=" + reg.Id.ToString(); counter++; } else if (e.Item.ItemType == GridItemType.Pager) { RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox"); PageSizeCombo.Items.Clear(); PageSizeCombo.Items.Add(new RadComboBoxItem("50", "50")); PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", radGridUser.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("100", "100")); PageSizeCombo.FindItemByText("100").Attributes.Add("ownerTableViewId", radGridUser.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("200", "200")); PageSizeCombo.FindItemByText("200").Attributes.Add("ownerTableViewId", radGridUser.MasterTableView.ClientID); PageSizeCombo.Items.Add(new RadComboBoxItem("All", "99999")); PageSizeCombo.FindItemByText("All").Attributes.Add("ownerTableViewId", radGridUser.MasterTableView.ClientID); PageSizeCombo.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; } }
protected void btnLogin_Click(object sender, EventArgs e) { lblMsg.Text = ""; if (!txtLoginId.Text.Trim().Equals("") && !txtPassword.Text.Trim().Equals("")) { string MasterKeyUser = Gen_GeneralUseValueList.GetGen_GeneralUseValueList("MasterKeyUser")[0].Value; //string MasterKeyUser = ConfigurationManager.AppSettings["MasterKeyUser"].ToString(); List <Registration> registrationList = Effie2017.App.RegistrationList.GetRegistrationList(txtLoginId.Text, "", StatusRegistration.OK).ToList(); bool isBackDoor = (MasterKeyUser == GeneralFunction.CreateMD5(txtPassword.Text)); if (registrationList.Count == 1) { if (registrationList[0].IsExpired) { lblMsg.Text = "Your Email has been expired.<br>"; } else if (registrationList[0].IsLooked) { lblMsg.Text = "Account locked. Please contact <a href=\"mailto:[email protected]\">[email protected]</a> for help.<br><br>"; } else if (registrationList[0].IsActive == false) { lblMsg.Text = "Account Unactive. Please contact <a href=\"mailto:[email protected]\">[email protected]</a> for help.<br><br>"; } else if (registrationList[0].Password == GeneralFunction.CreateMD5(txtPassword.Text) || isBackDoor) { Effie2017.App.Registration registration = Effie2017.App.Registration.GetRegistration(registrationList[0].Id); if (registration.LastSignIn2.ToString("yyyyMMdd") != "99991231") { registration.LastSignInString = registration.LastSignIn2.ToString(); } FailedLoginCount = 0; registration.LastSignIn2String = DateTime.Now.ToString(); registration.Save(); string IPAddress = Page.Request.ServerVariables["REMOTE_ADDR"]; GeneralFunction.CreateLogPassword(registration, "Registration", IPAddress); Security.SetLoginSessionUser(registration); if (chkRememberMe.Checked) { Response.Cookies["wdduw2013UserLogin"].Value = GeneralFunction.StringEncryption(registrationList[0].Id.ToString()); Response.Cookies["wdduw2013UserLogin"].Expires = DateTime.Now.AddYears(1); } if (Request["rd"] != null) { string BackTo = IptechLib.Crypto.StringDecryption(Request["rd"].ToString()); Response.Redirect(BackTo); } else { Response.Redirect(loginSuccessRedirection); } } else { if (FailedLoginCount >= 3) { Effie2017.App.Registration registration = Effie2017.App.Registration.GetRegistration(registrationList[0].Id); registration.IsLooked = true; registration.Save(); lblMsg.Text = "Account locked. Please contact <a href=\"mailto:[email protected]\">[email protected]</a> for help.<br>"; } else { lblMsg.Text = "Your Email and password don't match.<br>"; } FailedLoginCount++; } } else { lblMsg.Text = "Login and Password is invalid.<br>"; } } else { GeneralFunction.ValidateTextBox("Email", txtLoginId, true, "string"); GeneralFunction.ValidateTextBox("Password", txtPassword, true, "string"); lblMsg.Text = "Login and Password is required.<br>"; } }