protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { SetUpPageContent(ref metaDescription, ref metaKeywords); objCommon = new clsCommon(); string strIds = objCommon.GetParameterFromUrl(Enums.Enums_URLParameterType.ByNumber, "1"); if (strIds != "") { Boolean approved = false; try { string strId = objEncrypt.Decrypt(strIds, appFunctions.strKey); tblCustomer objCustomer = new tblCustomer(); if (objCustomer.LoadByPrimaryKey(Convert.ToInt32(strId))) { if (!(objCustomer.AppIsVerified)) { objCustomer.AppIsVerified = true; objCustomer.Save(); approved = true; } } objCustomer = null; Response.Redirect(GetAlias("Login.aspx") + "?From=" + objEncrypt.Encrypt("ApprovedPage" + approved.ToString(), appFunctions.strKey), true); } catch (Exception ex) { } } objCommon = null; } }
private bool SaveData() { objClsCommon = new clsCommon(); objCustomer = new tblCustomer(); if (!string.IsNullOrEmpty(hdnPKID.Value) && hdnPKID.Value != "") { objCustomer.LoadByPrimaryKey(Convert.ToInt32(hdnPKID.Value)); } else { objCustomer.AddNew(); } objCustomer.AppFirstName = txtFirstName.Text; objCustomer.AppLastName = txtLastName.Text; objCustomer.AppEmailID = txtEmail.Text; objEncrypt = new clsEncryption(); objCustomer.AppPassword = objEncrypt.Encrypt(txtPassword.Text, appFunctions.strKey); objEncrypt = null; objCustomer.AppMobile = txtMobile.Text; objCustomer.AppPhone = txtPhone.Text; if (RbtnMale.Checked) { objCustomer.AppGender = true; } else { objCustomer.AppGender = false; } objCustomer.AppIsVerified = chkIsVerified.Checked; if (FileUploadImg.HasFile) { string strError = ""; string Time = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second); string strPath = objClsCommon.FileUpload_Images(FileUploadImg.PostedFile, txtFirstName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Customer/", ref strError, 0, objCustomer.s_AppImage, false, 0, 2000); if (strError == "") { objCustomer.AppImage = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } objCustomer.AppIsActive = chkIsActive.Checked; objCustomer.AppIsNewsLetter = chkIsNewsLetter.Checked; objCustomer.Save(); iCustomerID = objCustomer.AppCustomerID; objCustomer = null; objClsCommon = null; return(true); }
public bool SaveCustomer() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCustomer", tblCustomer.ColumnNames.AppEmailID, tblCustomer.ColumnNames.AppCustomerID, txtEmailRegistration.Text)) { DisplayInfoRegistration.ShowMessage("Email address already exist.", Enums.MessageType.Error); return(false); } objCommon = null; tblCustomer objCustomer = new tblCustomer(); objCustomer.AddNew(); objCustomer.AppFirstName = txtFirstName.Text.Trim(); objCustomer.AppLastName = txtLastName.Text.Trim(); objCustomer.AppEmailID = txtEmailRegistration.Text.Trim(); objCustomer.AppMobile = txtMobile.Text; // objCustomer.AppAddress = txtAddress.Text; if (RbtnMale.Checked) { objCustomer.AppGender = true; } else { objCustomer.AppGender = false; } objEncrypt = new clsEncryption(); objCustomer.AppPassword = objEncrypt.Encrypt(txtPasswordRegistration.Text, appFunctions.strKey); objEncrypt = null; // objCustomer.AppIsNewsLetter = ChkSubsucribNewsLetter.Checked; objCustomer.AppIsActive = true; objCustomer.AppIsVerified = false; objCustomer.AppCreatedDate = GetDateTime(); objCustomer.Save(); // tblAddress objAdress = new tblAddress(); // objAdress.AddNew(); //// objAdress.AppAddress = txtAddress.Text; // objAdress.AppCustomerID = objCustomer.AppCustomerID; // objAdress.Save(); SendMail(objCustomer.s_AppCustomerID); objCustomer = null; return(true); }
public bool SaveCustomer() { tblCustomer objCustomer = new tblCustomer(); if (objCustomer.LoadByPrimaryKey(Convert.ToInt32(Session[appFunctions.Session.ClientUserID.ToString()].ToString()))) { objEncrypt = new clsEncryption(); if (string.Compare(objEncrypt.Decrypt(objCustomer.AppPassword, appFunctions.strKey), txtOldPassword.Text, false) != 0) { DInfo.ShowMessage("Old password is incorrect", Enums.MessageType.Warning); return(false); } objCustomer.AppPassword = objEncrypt.Encrypt(txtNewRetryPassword.Text, appFunctions.strKey); objEncrypt = null; objCustomer.Save(); } objCustomer = null; return(true); }
public bool SaveCustomer() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCustomer", tblCustomer.ColumnNames.AppEmailID, tblCustomer.ColumnNames.AppCustomerID, txtEmailRegistration.Text)) { DisplayInfoRegistration.ShowMessage("Email address already exist.", Enums.MessageType.Error); return(false); } objCommon = null; tblCustomer objCustomer = new tblCustomer(); objCustomer.AddNew(); objCustomer.AppFirstName = txtFirstName.Text.Trim(); objCustomer.AppLastName = txtLastName.Text.Trim(); objCustomer.AppEmailID = txtEmailRegistration.Text.Trim(); objCustomer.AppMobile = txtMobile.Text; objCustomer.AppAddress = txtAddress.Text; if (RbtnMale.Checked) { objCustomer.AppGender = true; } else { objCustomer.AppGender = false; } objEncrypt = new clsEncryption(); objCustomer.AppPassword = objEncrypt.Encrypt(txtPasswordRegistration.Text, appFunctions.strKey); objEncrypt = null; objCustomer.AppIsActive = true; objCustomer.AppIsVerified = true; objCustomer.AppCreatedDate = GetDateTime(); objCustomer.Save(); HttpContext.Current.Session[appFunctions.Session.ClientUserID.ToString()] = objCustomer.AppCustomerID; HttpContext.Current.Session[appFunctions.Session.ClientUserName.ToString()] = objCustomer.AppFirstName + " " + objCustomer.AppLastName; objCustomer = null; return(true); }
public bool SaveCustomer() { objCommon = new clsCommon(); if (objCommon.IsRecordExists("tblCustomer", tblCustomer.ColumnNames.AppEmailID, tblCustomer.ColumnNames.AppCustomerID, txtEmail.Text, Session[appFunctions.Session.ClientUserID.ToString()].ToString())) { DInfo.ShowMessage("Email address already exist.", Enums.MessageType.Error); return(false); } tblCustomer objCustomer = new tblCustomer(); if (objCustomer.LoadByPrimaryKey(Convert.ToInt32(Session[appFunctions.Session.ClientUserID.ToString()].ToString()))) { objCustomer.AppFirstName = txtFirstName.Text.Trim(); objCustomer.AppLastName = txtLastName.Text.Trim(); objCustomer.AppEmailID = txtEmail.Text.Trim(); objCustomer.AppMobile = txtMobile.Text.Trim(); objCustomer.AppPhone = txtPhone.Text; //objCustomer.AppAddress = txtAddress.Text; //objCustomer.s_AppPincode = txtPincode.Text; if (RbtnMale.Checked) { objCustomer.AppGender = true; } else { objCustomer.AppGender = false; } if (FileUploadImg.HasFile) { string strError = ""; string Time = Convert.ToString(DateTime.Now.Month) + Convert.ToString(DateTime.Now.Day) + Convert.ToString(DateTime.Now.Year) + Convert.ToString(DateTime.Now.Hour) + Convert.ToString(DateTime.Now.Minute) + Convert.ToString(DateTime.Now.Second); string strPath = objCommon.FileUpload_Images(FileUploadImg.PostedFile, txtFirstName.Text.Trim().Replace(" ", "_") + "_" + txtLastName.Text.Trim().Replace(" ", "_") + "_" + Time, "Uploads/Customer/", ref strError, 0, objCustomer.s_AppImage, true); if (strError == "") { objCustomer.AppImage = strPath; } else { DInfo.ShowMessage(strError, Enums.MessageType.Error); return(false); } } //string strCountryId = ddlCountry.SelectedValue; //string strStateId = ddlState.SelectedValue; //string strCityID = ddlCity.SelectedValue; //if (ddlCountry.SelectedValue == "-1") //{ // tblCountry objCountry = new tblCountry(); // objCountry.Where.AppCountry.Value = txtcountry.Text; // objCountry.Query.Load(); // if (!(objCountry.RowCount > 0)) // { // objCountry.AddNew(); // objCountry.AppCountry = txtcountry.Text; // objCountry.Save(); // } // strCountryId = objCountry.s_AppCountryID; // objCountry = null; //} //if (ddlState.SelectedValue == "-1") //{ // tblState objState = new tblState(); // objState.Where.AppCountryID.Value = strCountryId; // objState.Where.AppState.Value = txtState.Text; // objState.Query.Load(); // if (!(objState.RowCount > 0)) // { // objState.AddNew(); // objState.AppState = txtState.Text; // objState.s_AppCountryID = strCountryId; // objState.Save(); // } // strStateId = objState.s_AppStateID; // objState = null; //} //if (ddlCity.SelectedValue == "-1") //{ // tblCity objCity = new tblCity(); // objCity.Where.AppStateID.Value = strStateId; // objCity.Where.AppCity.Value = txtCity.Text; // objCity.Query.Load(); // if (!(objCity.RowCount > 0)) // { // objCity.AddNew(); // objCity.AppCity = txtCity.Text; // objCity.s_AppStateID = strStateId; // objCity.Save(); // } // strCityID = objCity.s_AppCityID; // objCity = null; //} // objCustomer.s_AppCityId = strCityID; //objCustomer.s_AppStateId = strStateId; //objCustomer.s_AppCountryId = strCountryId; objCustomer.Save(); } objCustomer = null; objCommon = null; return(true); }