protected void btnAdd_Click(object sender, EventArgs e)
        {
            if (!commonBAL.isUserAuthorisedForPageFunc(LoggedInUser.UserId, thisPageName, "add"))
            {
                LoggedIn master = (LoggedIn)this.Master;
                master.ShowMessage("You are not authorised to Perform any operation on this page. Please contact system administrator.", false);
                return;
            }
            if (ValidData())
            {

            }
            else
            {
                LoggedIn master = (LoggedIn)this.Master;
                CommonBAL combal = new CommonBAL();
                UserBE addUserBE = new UserBE();
                UserDAL addUserdAL = new UserDAL();
                UserBAL addUserBal = new UserBAL();
                int ReturnOutput = 0;
                addUserBE.LastModifiedBy = ((UserBE)Session["LoggedInUser"]).UserId;

                addUserBE.UserName = txtUserName.Text;
                addUserBE.FirstName = txtFName.Text;
                addUserBE.MiddleName = txtMName.Text;
                addUserBE.LastName = txtLName.Text;
                addUserBE.PrimaryEmailId = txtPREmailId.Text;
                addUserBE.SecondaryEmailId = txtSCEmailId.Text;
                addUserBE.MobileNo = txtMobileNo.Text;
                addUserBE.Address1 = txtAddress1.Text;
                addUserBE.Address2 = txtAddress2.Text;
                addUserBE.Street = txtStreet.Text;
                addUserBE.City = txtCity.Text;
                addUserBE.State1 = txtState.Text;
                addUserBE.Country = txtCountry.Text;
                addUserBE.SecretQuest = ddSecretQuest.SelectedValue;
                addUserBE.SecretAns = txtSecretAns.Text;
                addUserBE.EncPass = combal.Encrypt(txtPass.Text, false);

                if (addUserBal.AddUser(addUserBE, ref ReturnOutput))
                {
                  
                    if(ReturnOutput==1)
                    {
                        master.ShowMessage("User of this User Name Already exist. ", false);
                    }
                    else if (ReturnOutput == 2)
                    {
                        clearFields();  
                        master.ShowMessage("Record Inserted Successfully.", true);
                    }
                }
                else
                {
                    
                    master.ShowMessage("Unsuccessful", false);
                }
            }

        }
Esempio n. 2
0
        public bool Validate(ref UserBE user)
        {
            UserDAL userDAL = new UserDAL();

            if (userDAL.Validate(ref user))
                return true;
            else
                return false;
        }
Esempio n. 3
0
        public bool GetAllUserDetails(ref DataTable dt)
        {
            UserDAL userDAL = new UserDAL();

            if (userDAL.GetAllUserDetails(ref dt))
                return true;
            else
                return false;
        }
Esempio n. 4
0
 public bool ViewUser(UserBE viewuser)
 {
     UserDAL userDAL = new UserDAL();
     if (userDAL.ViewUser(viewuser))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Esempio n. 5
0
 public bool Modify(UserBE user)
 {
     UserDAL userDAL = new UserDAL();
     if (userDAL.Modify(user))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Esempio n. 6
0
 public bool Delete(UserBE user)
 {
     UserDAL userDAL = new UserDAL();
     if (userDAL.Delete(user))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Esempio n. 7
0
 public bool AddUser(UserBE addUserBE , ref int ReturnOutput)
 {
     UserDAL userDAL = new UserDAL();
     if (userDAL.AddUser(addUserBE, ref ReturnOutput))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Esempio n. 8
0
        public DataSet CheckConfirmationRequest(string UserId, string key)
        {
            try
            {
                UserDAL userDAL = new UserDAL();

                return userDAL.CheckConfirmationRequest(UserId, key);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
            }
        }
Esempio n. 9
0
        public int SaveConfirmation(string UserId, string Key, string Password)
        {
            try
            {
                UserDAL userDAL = new UserDAL();

                return userDAL.SaveConfirmation(UserId, Key, Password);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
            }
        }
Esempio n. 10
0
 public DataSet GetSecretQuestion()
 {
     UserDAL userDAL = new UserDAL();
     return userDAL.GetSecretQuestion();
 }
Esempio n. 11
0
        public DataSet InsertUser(UserBE UserBE)
        {
            try
            {

                UserDAL userDAL = new UserDAL();

                return userDAL.InsertUser(UserBE);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {

            }
        }
Esempio n. 12
0
        public DataSet GetUsers()
        {
            try
            {
                UserDAL userDAL = new UserDAL();
                return userDAL.GetUsers();
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {

            }
        }
Esempio n. 13
0
 public bool ResetPassword(UserBE user)
 {
     UserDAL userDAL = new UserDAL();
     if (userDAL.ResetPassword(user))
     {
         return true;
     }
     else
     {
         return false;
     }
 }
Esempio n. 14
0
 public bool UserAccessRight(UserBE user, ref DataTable dt)
 {
     UserDAL userDAL = new UserDAL();
     if(userDAL.UserAccessRight(user,ref dt))
     {
         return true;
     }
     else
     {
         return false;
     }
 }