示例#1
0
        protected void btnLogin_Click(object sender, EventArgs e)
        {
            if (txtbxUserName.Text != "" && txtbxPassword.Text != "")
            {
                try
                {

                    LoginBll loginbll = new LoginBll();
                    loginbll.UserId = txtbxUserName.Text.ToString();
                    loginbll.UserPass = txtbxPassword.Text.ToString();
                    if (loginbll.VerifyPassword())
                    {
                        loginbll = loginbll.GetUserById(loginbll.UserId);
                        if (loginbll.IsVarified == "Yes")
                        {
                            LumexSessionManager.Add("UserGroupId", loginbll.UserGroup);
                            LumexSessionManager.Add("ActiveUserId", loginbll.UserId);
                            LumexSessionManager.Add("ActiveUserName", loginbll.UserName);
                            LumexSessionManager.Add("UserLastName", loginbll.LastName);
                            LumexSessionManager.Add("UserAvater", loginbll.PerPhoto);
                            LumexSessionManager.Add("isMenu", "N");
                            LumexSessionManager.Add("ActiveMenuFor", "globalapp");
                            //LumexSessionManager.Add("UserIdForView","");

                            Response.Redirect("~/default.aspx", false);
                        }
                        else
                        {
                            string message = " <span class='actionTopic'>" +" Your account is not Varified. Please Check your Email. Thanks"+ "</span>.";
                            MyAlertBox("var callbackOk = function () { window.location = \"/login.aspx\"; }; SuccessAlert(\"" +
                                "Process Succeed" + "\", \"" + message + "\", \"\");");
                        }
                    }
                    else
                    {
                        lblmsg.Visible = true;
                        lblmsg.Text = "User ID or Password is invalid.";

                    }

                }
                catch (Exception ex)
                {
                   // lblmsg.Visible = true;
                  //  lblmsg.Text = ex.ToString();
                }

            }
            else
            {
                lblmsg.Visible = true;
                lblmsg.Text = "UserName or Password field is Empty.";
            }
        }
示例#2
0
        public LoginBll GetUserById(string userId)
        {
            LumexDBPlayer db = LumexDBPlayer.Start();

            try
            {
                LoginBll user = LoginDal.GetUserById(userId, db);

                db.Stop();

                return(user);
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                db.Stop();
            }
        }
