/// <summary> /// Handles the Click event of the btnEdit control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> /// <remarks></remarks> protected void btnEdit_Click(object sender, EventArgs e) { //frmProfile.ChangeMode(FormViewMode.Edit); TextBox txtperonsal = frmProfile.FindControl("txtpersonalmsg") as TextBox; HtmlGenericControl DivSuccess = frmProfile.FindControl("DivSuccess") as HtmlGenericControl; //Step 4 Update Card Holder CardHolder_MstDTO CardHolder = CardHolderManager.GetLoggedInUser(); CardHolder.Updated_by = CardHolder.CardHolder_Id; CardHolder.Updated_dt = DateTime.Now; CardHolder.IP_Address = Request.UserHostAddress.Trim(); if (txtperonsal.Text != "") { CardHolder.Personal_Msg = txtperonsal.Text; } CardHolderManager chm = new CardHolderManager(); chm.SaveCardHolder(CardHolder); frmProfile.ChangeMode(FormViewMode.ReadOnly); ScriptManager.RegisterStartupScript(this, GetType(), "showsuccess", "showSuccess();", true); LoadProfile(); }
/// <summary> /// Submit Card Holder Master Information /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { string filename = ""; string saveFile = ""; // string ImageInfoCaptcha = ImgInfoCaptcha.ClientID; // Request.Form[ImgInfoCaptcha.UniqueID].ToString(); //try //{ // //Step 0 Check Captcha // string isvalid = "N"; // string otpInfoText = txtInfoCaptcha.Text.Trim(); // if (!string.IsNullOrEmpty(otpInfoText) && otpInfoText.Length == 6) // { // //CaptchaforInfo.ValidateCaptcha(otpInfoText); // if (otpInfoText != "" && Convert.ToString(Session["strRandomCH"]) == otpInfoText) // isvalid = "Y"; // else // { // isvalid = "N"; // lblStep3Message.Text = Constants.InvalidCaptcha; // txtCaptchaFirst.Text = string.Empty; // txtPassword.Text = ""; // txtConfirmPassword.Text = ""; // return; // } // } // else // { // lblStep3Message.Text = Constants.InvalidCaptcha; // txtCaptchaFirst.Text = string.Empty; // txtPassword.Text = ""; // txtConfirmPassword.Text = ""; // return; // } // //if (!CaptchaforInfo.UserValidated) // if (isvalid == "N") // { // txtPassword.Text = ""; // txtConfirmPassword.Text = ""; // lblStep3Message.Text = Constants.InvalidCaptcha; // txtCaptchaFirst.Text = string.Empty; // txtInfoCaptcha.Focus(); // return; // } //} //catch (Exception) //{ // lblStep3Message.Text = Constants.InvalidCaptcha; // txtCaptchaFirst.Text = string.Empty; // return; //} try { //Step 1 Check User Availibality if (CheckAvailability() == false) { return; } ///Step 2 Upload file //if (photoUpload.HasFile) //{ // var bytes = new byte[20]; // photoUpload.PostedFile.InputStream.Read(bytes, 0, 20); // if (!GeneralMethods.CheckFileHeader(photoUpload.FileName, bytes, EXTENSIONS_ATTACH)) // { // GeneralMethods.AlertMessage(Page, "Please Upload file having file type is .jpg or .jpeg or .png only"); // return; // } // if (!System.IO.Directory.Exists(string.Format("{0}{1}\\{2}", AppDomain.CurrentDomain.BaseDirectory, ROOT_UPLOAD_FOLDER, PROFILE_FOLDER))) // { // System.IO.Directory.CreateDirectory(string.Format("{0}{1}\\{2}", AppDomain.CurrentDomain.BaseDirectory, ROOT_UPLOAD_FOLDER, PROFILE_FOLDER)); // } // filename = Guid.NewGuid().ToString() + System.IO.Path.GetExtension(photoUpload.FileName); // saveFile = string.Format("{0}{1}\\{2}\\{3}", AppDomain.CurrentDomain.BaseDirectory, ROOT_UPLOAD_FOLDER, PROFILE_FOLDER, filename); // photoUpload.SaveAs(saveFile); //} //Step 3 Submit CardHolder Master Data CardHolderManager chm = new CardHolderManager(); chm.SaveCardHolder(new DTO.CardHolder_MstDTO() { User_nm = txtUserId.Text.Trim(), User_pwd = txtPassword.Text.Trim(), Profile_Photo = filename, Personal_Msg = txtPersonalMessage.Text.Trim(), IP_Address = Request.UserHostAddress.Trim(), Created_dt = DateTime.Now, credit_card_number = ViewState["CARD_NUMBER"].ToString().Encrypt(), creditcard_acc_number = ViewState["CR_ACCOUNT_NBR"].ToString().Encrypt(), }); //proImage.ImageUrl = string.Format("/{0}/{1}/{2}", ROOT_UPLOAD_FOLDER, PROFILE_FOLDER, filename); MailSendFunction(); mvNewUserRegistration.ActiveViewIndex = 0; ScriptManager.RegisterStartupScript(this, GetType(), "displayalertmessage", "Showalert();", true); //Session["CAPTCHA"] = null; Clearcontrols(); ClearOnlyFormControls(); LblSuccessMessage.Text = "Registration has been completed successfully, click <a href='login.aspx'>Login</a>"; DivSuccess.Attributes.CssStyle.Add("display", "block"); //Clearcontrols(); } catch (Exception) { if (System.IO.File.Exists(saveFile)) { System.IO.File.Delete(saveFile); } lblpwd.Text = Constants.ErrorRegister; DivPwd.Attributes.CssStyle.Add("display", "block"); } }