Example #1
0
        private void Save()
        {
            User newUser = new User
            {
                Active    = chkActive.Checked,
                Contact   = txtContact.Text,
                Email     = txtEmail.Text,
                FirstName = txtFirstname.Text,
                LastName  = txtLastname.Text,
                Role      = DropDownRole.SelectedItem.Text
            };

            int affectedRows = CCMSBusinessLayer.AddUser(newUser);

            if (affectedRows > 0)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Success", "alert('User Successfully Saved');", true);
                Reset();
            }
        }
Example #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            AU_email.Enabled     = true;
            AU_firstname.Enabled = true;
            AU_lastname.Enabled  = true;
            AU_role.Enabled      = true;
            Page.Validate();

            if (Page.IsValid)
            {
                if (CCMSBusinessLayer.isExistingUser(txtEmail.Text))
                {
                    updateMsg.Visible = true;
                }

                else
                {
                    Save();
                }
                Reset();
            }
        }
Example #3
0
 public int findUserID(string email)
 {
     return(CCMSBusinessLayer.FindUserIdfromEmail(email));
 }