private bool checkDuplicateUser() { bool isExits = false; try { UserBLL userbll = new UserBLL(); if (userbll.CheckDuplicateUser(txtbxUserName.Text)) { msgbox.Attributes.Add("Class", "alert alert-warning"); msgTitleLabel.Text = "Error!!"; msgDetailLabel.Text = "User ID alredy exits!!!"; msgbox.Visible = true; isExits = true; } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } return isExits; }
protected void txtbxUserName_TextChanged(object sender, EventArgs e) { try { iconuserName.Attributes.Remove("class"); lblUsernameNote.Visible = false; UserBLL user = new UserBLL(); Regex reg = new Regex(@"^[a-z0-9_-]{5,15}$"); if (reg.IsMatch(txtbxUserName.Text)) { if (user.CheckDuplicateUser(txtbxUserName.Text.Trim())) { // iconuserName.Attributes.Remove("class"); iconuserName.Attributes.Add("class", "icon icon-ban-circle text-error"); hdnfldduplicate.Value = "1"; txtbxUserName.Focus(); } else { // iconuserName.Attributes.Remove("class"); iconuserName.Attributes.Add("class", "icon icon-ok-sign text-success"); hdnfldduplicate.Value = "0"; txtbxFirstName.Focus(); } } else { lblUsernameNote.Visible = true; lblUsernameNote.Text = "User Name must be 5-15 char small letter alpha char (_ allow) ei. jhonsmith_ or jhonsmith "; } } catch (Exception) { //throw; } }
protected void txtbxEmailTextchanged(object sender, EventArgs e) { try { UserBLL userbll = new UserBLL(); if (userbll.CheckDuplicateUser(txtbxemail.Text)) { msgTitleLabel.Text = "Error!!"; msgDetailLabel.Text = "Email address alredy exits!!!"; msgbox.Visible = true; msgbox.Attributes.Add("Class", "alert alert-warning"); } } catch (Exception ex) { string message = ex.Message; if (ex.InnerException != null) { message += " --> " + ex.InnerException.Message; } MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");"); } }
protected void btnSave_Click(object sender, EventArgs e) { try { UserBLL aUser = new UserBLL(); if (txtbxUserName.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "User Name field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxUserName.Focus(); } else if (txtbxFirstName.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "First Name field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxFirstName.Focus(); } else if (txtbxLastName.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Last Name field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxLastName.Focus(); } else if (txtbxAddress.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Address field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxAddress.Focus(); } else if (txtbxHouse.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "House No field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxHouse.Focus(); } else if (txtbxStreet.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Street field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxStreet.Focus(); } else if (txtbxCell.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Cell Number field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxCell.Focus(); } else if (txtbxCellConfrm.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Cell Confirm field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxCellConfrm.Focus(); } else if (txtbxEmail.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Email field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxEmail.Focus(); } else if (txtbxPin.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Pin field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxPin.Focus(); } else if (txtbxReferId.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Reffer ID field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxReferId.Focus(); } else if (txtbxPlacementId.Text == ""||txtbxPlacementId.Text==txtbxUserName.Text) { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Placement ID field is required. or Not valid."; msgbox.Attributes.Add("Class", "alert alert-warning"); txtbxPlacementId.Text = ""; txtbxPlacementId.Focus(); } else if (ddlPosition.SelectedItem.Text == "") { msgbox.Visible = true; msgTitleLabel.Text = "Validation!!!"; msgDetailLabel.Text = "Join Position field is required."; msgbox.Attributes.Add("Class", "alert alert-warning"); ddlPosition.Focus(); } else { if (!aUser.CheckDuplicateUser(txtbxUserName.Text) && hdnvalidplace.Value == "0") { LoginBll login = new LoginBll(); aUser.UserId = txtbxUserName.Text.Trim(); aUser.FirstName = txtbxFirstName.Text.Trim(); aUser.LastName = txtbxLastName.Text.Trim(); aUser.PassportNo = txtbxPassportNo.Text.Trim(); aUser.Address = txtbxAddress.Text.Trim(); aUser.Country = ddlCountry.SelectedValue; aUser.House = txtbxHouse.Text.Trim(); aUser.Street = txtbxStreet.Text.Trim(); aUser.Area = txtbxArea.Text.Trim(); aUser.MobileNo = txtbxCell.Text.Trim(); aUser.Email = txtbxEmail.Text.Trim(); aUser.EmrName = txtcontactPerson.Text.Trim(); aUser.EmrRelation = ddlContactRelation.SelectedValue; aUser.EmrAddress = txtbxContactAddress.Text.Trim(); aUser.EmrMobile = txtbxContactMobile.Text.Trim(); aUser.EmeEmail = txtContactEmail.Text.Trim(); aUser.EmeCountry = ddlContactCountry.SelectedValue; aUser.UserGroupId = "UG003"; aUser.Password = (string) LumexLibraryManager.EncodeIntoMd5Hash("LTSsL[" + txtpxPasswordset.Text.Trim() + "]0"); ; aUser.ActualPass = retypePassword.Text.Trim(); aUser.UserPin = txtbxPin.Text.Trim(); aUser.IsActive = "No"; aUser.PerPhoto = ""; aUser.Isvarified = "No"; aUser.Createdby = ""; bool status = aUser.SaveUserInfo(); if (status) { if (txtbxPlacementId.Text != "" && ddlPosition.SelectedValue != "" && txtbxReferId.Text != "") { aUser.InsertIntoGenolgyTree(txtbxPlacementId.Text, ddlPosition.SelectedValue, txtbxReferId.Text, aUser.UserId); } Random random = new Random(); MailContactBLL mailContactBll = new MailContactBLL(); aUser.varifycode = random.Next(100000, 999998) + 1; string key = dataEncryptbll.addforvarifycore; string encrypeteduid = dataEncryptbll.EncryptRijndael( aUser.UserId + "#" + aUser.varifycode, key); string url = HttpContext.Current.Request.Url.AbsoluteUri; string[] Partsofurl = url.Split('/'); aUser.ActivationUrl = Server.HtmlEncode("http://" + Partsofurl[2] + "/page/varify.aspx/?uid=" + encrypeteduid); string body = PopulateBody(aUser); bool mailSend = mailContactBll.sendemailtocompleteResigtration(aUser, body); aUser = null; ClearTextBox(); } } else { string message = " <span class='actionTopic'>" + " Placement Informarion is not correct!!" + ddlPosition.SelectedItem.Text + " Is not free of the Placement Id</span>."; MyAlertBox( "var callbackOk = function () { window.location = \"/page/registration.aspx\"; }; WarningAlert(\"" + "Process Succeed" + "\", \"" + message + "\", \"\");"); } } } catch (Exception) { throw; } }
public void btnRequestSend_Click(object sender, EventArgs e) { UserAccountBLL account = new UserAccountBLL(); UserBLL userBll = new UserBLL(); account.Type = ddlType.SelectedValue; account.BankAccountNo = ddlPaymentMethod.SelectedItem.Text; account.TransferTo = txtbxTransferTo.Text.Trim(); account.SwiftCode = ddlPaymentMethod.SelectedValue; account.Pin = txtbxTransferPin.Text.Trim(); account.TransferNote = txtbxTransferNote.Text.Trim(); account.Amount = txtbxAmount.Text.Trim(); account.transfarType = ddlType.SelectedValue; string message = ""; if (account.checkUserIncomeAmounttoActin(30, (string)LumexSessionManager.Get("ActiveUserId"))) { if (userBll.varifypin((string)LumexSessionManager.Get("ActiveUserId"), account.Pin)) { if (ddlType.SelectedValue == "1") { if (Convert.ToDecimal(account.Amount) < 4000) { if (account.TransferTo != (string)LumexSessionManager.Get("ActiveUserId") && userBll.CheckDuplicateUser(account.TransferTo)) { account.Status = "A"; bool status = account.RequestToTransfer(); if (status) { account.updateUserAccountforTransfer(); account.updateWithdrawRequest(account.transfarId, "A"); message = "Payment <span class='actionTopic'>Fund Transfer</span> Successfully Done. Thanks."; MyAlertBox( "var callbackOk = function () { MyOverlayStart(); window.location = \"/a/account/withdraw.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } } else { message = "Please Give <span class='actionTopic'>Correct User Info </span> to Transfer."; MyAlertBox( "var callbackOk = function () { MyOverlayStart(); window.location = \"/a/account/withdraw.aspx\"; }; WarningAlert(\"" + "Warning!!" + "\", \"" + message + "\", \"\");"); } } else { account.Status = "P"; bool status = account.RequestToTransfer(); if (status) { account.updateUserAccountforTransfer(); message = "Payment <span class='actionTopic'>Transfer Request</span> Successfully Done. Thanks."; MyAlertBox( "var callbackOk = function () { MyOverlayStart(); window.location = \"/a/account/withdraw.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } } } else if (ddlType.SelectedValue == "0") { if (Convert.ToDecimal(account.Amount) >= 30) { account.Status = "P"; bool status = account.RequestToTransfer(); if (status) { account.updateUserAccountforTransfer(); message = "Payment <span class='actionTopic'>Transfer Request</span> Successfully Done. Thanks."; MyAlertBox( "var callbackOk = function () { MyOverlayStart(); window.location = \"/a/account/withdraw.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);"); } } else { message = "You can not transfer less than <span class='actionTopic'>$30</span>, Thanks."; MyAlertBox("var callbackOk = function () { MyOverlayStart(); window.location = \"/moneygerate.aspx\"; }; SuccessAlert(\"" + "Warning note!!" + "\", \"" + message + "\", \"\");"); } } } else { message = "Please Enter Your Correct <span class='actionTopic'>Pin</span> to Transfer."; MyAlertBox( "var callbackOk = function () { MyOverlayStart(); window.location = \"/a/account/withdraw.aspx\"; }; WarningAlert(\"" + "Warning!!" + "\", \"" + message + "\", \"\");"); } } else { message = "You have no sufficient <span class='actionTopic'>Amount</span> to Transfer."; MyAlertBox( "var callbackOk = function () { MyOverlayStart(); window.location = \"/a/account/withdraw.aspx\"; }; WarningAlert(\"" + "Warning!!" + "\", \"" + message + "\", \"\");"); } }