Example #1
0
        private int UpdateData()
        {
            string FullName    = txtFullName.Text;
            string DisplayName = txtDisplayName.Text;
            string Address     = txtAddress.Text;
            string Phone       = txtPhone.Text;
            string Email       = txtEmail.Text;


            ModuleClass module_obj = new ModuleClass();
            string      Username   = string.Empty;

            if (module_obj.CheckInput(txtUserName.Text))
            {
                Username = txtUserName.Text;
            }
            else
            {
                Response.Write("<script>alert('Invalid Username');</script>");
                Response.End();
            }

            MD5CryptEncrypt md5_obj          = new MD5CryptEncrypt();
            string          Password         = md5_obj.getMd5Hash(txtPassword.Text);
            string          PasswordSalt     = txtPassword.Text;
            string          passwordConfirm  = txtPasswordConfirm.Text;
            string          PasswordQuestion = ddlPassQuestion.SelectedValue;
            string          PasswordAnswer   = txtPassAnswer.Text;

            UserController user_obj = new UserController();
            int            result   = user_obj.Edit(Username, Password, PasswordSalt, PasswordQuestion, PasswordAnswer,
                                                    FullName, DisplayName, Address, Phone, Email);

            return(result);
        }
        private int UpdateData()
        {
            string ApplicationId = ddlApplicationList.SelectedValue;
            int    PortalId      = Convert.ToInt32(ddlPortalList.SelectedValue);
            int    VendorId      = Convert.ToInt32(ddlVendorList.SelectedValue);
            string RoleId        = ddlRoleList.SelectedValue;
            string FullName      = txtFullName.Text;
            string DisplayName   = txtDisplayName.Text;
            string MobilePIN     = txtMobilePIN.Text;
            string Address       = txtAddress.Text;
            string Phone         = txtPhone.Text;
            string Email         = txtEmail.Text;

            //=================================================
            bool _IsSuperUser = chkIsSuperUser.Checked;
            int  IsSuperUser;

            if (_IsSuperUser == true)
            {
                IsSuperUser = 1;
            }
            else
            {
                IsSuperUser = 0;
            }
            //=================================================
            bool _IsDeleted = chkIsDeleted.Checked;
            int  IsDeleted;

            if (_IsDeleted == true)
            {
                IsDeleted = 1;
            }
            else
            {
                IsDeleted = 0;
            }
            //=================================================
            bool _IsApproved = chkIsApproved.Checked;
            int  IsApproved;

            if (_IsApproved == true)
            {
                IsApproved = 1;
            }
            else
            {
                IsApproved = 0;
            }
            //=================================================
            bool _UpdatePassword = chkUpdatePassword.Checked;
            int  UpdatePassword;

            if (_UpdatePassword == true)
            {
                UpdatePassword = 1;
            }
            else
            {
                UpdatePassword = 0;
            }
            //=================================================
            bool _IsLockedOut = chkIsLockedOut.Checked;
            int  IsLockedOut;

            if (_IsLockedOut == true)
            {
                IsLockedOut = 1;
            }
            else
            {
                IsLockedOut = 0;
            }
            //=================================================
            ModuleClass module_obj = new ModuleClass();
            string      Username   = string.Empty;

            if (module_obj.CheckInput(txtUserName.Text))
            {
                Username = txtUserName.Text;
            }
            else
            {
                Response.Write("<script>alert('Invalid Username');</script>");
                Response.End();
            }

            MD5CryptEncrypt md5_obj          = new MD5CryptEncrypt();
            string          Password         = md5_obj.getMd5Hash(txtPassword.Text);
            string          PasswordSalt     = txtPassword.Text;
            string          passwordConfirm  = txtPasswordConfirm.Text;
            string          PasswordQuestion = ddlPassQuestion.SelectedValue;
            string          PasswordAnswer   = txtPassAnswer.Text;

            string Comment = txtComment.Text;

            UserController user_obj = new UserController();
            int            result   = user_obj.Update(_idx, ApplicationId, PortalId, VendorId, RoleId, Username,
                                                      Password, PasswordSalt, PasswordQuestion, PasswordAnswer,
                                                      FullName, DisplayName, Address, MobilePIN, Phone, Email,
                                                      IsSuperUser, UpdatePassword, IsDeleted, IsApproved, IsLockedOut, Comment);

            return(result);
        }
Example #3
0
        private int AddData()
        {
            string ApplicationId = ddlApplicationList.SelectedValue;
            int    PortalId      = Convert.ToInt32(ddlPortalList.SelectedValue);
            int    VendorId      = Convert.ToInt32(ddlVendorList.SelectedValue);
            string RoleId        = ddlRoleList.SelectedValue;
            string FullName      = txtFullName.Text;
            string DisplayName   = txtDisplayName.Text;
            string MobilePIN     = txtMobilePIN.Text;
            string Address       = txtAddress.Text;
            string Phone         = txtPhone.Text;
            string Email         = txtEmail.Text;

            bool _IsSuperUser = chkIsSuperUser.Checked;
            int  IsSuperUser;

            if (_IsSuperUser == true)
            {
                IsSuperUser = 1;
            }
            else
            {
                IsSuperUser = 0;
            }

            bool _IsDeleted = chkIsDeleted.Checked;
            int  IsDeleted;

            if (_IsDeleted == true)
            {
                IsDeleted = 1;
            }
            else
            {
                IsDeleted = 0;
            }

            bool _IsApproved = chkIsApproved.Checked;
            int  IsApproved;

            if (_IsApproved == true)
            {
                IsApproved = 1;
            }
            else
            {
                IsApproved = 0;
            }

            bool _UpdatePassword = chkUpdatePassword.Checked;
            int  UpdatePassword;

            if (_UpdatePassword == true)
            {
                UpdatePassword = 1;
            }
            else
            {
                UpdatePassword = 0;
            }

            ModuleClass module_obj = new ModuleClass();
            string      Username   = string.Empty;

            if (module_obj.CheckInput(txtUserName.Text))
            {
                Username = txtUserName.Text;
            }
            else
            {
                string scriptCode = "<script>alert('Invalid Username.');</script>";
                Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "scriptName", scriptCode);
            }

            MD5CryptEncrypt md5_obj          = new MD5CryptEncrypt();
            string          Password         = md5_obj.getMd5Hash(txtPassword.Text);
            string          PasswordSalt     = txtPassword.Text;
            string          passwordConfirm  = txtPasswordConfirm.Text;
            string          PasswordQuestion = ddlPassQuestion.SelectedValue;
            string          PasswordAnswer   = txtPassAnswer.Text;

            string Comment = txtComment.Text;

            UserController user_obj = new UserController();
            int            result   = user_obj.Insert(ApplicationId, PortalId, VendorId, RoleId, Username, Password, PasswordSalt,
                                                      PasswordQuestion, PasswordAnswer, FullName, DisplayName, Address, MobilePIN,
                                                      Phone, Email, IsSuperUser, UpdatePassword, IsDeleted, IsApproved, Comment);

            return(result);
        }