示例#3
0
        protected void btnUserCreate_click(object sender, EventArgs e)
        {
            try
            {
                if (!checkDuplicateUser())
                {

                    UserBLL aUser = new UserBLL();
                    LoginBll login = new LoginBll();
                    aUser.UserId = txtbxUserName.Text.Trim();
                    aUser.FirstName = txtbxUserName.Text.Trim();
                    aUser.LastName = "";
                    aUser.PassportNo = "";
                    aUser.Address = "";
                    aUser.Country = "";
                    aUser.House = "";
                    aUser.Street = "";
                    aUser.Area = "";
                    aUser.MobileNo = txtbxmobile.Text.Trim();
                    aUser.Email = txtbxemail.Text.Trim();
                    aUser.EmrName = "";
                    aUser.EmrRelation = "";
                    aUser.EmrAddress = "";
                    aUser.EmrMobile = "";
                    aUser.EmeEmail = "";
                    aUser.EmeCountry = "";
                    aUser.ActualPass = "";
                    aUser.UserPin = passwordTextBox.Text;
                    aUser.IsActive = "No";
                    aUser.Isvarified = "Yes";
                    aUser.Createdby = "";
                    aUser.UserGroupId = drpdownGroup.SelectedValue;
                    aUser.Certificate = "";
                    aUser.Password = LumexLibraryManager.EncodeIntoMd5Hash("LTSsL[" + passwordTextBox.Text + "]0");
                    aUser.ActualPass = passwordTextBox.Text;
                    string IsUpload = photoUploadfn(aUser.Email);

                    if (IsUpload == "")
                    {
                        msgbox.Attributes.Add("Class", "alert alert-warning");
                        msgTitleLabel.Text = "Error!!!!";
                        msgDetailLabel.Text = "Pleace Check File Extention or File size.You can only upload Image and size less than 128Kb";
                        msgbox.Visible = true;
                        string message = " <span class='actionTopic'>" + " Pleace Check File Extention or File size.You can only upload Image and size less than 128Kb</span>.";
                        MyAlertBox("var callbackOk = function () { window.location = \"/setting/user/create.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                    }
                    else
                    {

                        aUser.PerPhoto = IsUpload;
                        bool status = aUser.SaveUserInfo();
                        if (status)
                        {

                            //bool st = SendConformationEmail(userbll);
                            //if (st)
                            //{

                            string message = " <span class='actionTopic'>" + "User Create Successfully</span>.";
                            MyAlertBox("var callbackOk = function () { window.location = \"/setting/user/create.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");

                        }
                        //else
                        //{
                        //    string message = " <span class='actionTopic'>" + "User Create Successfully.But Not Send Please Contact Your Admistration.</span>.";
                        //    MyAlertBox("var callbackOk = function () { window.location = \"/setting/user/list.aspx\"; }; SuccessAlert(\"" + "Process Succeed" + "\", \"" + message + "\", callbackOk);");
                        //}
                        //  }

                        //    }

                        //}

                    }
                }
            }
            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;
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {

                UserBLL aUserBll = new UserBLL();

                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
                {
                    UserBLL aUser = new UserBLL();
                    LoginBll login = new LoginBll();
                    aUser.UserId = txtbxUserName.Text;
                    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.EmrAddress = txtbxContactAddress.Text.Trim();
                    aUser.EmrRelation = ddlContactRelation.SelectedValue;
                    aUser.EmrMobile = txtbxContactMobile.Text.Trim();
                    aUser.EmeEmail = txtContactEmail.Text.Trim();
                    aUser.EmeCountry = ddlContactCountry.SelectedValue;
                    aUser.IsActive = "No";
                    aUser.Isvarified = "No";
                    aUser.Createdby = LumexSessionManager.Get("ActiveUserId").ToString();
                    aUser.CreatedFrom = LumexLibraryManager.GetTerminal();
                    aUser.UserGroupId = "UG003";
                    aUser.PerPhoto = "";

                    bool status = aUserBll.UpdateUserInfo(aUser);
                    if (status)
                    {
                        string message = " <span class='actionTopic'>" + " Data Update Successfully as Id: " +
                                         aUser.UserId + "</span>.";
                        MyAlertBox(
                            "var callbackOk = function () { window.location = \"/a/stake/create.aspx\"; }; SuccessAlert(\"" +
                            "Process Succeed" + "\", \"" + message + "\", \"\");");
                    }
                    else
                    {
                        string message = " <span class='actionTopic'>" + " Data Update Successfully as Id: " +
                                         aUser.UserId + "</span>.";
                        MyAlertBox(
                            "var callbackOk = function () { window.location = \"/a/stake/create.aspx\"; }; SuccessAlert(\"" +
                            "Process Succeed" + "\", \"" + message + "\", \"\");");
                    }
                }

            }
            catch (Exception)
            {

                //  throw;
            }
        }
示例#6
0
        protected void btnGenerate_Click(object sender, EventArgs e)
        {
            try
            {
                LoginBll loginbll = new LoginBll();
                loginbll.UserId = (string)LumexSessionManager.Get("ActiveUserId");
                loginbll.UserPass = txtbxPassword.Text.Trim();
                if (loginbll.VerifyPassword())
                {

                    StakeInfoBLL stake = new StakeInfoBLL();
                    int TotalPin = Convert.ToInt16(txtbxTotalPin.Text);
                    DataTable dt = new DataTable();
                    DataRow dr = null;
                    dt.Columns.Add(new DataColumn("StakeId"));
                    dt.Columns.Add(new DataColumn("StakePin"));
                    dt.Columns.Add(new DataColumn("IsActive"));
                    for (int i = 0; i < TotalPin; )
                    {
                        Random random = new Random();

                        string pinserial = GetSerialNumber();

                        dr = dt.NewRow();
                        if (!stake.CheckDuplicateKey(pinserial))
                        {
                            dr["StakeId"] = ddlStakeList.SelectedValue;
                            dr["StakePin"] = pinserial;
                            dr["IsActive"] = "Yes";
                            dt.Rows.Add(dr);
                            i++;
                        }
                    }
                    if (dt.Rows.Count == TotalPin && TotalPin > 0)
                    {

                        bool status = stake.SaveGeneratedPin(dt);
                        if (status)
                        {
                            UserAccountBLL accountBll = new UserAccountBLL();
                            accountBll.TotalAmount = Convert.ToDecimal(txtbxTotalPin.Text)*
                                                  stake.getstakeAmountByStakeId(ddlStakeList.SelectedValue);
                            accountBll.Particular = "Generate PIN Amount-" + accountBll.TotalAmount.ToString() + " of Stake" +
                                                ddlStakeList.SelectedItem.Text;
                            accountBll.RPType = "CR";
                            accountBll.AffectforId = "";
                            accountBll.Affectfor = "PIN Generate";

                            accountBll.InsertReceivePaymentWhenAffectIncome();

                            GetGeneratedPinList();
                            string message = " <span class='actionTopic'> The" + TotalPin.ToString() +
                                             " is Generated successfully. Thanks" + "</span>.";
                            MyAlertBox(
                                "var callbackOk = function () { window.location = \"/a/initialdata/initialDataElement.aspx\"; }; SuccessAlert(\"" +
                                "Process Succeed" + "\", \"" + message + "\", \"\");");
                        }
                    }
                }
                else
                {
                    msgbox.Visible = true; msgTitleLabel.Text = "Password Miss Match!!"; msgDetailLabel.Text = "Sorry your given password don't Match. Try Correct one.";
                    msgbox.Attributes.Add("Class", "alert alert-warning");

                }

            }
            catch (Exception)
            {

                throw;
            }
        }