Ejemplo n.º 1
0
        public ActionResult ChangeUser(FormCollection frmCollection, string submitButton)
        {
            int          ID        = Convert.ToInt32(frmCollection["UsrID"]);
            User         usr       = new User();
            UsersHandler usrHandlr = new UsersHandler();

            usr = usrHandlr.GetUserDetails(ID);
            if (submitButton == "Save")
            {
                string pwd   = frmCollection["pwdVal"];
                string email = frmCollection["Email"];
                if (!(string.IsNullOrEmpty(pwd)))
                {
                    pwd = Encryptor.MD5Hash(pwd);
                }
                if (!(string.IsNullOrEmpty(pwd)))
                {
                    usr.Password = pwd;
                }
                usr.Email = email;
                usrHandlr.UpdateUser(usr);
                return(RedirectToAction("Home", "UserHome", usr));
            }
            else if (submitButton == "Exit from Application")
            {
                usrHandlr.RemoveUser(Convert.ToInt32(frmCollection["UsrID"]));
                return(RedirectToAction("Login", "TCLogin"));
            }
            return(RedirectToAction("Home", "UserHome", usr));
        }
Ejemplo n.º 2
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     usersHandler.RemoveUser(pos);
 }
Ejemplo n.º 3
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     usersHandler.RemoveUser(pos);
     MainWindow.myNavigationFrame.NavigationService.Navigate(new MainPage());
 }