Exemple #1
0
        protected void btnresetPass_click(object sender, EventArgs e)
        {
            UserBLL     userBll = new UserBLL();
            Button      Btn     = (Button)sender;
            GridViewRow row     = (GridViewRow)Btn.NamingContainer;

            userBll.UserId = userListGridView.Rows[row.RowIndex].Cells[0].Text.ToString();
            try
            {
                bool status = userBll.CheckUserIdOrMailForResetPass(userBll.UserId);

                //varificationSection.Visible = true;
                //userCheckSection.Visible = false;
                if (status)
                {
                    Random random = new Random();

                    MailContactBLL mailContactBll = new MailContactBLL();
                    userBll.varifycode = random.Next(100000, 999998) + 1;

                    string   key           = dataEncryptbll.addforvarifycore;
                    string   encrypeteduid = dataEncryptbll.EncryptRijndael(userBll.UserId + "#" + userBll.varifycode, key);
                    string   url           = HttpContext.Current.Request.Url.AbsoluteUri;
                    string[] Partsofurl    = url.Split('/');
                    userBll.ActivationUrl = Server.HtmlEncode("http://" + Partsofurl[2] + "/page/varify.aspx/?uid=" + encrypeteduid);


                    bool mailSend = mailContactBll.SendEmailForPasswordReset(userBll);

                    if (mailSend)
                    {
                        string message = " <span class='actionTopic'>" + "Your mail Send Successfully. Please Cheak your Mail Inbox or Spam" + "</span>.";

                        MyAlertBox("var callbackOk = function () { window.location = \"/setting/User/ResetUserPassword.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                    }
                    else
                    {
                        string message = " <span class='actionTopic'>" + "Sorry !! Mail Not Send to this User Please Check User mail or ID is Correct !!!" + "</span>.";
                        MyAlertBox("var callbackOk = function () { window.location = \"/setting/User/ResetUserPassword.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                    }
                }
                else
                {
                    msgbox.Attributes.Add("Class", "alert alert-warning");
                    msgbox.Visible      = true;
                    msgTitleLabel.Text  = "Exception";
                    msgDetailLabel.Text = "User Id or Email is Not Correct";
                }
            }
            catch (Exception ex)
            {
                string message = ex.Message;
                if (ex.InnerException != null)
                {
                    message += " --> " + ex.InnerException.Message;
                }
                MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
            }
        }
Exemple #2
0
        protected void btnActivation_Click(object sender, EventArgs e)
        {
            try
            {
                UserBLL user = new UserBLL();
                if (user.varifypin((string)LumexSessionManager.Get("ActiveUserId"), txtbxUserPin.Text))
                {
                    UserAccountBLL userAccount    = new UserAccountBLL();
                    StakeInfoBLL   stakeInfo      = new StakeInfoBLL();
                    MailContactBLL mailContactBll = new MailContactBLL();
                    UserBLL        userBll        = new UserBLL();
                    bool           status         = userAccount.UpdateUserAccount((string)LumexSessionManager.Get("ActiveUserId"),
                                                                                  ddlStakeList.SelectedValue, txtbxStakeKey.Text.Trim());


                    if (status)
                    {
                        if (hdnfldRefActive.Value == "No")
                        {
                            ReceivePaymentWhenActive();
                            genologyBLL genology = new genologyBLL();
                            genology.GenerateBinaryNodeByChileId((string)LumexSessionManager.Get("ActiveUserId"), userAccount.Amount);
                        }
                        string message = " <span class='actionTopic'> Your Account is Activated successfully. Thanks" + "</span>.";
                        MyAlertBox(
                            "var callbackOk = function () { window.location = \"/a/initialdata/initialDataElement.aspx\"; }; SuccessAlert(\"" +
                            "Process Succeed" + "\", \"" + message + "\", \"\");");
                    }
                    else
                    {
                    }
                    DataTable dt   = stakeInfo.GetStakeInfoById(ddlStakeList.SelectedValue);
                    string    body = PopulateBody(dt);
                    dt = userBll.GetUserInfoById((string)LumexSessionManager.Get("ActiveUserId"));
                    mailContactBll.SendHtmlFormattedEmail(dt.Rows[0]["Email"].ToString(), "Money Receipt", body);
                }
            }
            catch (Exception)
            {
                //throw;
            }
        }
        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;
            }
        }
Exemple #4
0
        protected void btnSave_OnClick_Click(object sender, EventArgs e)
        {
            UserBLL aUser = new UserBLL();

            aUser.UserId   = txtbxUserId.Text.Trim();
            aUser.MobileNo = txtbxMobileNo.Text.Trim();
            DataTable dt = new DataTable();

            dt = aUser.GetUserInfoById(aUser.UserId);
            if (dt.Rows.Count > 0)
            {
                if (txtbxMobileNo.Text == dt.Rows[0]["MobileNo"].ToString() && txtbxUserId.Text == dt.Rows[0]["UserId"].ToString())
                {
                    string email = dt.Rows[0]["Email"].ToString();
                    try
                    {
                        UserBLL userBll = new UserBLL();
                        bool    status  = userBll.CheckUserIdOrMailForResetPass(email);

                        //varificationSection.Visible = true;
                        //userCheckSection.Visible = false;
                        if (status)
                        {
                            Random random = new Random();

                            MailContactBLL mailContactBll = new MailContactBLL();
                            userBll.varifycode = random.Next(100000, 999998) + 1;

                            string   key           = dataEncryptbll.addforvarifycore;
                            string   encrypeteduid = dataEncryptbll.EncryptRijndael(userBll.UserId + "#" + userBll.varifycode, key);
                            string   url           = HttpContext.Current.Request.Url.AbsoluteUri;
                            string[] Partsofurl    = url.Split('/');
                            userBll.ActivationUrl = Server.HtmlEncode("http://" + Partsofurl[2] + "/page/varify.aspx/?uid=" + encrypeteduid);


                            bool mailSend = mailContactBll.SendEmailForPasswordReset(userBll);

                            if (mailSend)
                            {
                                string message = " <span class='actionTopic'>" + "Your mail Send Successfully. Please Cheak your Mail Inbox or Spam" + "</span>.";

                                MyAlertBox("var callbackOk = function () { window.location = \"index.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                            }
                            else
                            {
                                string message = " <span class='actionTopic'>" + "Sorry !! Mail Not Send to this User Please Check User mail or ID is Correct !!!" + "</span>.";
                                MyAlertBox("var callbackOk = function () { window.location = \"recoverpassword.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                            }
                        }
                        else
                        {
                            msgbox.Attributes.Add("Class", "alert alert-warning");
                            msgbox.Visible      = true;
                            msgTitleLabel.Text  = "Exception";
                            msgDetailLabel.Text = "User Id or Email is Not Correct";
                        }
                    }
                    catch (Exception ex)
                    {
                        string message = ex.Message;
                        if (ex.InnerException != null)
                        {
                            message += " --> " + ex.InnerException.Message;
                        }
                        MyAlertBox("ErrorAlert(\"" + ex.GetType() + "\", \"" + message + "\", \"\");");
                    }
                }
                else
                {
                    string message = " <span class='actionTopic'>" + " Invalid Mobile Number " +
                                     "</span>.";
                    MyAlertBox(
                        "var callbackOk = function () { window.location = \"passwordrecovary.aspx\"; }; SuccessAlert(\"" +
                        "Process Succeed" + "\", \"" + message + "\", \"\");");
                }
            }
            else
            {
                string message = " <span class='actionTopic'>" + " User Id Invalid " +
                                 "</span>.";
                MyAlertBox(
                    "var callbackOk = function () { window.location = \"passwordrecovary.aspx\"; }; SuccessAlert(\"" +
                    "Process Succeed" + "\", \"" + message + "\", \"\");");
            }
        }