示例#1
0
        public IActionResult Add()
        {
            var customer    = new CustomerViewModel();
            var staffs      = _staffRepository.AllUser();
            var loginUserId = _userManager.GetUserId(User);

            customer.StaffId = loginUserId;
            customer.Staffs  = staffs.Select(x =>
            {
                return(new SelectListItem()
                {
                    Text = x.StaffCode + " - " + x.Username + " - " + x.LastName + " " + x.FirstName,
                    Value = x.Id
                });
            });
            return(View(customer));
        }