public CoursePageViewModel() { this.CategoryCourseList = new ObservableCollection <CategoryItem> { new CategoryItem("全部", true), new CategoryItem("课程1", false), new CategoryItem("课程2", false), new CategoryItem("课程3", false), new CategoryItem("课程4", false), }; this.CategoryskillList = new ObservableCollection <CategoryItem> { new CategoryItem("全部", true), new CategoryItem("技术1", false), new CategoryItem("技术2", false), new CategoryItem("技术3", false), new CategoryItem("技术4", false), }; // 取出所有的老师名称 IUserSevice userSvc = new UserSevice(); this.CategoryTeacherList = new ObservableCollection <CategoryItem>(); CategoryTeacherList.Add(new CategoryItem("全部", true)); foreach (var name in userSvc.GetTeacher()) { CategoryTeacherList.Add(new CategoryItem(name, false)); } InitCourseList(); this.TeacherFilter = new RelayCommand <object>(o => DoTeacherFilterCmd(o)); }
//show ra table nhân viên public ActionResult List(UserSearchModel searchModel) { var pagedList = UserSevice.Search(searchModel.TenNV, searchModel.TaiKhoan, searchModel.SoDT, searchModel.ChucVu, searchModel.PageIndex); pagedList.SearchModel = searchModel; return(PartialView("_List", pagedList)); }
public ActionResult CreateEdit(USER model) { ViewBag.Sex = WebUtil.GetEnumSelectList <Sex_Type>(); if (model.ID == 0) { var result = UserSevice.Create(model); return (Json( new RedirectCommand() { Code = result.Code, Message = result.Message, Url = Url.Action("Index", new { id = model.ID }) }, JsonRequestBehavior.AllowGet)); } else { var result = UserSevice.Edit(model); return (Json( new RedirectCommand() { Code = result.Code, Message = result.Message, Url = Url.Action("Index", new { id = model.ID }) }, JsonRequestBehavior.AllowGet)); } }
// GET: Admin public ActionResult Index() { var users = UserSevice.GetAll() .Select(s => new UserViewModel(s, UserManager.GetRoles(s.Id).ToList())) .ToList(); return(View(users)); }
public ActionResult Edit(int id) { var model = UserSevice.GetById(id); ViewBag.Sex = WebUtil.GetEnumSelectList <Sex_Type>(); ViewBag.Status = WebUtil.GetEnumSelectList <User_Status>(); return(View("CreateEdit", model)); }
//string connectionStr = Configuration.GetSection("AppSetting")["MapKey"]; public HomeController(UserSevice userService, SysUserSevice sysUserService, IOrderSevice orderSevice, IConnectionMultiplexer redis, IRedisClient redisClient, IMemoryCache memoryCache) { _userService = userService; _sysUserService = sysUserService; _orderSevice = orderSevice; _redis = redis; _redisClient = redisClient; _db = _redis.GetDatabase(); _server = redis.GetServer(redis.GetEndPoints()[0]); _memoryCache = memoryCache; }
public void CheckPasswordCorrect() { //Arrange var userService = new UserSevice(); var testPassword = "******"; // Act (string password, string salt) = userService.GeneratePasswordHash(testPassword); // Asset Assert.IsTrue(userService.CheckPassword(testPassword, salt, password)); }
public ActionResult Edit() { UserSevice.CreateUserSingleton(userId: 1, userName: "******"); var model = new AppMonitoringViewModel(); var interval = intervalService.GetActiveInterval(); model.Internal = interval; model.Applications = applicationService.GetApplications(); return(View(model)); }
public void CheckPasswordWrongSalt() { //Arrange var userService = new UserSevice(); var testPassword = "******"; var wrongSalt = CryptographyService.CreateHexStringFromByteArray(CryptographyService.GenerateSalt()); // Act (string password, string salt) = userService.GeneratePasswordHash(testPassword); // Asset Assert.IsFalse(userService.CheckPassword(testPassword, wrongSalt, password)); }
public SignupController(IAuthService authService, UserSevice userSevice) { this.authService = authService; this.userSevice = userSevice; }