Example #1
0
        public ActionResult GetCustomerName(int CustomerId)
        {
            var customer = us.GetCustomerByCustomerId(CustomerId);
            var userName = customer.Users.UserName;
            var user     = new ViewModelUsers()
            {
                UserName = userName,
            };

            return(View(user));
        }
        public ActionResult ModifyNameOrHead()
        {
            var customerId = (int)Session["CustomerId"];
            var user       = userService.GetUserByCustomerId(customerId);
            var userDTO    = new ViewModelUsers()
            {
                Head        = user.Head,
                PhoneNumber = user.PhoneNumber,
                RealName    = user.RealName,
                UserId      = user.UserId,
                UserName    = user.UserName,
            };

            return(View(userDTO));
        }
Example #3
0
        public ViewUsers()
        {
            InitializeComponent();

            con = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\keese_000\Desktop\AFSTUDEER STAGE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\KT4\REDO\Herkansing KT4\Herkansing-KT4\Sewco\UsermanagementDB.mdf;Integrated Security=True";

            ViewModelUsers ViewModelUsers = new ViewModelUsers();

            DataContext = ViewModelUsers;
            db          = new LinqToSQLDataContext(con);



            LoadUsers();
        }
Example #4
0
        public ActionResult AdminItem(ViewModelAdmin admin)
        {
            var user    = us.GetUserByAdminId(admin.AdminId);
            var userDTO = new ViewModelUsers
            {
                UserName     = user.UserName,
                CreationTime = user.CreationTime,
                Head         = user.Head,
                RealName     = user.RealName,
                Password     = user.Password,
                PhoneNumber  = user.PhoneNumber,
                UserId       = user.UserId,
            };

            return(PartialView(userDTO));
        }
Example #5
0
 public ActionResult AddAdmin(ViewModelUsers viewModelUser, Guid RoleId)
 {
     if (User != null)
     {
         Users user = new Users
         {
             UserName     = viewModelUser.UserName,
             RealName     = viewModelUser.RealName,
             PhoneNumber  = viewModelUser.PhoneNumber,
             Password     = viewModelUser.Password,
             CreationTime = DateTime.Now,
         };
         us.AddUser(user, RoleId);
         return(RedirectToAction("AdminList", "Admin"));
     }
     return(PartialView());
 }
        public ActionResult MyMall()
        {
            var customerId = Session["CustomerId"];

            if (customerId == null)
            {
                TempData["IfLogin"] = "******";
                return(RedirectToAction("Index", "Home"));
            }
            else
            {
                var            user    = userService.GetUserByCustomerId((int)customerId);
                ViewModelUsers userDTO = new ViewModelUsers()
                {
                    Head = user.Head,
                };
                return(View(userDTO));
            }
        }
        public ActionResult ModifyNameOrHead(ViewModelUsers user)
        {
            Users saveUser = new Users()
            {
                UserId      = user.UserId,
                RealName    = user.RealName,
                PhoneNumber = user.PhoneNumber,
                UserName    = user.UserName,
            };

            if (user.Head == null)
            {
                var u = userService.GetUserByUserId(user.UserId);
                saveUser.Head = u.Head;
            }
            else
            {
                saveUser.Head = GetImageFromWeb();
            }
            userService.ModifyCustomer(saveUser);
            return(RedirectToAction("MyMall"));
        }
Example #8
0
        public ActionResult AddAdmin()
        {
            ViewModelUsers user = new ViewModelUsers();

            return(View(user));
        }