Exemplo n.º 1
0
		private void btnDelete_Click(object sender, System.EventArgs e)
		{
			BPUsers bp = new BPUsers();
			BEUsers.tbl_UsersRow User;
			
			DSUsers = bp.SelectByID(UserID);
			User = DSUsers.tbl_Users.FindByUserID(UserID);

			User.Delete();
			bp.Update(DSUsers);

			Response.Redirect("BrowseUsers.aspx");
		}
Exemplo n.º 2
0
		private void btnSubmit_Click(object sender, System.EventArgs e)
		{
			BPUsers bp = new BPUsers();
			DSUsers = bp.SelectByID(UserID);

			BEUsers.tbl_UsersRow user = DSUsers.tbl_Users.FindByUserID(UserID);
			user.LoginID = txtLoginName.Text;
			user.Password = txtPassword.Text;

			int testUserID = bp.Login(txtLoginName.Text, txtPassword.Text);

			if (testUserID == 0 || testUserID == UserID)
			{
				bp.Update(DSUsers);
				lblErr.Text = "";
				Response.Redirect(HttpUtility.UrlDecode( Request.QueryString["ReturnUrl"]));
			}
			else
			{
				lblErr.Text = "Sorry username and password taken.";
			}
		}
Exemplo n.º 3
0
		private void btnSubmit_Click(object sender, System.EventArgs e)
		{
			BPUsers bpUsers = new BPUsers();
			BEUsers.tbl_UsersRow user;
			if (UserID == 0)
			{
				// Add a user
				user = DSUsers.tbl_Users.Newtbl_UsersRow();
			}
			else
			{
				// Edit a user
				DSUsers = bpUsers.SelectByID(UserID);
				user = DSUsers.tbl_Users.FindByUserID(UserID);				
			}

			this.Save(user);

			DSUsers.EnforceConstraints = false;
			user.UserActive = chkActive.Checked;
			
			if (UserID == 0)
			{
				user.DateCreated = DateTime.Now;
				user.DateModified = DateTime.Now;
				user.ModifiedByAdminID = Convert.ToInt32(CarrielUser.CarrielIdentity.MemberID);
				
				DSUsers.tbl_Users.Addtbl_UsersRow(user);
			}
			else
			{
				user.DateModified = DateTime.Now;
				user.ModifiedByAdminID = Convert.ToInt32(CarrielUser.CarrielIdentity.MemberID);
			}

			bpUsers.Update(DSUsers);
		
			Response.Redirect("BrowseUsers.aspx");
		}