protected void brnCreate_Click(object sender, EventArgs e) { if (SaveCustomer()) { DisplayInfoRegistration.ShowMessage("Your account has been created successfully, For security purpose, check your mail to activate your account.", Enums.MessageType.Successfull); ResetRegistrationCotrol(); } }
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() { 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); }