public JsonResult AddPlace(PlaceAddSubmitModel model) { JsonModel jm = new JsonModel(); var owner = GetCurrentUser(); //如果要添加的小区不存在 IPropertyPlaceBLL propertyPlaceBll = BLLFactory <IPropertyPlaceBLL> .GetBLL("PropertyPlaceBLL"); var place = propertyPlaceBll.GetEntity(u => u.Id == model.PlaceId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); if (place == null) { jm.Msg = "小区已不存在"; } //如果该用户已经有要添加的小区 else if (owner.UserPlaces.Any(up => up.UserId == owner.Id && up.PropertyPlaceId == model.PlaceId)) { jm.Msg = "小区已绑定,请重新选择"; } else { //添加拥有的小区 owner.UserPlaces.Add(new R_UserPlace() { PropertyPlaceId = model.PlaceId }); IUserBLL ownerBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); ownerBll.Update(owner); jm.Content = model.PlaceId.ToString(); } return(Json(jm, JsonRequestBehavior.AllowGet)); }
public PersonaController() { personaBLL = new PersonaBLLImpl(); userBLL = new UserBLLImpl(); roleBLL = new RoleBLLImpl(); UsersInRolesBLL = new UsersInRolesBLLImpl(); }
public ApiResultModel EditLifeBill(EditLifeBillModel model) { ApiResultModel resultModel = new ApiResultModel(); try { //通过用户Id查找业主 IUserBLL ownerBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); T_User owner = ownerBll.GetEntity(u => u.Id == model.UserId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); //如果业主存在 if (owner != null) { //如果验证Token不通过或已过期 if (DateTime.Now > owner.TokenInvalidTime || model.Token != owner.Token) { resultModel.Msg = APIMessage.TOKEN_INVALID; return(resultModel); } //更新最近登录时间和Token失效时间 owner.LatelyLoginTime = DateTime.Now; owner.TokenInvalidTime = DateTime.Now.AddDays(Convert.ToInt32(PropertyUtils.GetConfigParamValue("TokenInvalid"))); ownerBll.Update(owner); ILifeBillBLL lifeBillBll = BLLFactory <ILifeBillBLL> .GetBLL("LifeBillBLL"); T_LifeBill lifebill = lifeBillBll.GetEntity(u => u.Id == model.Id && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); //如果该生活记账存在 if (lifebill != null) { lifebill.Id = model.Id; lifebill.BillTypeId = model.CategoryId; lifebill.PayTypeId = model.PayId; lifebill.Money = model.Money; lifebill.ConsumptionDate = Convert.ToDateTime(model.PayDate); lifebill.CreateDate = Convert.ToDateTime(model.DateStr); lifebill.Memo = model.Mark; //更新 lifeBillBll.Update(lifebill); } else { resultModel.Msg = "生活记账不存在"; } } else { resultModel.Msg = APIMessage.NO_USER; } } catch { resultModel.Msg = APIMessage.REQUEST_EXCEPTION; } return(resultModel); }
public readonly IReadWriteBLL <Base_UserInfo> _userInfoBll; //用户表 public BaseCodeBLL(IUserBLL userBll, IReadWriteBLL <Base_ModuleInfo> moduleInfoBll, IReadWriteBLL <Base_UserInfo> userInfoBll) { _userBll = userBll; _moduleInfoBll = moduleInfoBll; _userInfoBll = userInfoBll; }
public JsonResult GenderInfo(GenderInfoModel model) { JsonModel jm = new JsonModel(); var owner = GetCurrentUser(); if (owner != null) { IUserBLL ownerBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); if (model.Gerder != null) { owner.Gender = model.Gerder; ownerBll.Update(owner); } else { owner.Gender = null; ownerBll.Update(owner); } } else { jm.Msg = "该用户不存在"; } return(Json(jm, JsonRequestBehavior.AllowGet)); }
private void ManageUserForm_Load(object sender, EventArgs e) { IUserRepository userRepository = TripApplication.Instance.DBFactory.CreateUserRepository(); m_userBLL = new UserBLL(userRepository); FillGrid(); }
public UserController(IUserBLL bll, IChangesHistoryBLL changesHistoryBll, IPageBLL pageBLL) : base(pageBLL, Enums.MenuList.USER) { _bll = bll; _changesHistoryBll = changesHistoryBll; _mainMenu = Enums.MenuList.MasterData; }
public ActionResult Autherize(UserViewModel userModel) { userBLL = new UserBLLImpl(); var userDetails = userBLL.getUser(userModel.UserName, userModel.Password); Session.Abandon(); FormsAuthentication.SignOut(); if (userDetails == null) { userModel.LoginErrorMessage = "Nombre de Usuario o Password Incorrectos"; return(View("Index", userModel)); } else { Session["userID"] = userDetails.UserId; Session["userName"] = userDetails.UserName; var authTicket = new FormsAuthenticationTicket(userDetails.UserName, true, 100000); var cookie = new HttpCookie(FormsAuthentication.FormsCookieName, FormsAuthentication.Encrypt(authTicket)); Response.Cookies.Add(cookie); var name = User.Identity.Name; // line 4 return(RedirectToAction("Index", "Home")); } }
public ApiPageResultModel DisposeFeedbackList([FromUri] PagedSearchModel model) { ApiPageResultModel resultModel = new ApiPageResultModel(); try { //根据用户ID查找业主 IUserBLL ownerBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); T_User owner = ownerBll.GetEntity(u => u.Id == model.UserId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); //如果业主存在 if (owner != null) { //如果验证Token不通过或已过期 if (DateTime.Now > owner.TokenInvalidTime || model.Token != owner.Token) { resultModel.Msg = APIMessage.TOKEN_INVALID; return(resultModel); } //更新最近登录时间和Token失效时间 owner.LatelyLoginTime = DateTime.Now; owner.TokenInvalidTime = DateTime.Now.AddDays(Convert.ToInt32(PropertyUtils.GetConfigParamValue("TokenInvalid"))); ownerBll.Update(owner); //获取要公示的问题解决反馈 总个数和分页数据 IQuestionBLL questionBll = BLLFactory <IQuestionBLL> .GetBLL("QuestionBLL"); //条件已处理和要公示 var placeList = owner.UserPlaces.Select(m => m.PropertyPlaceId); Expression <Func <T_Question, bool> > where = u => u.Status == ConstantParam.DISPOSED && u.IsPublish == ConstantParam.PUBLISHED_TRUE && placeList.Contains(u.PropertyPlaceId); resultModel.Total = questionBll.Count(where); resultModel.result = questionBll.GetPageList(where, "Id", false, model.PageIndex).ToList().Select(q => new { Id = q.Id, Title = q.Title, Desc = string.IsNullOrEmpty(q.Desc) ? "" : q.Desc, UploadUserName = q.UploadUser.UserName, UploadTime = q.UploadTime.ToString("yyyy-MM-dd HH:mm:ss"), Imgs = string.IsNullOrEmpty(q.Imgs) ? new string[] { } : q.Imgs.Split(';'), AudioPath = q.AudioPath, VoiceDuration = q.VoiceDuration, PlaceName = q.PropertyPlace.Name, DisposeDesc = q.QuestionDisposes.FirstOrDefault().DisposeDesc, DisposeUserName = string.IsNullOrEmpty(q.QuestionDisposes.FirstOrDefault().DisposeUser.TrueName) ? q.QuestionDisposes.FirstOrDefault().DisposeUser.UserName : q.QuestionDisposes.FirstOrDefault().DisposeUser.TrueName, DisposesTime = q.QuestionDisposes.FirstOrDefault().DisposeTime.ToString("yyyy-MM-dd HH:mm:ss") }); } else { resultModel.Msg = APIMessage.NO_USER; } } catch { resultModel.Msg = APIMessage.REQUEST_EXCEPTION; } return(resultModel); }
public LoginController(IUserBLL userBll, IPageBLL pageBll, IPOABLL poabll, IUserAuthorizationBLL userAuthorizationBll) : base(pageBll, Enums.MenuList.LOGIN) { _userBll = userBll; _poabll = poabll; _userAuthorizationBll = userAuthorizationBll; }
/// <summary> /// 通过构造函数注入需要使用到的BLL /// </summary> /// <param name="login"></param> /// <param name="wzzmodel"></param> /// <param name="user"></param> public HomeController(ILoginBLL login, IWZZModelBLL wzzmodel, IUserBLL user, IVisitAmountBLL visitAmountBLL) { _login = login; _wzzmodel = wzzmodel; _user = user; _visitamount = visitAmountBLL; }
public ActionResult UserResetPassword(PassResetActiveModel model) { if (model.Body == null) { return(RedirectToAction("ResetUrlInvalid")); } //将用户ID解密 int UserId = Int32.Parse(PropertyUtils.DecodeBase64(model.Body)); IUserBLL userBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); var user = userBll.GetEntity(u => u.Id == UserId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); if (user != null) { //如果重置密码激活码存在且未失效 if (!string.IsNullOrEmpty(user.Activecode) && model.Activecode == user.Activecode && user.ActivecodeInvalidTime != null && DateTime.Now <= user.ActivecodeInvalidTime.Value) { UserPassResetModel m = new UserPassResetModel(); m.UserId = user.Id; m.UserName = user.UserName; m.Activecode = user.Activecode; return(View(m)); } else { return(RedirectToAction("ResetUrlInvalid")); } } else { return(RedirectToAction("ResetUrlInvalid")); } }
public ActionResult UserResetPassword(UserPassResetModel model) { //判断提交模型数据是否正确 if (!ModelState.IsValid) { return(View(model)); } IUserBLL userBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); var user = userBll.GetEntity(u => u.Id == model.UserId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); if (user != null) { //如果重置密码激活码存在且未失效 if (!string.IsNullOrEmpty(user.Activecode) && model.Activecode == user.Activecode && user.ActivecodeInvalidTime != null && DateTime.Now < user.ActivecodeInvalidTime.Value) { user.Password = PropertyUtils.GetMD5Str(model.Password); //密码重置链接失效 user.Activecode = ""; user.ActivecodeInvalidTime = null; //如果修改成功 if (userBll.Update(user)) { return(RedirectToAction("ResetSuccess")); } } } return(RedirectToAction("Error500")); }
public ApiResultModel DeleteReply(DeleteReplyModel model) { ApiResultModel resultModel = new ApiResultModel(); try { //根据用户ID查找业主 IUserBLL userBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); T_User user = userBll.GetEntity(u => u.Id == model.UserId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); if (user != null) { //如果验证Token不通过或已过期 if (DateTime.Now > user.TokenInvalidTime || model.Token != user.Token) { resultModel.Msg = APIMessage.TOKEN_INVALID; return(resultModel); } //更新最近登录时间和Token失效时间 user.LatelyLoginTime = DateTime.Now; user.TokenInvalidTime = DateTime.Now.AddDays(Convert.ToInt32(PropertyUtils.GetConfigParamValue("TokenInvalid"))); userBll.Update(user); //获取要删除的回复内容 IPostBarTopicDiscussBLL postBarTopicDiscussBll = BLLFactory <IPostBarTopicDiscussBLL> .GetBLL("PostBarTopicDiscussBLL"); T_PostBarTopicDiscuss reply = postBarTopicDiscussBll.GetEntity(u => u.Id == model.Id); //如果该回复存在 if (reply == null) { resultModel.Msg = "该回复不存在"; } else { if (reply.ParentId == null) { postBarTopicDiscussBll.DeleteLevelOneDiscuss(reply.Id); } else { postBarTopicDiscussBll.Delete(reply); } } } else { resultModel.Msg = APIMessage.NO_USER; } } catch { resultModel.Msg = APIMessage.REQUEST_EXCEPTION; } return(resultModel); }
public ApiPageResultModel GetAllTopicListByType([FromUri] AllTopicPagedSearchModel model) { ApiPageResultModel resultModel = new ApiPageResultModel(); try { //根据用户ID查找业主 IUserBLL ownerBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); T_User owner = ownerBll.GetEntity(u => u.Id == model.UserId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); //如果业主存在 if (owner != null) { //如果验证Token不通过或已过期 if (DateTime.Now > owner.TokenInvalidTime || model.Token != owner.Token) { resultModel.Msg = APIMessage.TOKEN_INVALID; return(resultModel); } //更新最近登录时间和Token失效时间 owner.LatelyLoginTime = DateTime.Now; owner.TokenInvalidTime = DateTime.Now.AddDays(Convert.ToInt32(PropertyUtils.GetConfigParamValue("TokenInvalid"))); ownerBll.Update(owner); var collectedTopicIds = owner.UserPostBarTopics.Select(o => o.PostBarTopicId).ToList(); IPostBarTopicBLL topicBLL = BLLFactory <IPostBarTopicBLL> .GetBLL("PostBarTopicBLL"); // 获取小区某分类下的所有主题列表 var list = topicBLL.GetSetTopPageList(m => m.PropertyPlaceId == model.PropertyPlaceId && m.TopicTypeId == model.TopicTypeId, model.PageIndex, ConstantParam.PAGE_SIZE).Select(m => new { Id = m.Id, PostDate = m.PostDate.ToString("yyyy-MM-dd HH:mm:ss"), IsTop = m.IsTop, UserImage = m.PostUser.HeadPath, UserName = m.PostUser.UserName, Title = m.Title, Content = m.Content, PicList = m.ImgPath, CommentCount = m.PostBarTopicDiscusss.Count(), IsCollected = collectedTopicIds.Contains(m.Id) ? 1 : 0, TopicType = m.PostBarTopicType.Name, PostUserId = m.PostUserId }).ToList(); resultModel.result = list; resultModel.Total = topicBLL.Count(m => m.PropertyPlaceId == model.PropertyPlaceId && m.TopicTypeId == model.TopicTypeId); } else { resultModel.Msg = APIMessage.NO_USER; } } catch { resultModel.Msg = APIMessage.REQUEST_EXCEPTION; } return(resultModel); }
public ArticlesController(IArticleBLL articleBll, IMapper mapper, IUserBLL userBll, ICommentBLL commentBll) { _articleBll = articleBll; _commentBll = commentBll; _userBll = userBll; _mapper = mapper; }
public void TestCleanup() { _logger = null; _uow = null; _repository = null; _bll = null; }
public ActionResult ResetPassword(int id) { JsonModel jm = new JsonModel(); IUserBLL userBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); // 根据指定id值获取实体对象 var user = userBll.GetEntity(u => u.Id == id && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); if (user != null) { Random r = new Random(); string newPassword = user.UserName + r.Next(100, 1000); user.Password = PropertyUtils.GetMD5Str(newPassword); // 恢复初始密码值 userBll.Update(user); // 给用户发送邮件 PropertyUtils.SendEmail(user.Email, user.UserName, "物业生活管理平台 APP用户密码重置", "您的用户密码已重置为:" + newPassword + ",请及时修改密码!"); //操作日志 jm.Content = "APP注册用户" + user.UserName + " 密码一键重置"; } else { jm.Msg = "该用户不存在"; } return(Json(jm, JsonRequestBehavior.AllowGet)); }
public HomeController() { consultaBLL = new ConsultaBLLImpl(); personaBLL = new PersonaBLLImpl(); userBLL = new UserBLLImpl(); mapeo = new Mapeos(); }
public AccountService(IUnitOfWork contextDB, IRepository <User, AddParamOfCRUDOperation <User> > repository) { _repository = repository ?? throw new ArgumentNullException(nameof(repository)); _userHandlerAdd = new HandlerCRUD <User, AddParamOfCRUDOperation <User> >(_repository); _userFetchData = new UserFetchData(contextDB); }
public AdminController(IUserBLL userBLL, IStationBLL stationBLL, ILineBLL lineBLL, IDepartureBLL departureBLL, ITicketBLL ticketBLL) { this.userBLL = userBLL; this.stationBLL = stationBLL; this.lineBLL = lineBLL; this.departureBLL = departureBLL; this.ticketBLL = ticketBLL; }
public AdminController() { userBLL = new UserBLL(); stationBLL = new StationBLL(); lineBLL = new LineBLL(); departureBLL = new DepartureBLL(); ticketBLL = new TicketBLL(); }
public AsyncController(IRightService _rightService, IDepService _depService, IRoleService _roleService, IUserBLL _userBLL, ICategoryService _cateService) { rightService = _rightService; depService = _depService; userBLL = _userBLL; roleService = _roleService; categoryService = _cateService; }
public void SetUp() { _logger = Substitute.For <ILogger>(); _uow = Substitute.For <IUnitOfWork>(); _repository = _uow.GetGenericRepository <USER>(); _bll = new UserBLL(_uow, _logger); BLLMapper.Initialize(); }
public static SelectList GetUsers() { IUserBLL userBll = MvcApplication.GetInstance <UserBLL>(); var users = userBll.GetUsers(); var selectItemSource = Mapper.Map <List <SelectItemModel> >(users); return(new SelectList(selectItemSource, "ValueField", "TextField")); }
//private readonly IUserInfoBLL _userInfo; public BaseController(IAuthenticationBLL authBll, IReadWriteBLL <Base_Dictionary> diBll, IUserBLL userInfoBll)//, IUserInfoBLL userInfo) { _authBll = authBll; _dicBll = diBll; _userInfoBll = userInfoBll; //_userInfo = userInfo; }
public WorkflowSettingsController(IPageBLL pageBLL, IUserBLL userBLL, IEmailTemplateBLL emailTemplateBLL, IWorkflowSettingBLL workflowSettingBLL) : base(pageBLL, Enums.MenuList.Settings) { _mainMenu = Enums.MenuList.Settings; _pageBLL = pageBLL; _userBLL = userBLL; _emailTemplateBLL = emailTemplateBLL; _workflowSettingBLL = workflowSettingBLL; }
public ApiPageResultModel GetSaleList([FromUri] GoodsSearchModel model) { ApiPageResultModel resultModel = new ApiPageResultModel(); try { //根据用户ID查找业主 IUserBLL ownerBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); T_User owner = ownerBll.GetEntity(u => u.Id == model.UserId && u.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); //如果业主存在 if (owner != null) { //如果验证Token不通过或已过期 if (DateTime.Now > owner.TokenInvalidTime || model.Token != owner.Token) { resultModel.Msg = APIMessage.TOKEN_INVALID; return(resultModel); } //更新最近登录时间和Token失效时间 owner.LatelyLoginTime = DateTime.Now; owner.TokenInvalidTime = DateTime.Now.AddDays(Convert.ToInt32(PropertyUtils.GetConfigParamValue("TokenInvalid"))); ownerBll.Update(owner); //该门店销售中的商品 Expression <Func <T_ShopSale, bool> > where = s => s.GoodsCategory.ShopId == model.ShopId && s.InSales == 1; //如果选择了商品分类 if (model.GoodsCategoryId > 0) { where = PredicateBuilder.And(where, s => s.GoodsCategoryId == model.GoodsCategoryId); } //获取指定门店指定类别的商品列表 IShopSaleBLL SaleBll = BLLFactory <IShopSaleBLL> .GetBLL("ShopSaleBLL"); resultModel.Total = SaleBll.Count(where); resultModel.result = SaleBll.GetPageList(where, "Id", false, model.PageIndex).ToList().Select(s => new { GoodsId = s.Id, GoodsName = s.Title, GoodsDesc = s.Content, RemainingAmout = s.RemainingAmout, SellAmout = s.OrderDetails.Where(od => od.Order.OrderStatus == ConstantParam.OrderStatus_FINISH).Select(od => od.SaledAmount).ToArray().Sum(), GoodsCoverImg = string.IsNullOrEmpty(s.ImgThumbnail) ? "" : s.ImgThumbnail.Split(';')[0], GoodsOtherImg = string.IsNullOrEmpty(s.ImgPath) ? "" : s.ImgPath, Price = s.Price }); } else { resultModel.Msg = APIMessage.NO_USER; } } catch { resultModel.Msg = APIMessage.REQUEST_EXCEPTION; } return(resultModel); }
/// <summary> /// 获取当前用户 /// </summary> /// <returns></returns> public T_User GetCurrentUser() { string Unionid = (string)Session["Unionid"]; IUserBLL ownerBll = BLLFactory <IUserBLL> .GetBLL("UserBLL"); T_User owner = ownerBll.GetEntity(o => o.WeixinUnionId == Unionid && o.DelFlag == ConstantParam.DEL_FLAG_DEFAULT); return(owner); }
public ResidencesController(IResidenceBLL iResidenceBLL, IUserBLL iUserBLL, ICategoryBLL iCategoryBLL, IHostingEnvironment iHostingEnvironment, IAuthorizationService iAuthorizationService, IRatingBLL iRatingBLL) { _iResidenceBLL = iResidenceBLL; _iUserBLL = iUserBLL; _iCategoryBLL = iCategoryBLL; _iHostingEnvironment = iHostingEnvironment; _iAuthorizationService = iAuthorizationService; _iRatingBLL = iRatingBLL; }
public TimeRecordController(ITimeRecordBLL timeRecordBLL, IRepository<TimeRecord> timeRecordRepository, IUserBLL userBLL, ITimeRecordCalendarGenerator timeRecordCalendarGenerator) { Check.Require(timeRecordBLL != null); Check.Require(timeRecordCalendarGenerator != null); _timeRecordBLL = timeRecordBLL; _timeRecordRepository = timeRecordRepository; _userBLL = userBLL; _timeRecordCalendarGenerator = timeRecordCalendarGenerator; }
public static ELReportViewModel Create(IRepository<Action> actionRepository, IUserBLL userBLL, IPrincipal currentUser) { var viewModel = new ELReportViewModel { Actions = actionRepository.Queryable.OrderBy(x => x.Name).ToList(), Units = userBLL.GetUnitsByUser(currentUser).ToList(), AllowAllUnits = currentUser.IsInRole(RoleNames.Admin) //Admins are allowed to view all units at once }; return viewModel; }
/// <summary> /// Creates the user view model, including populating the lookups /// </summary> public static new CreateUserViewModel Create(IUserBLL userBLL, IRepository repository) { var baseViewModel = UserViewModel.Create(userBLL, repository); var viewModel = new CreateUserViewModel { Supervisors = baseViewModel.Supervisors, Projects = baseViewModel.Projects, FundTypes = baseViewModel.FundTypes, AvailableRoles = baseViewModel.AvailableRoles, Subordinates = baseViewModel.Subordinates }; return viewModel; }
public void Setup() { _userBLL = MockRepository.GenerateStub<IUserBLL>(); _userAuth = MockRepository.GenerateStub<IUserAuth>(); _delegateBLL = new DelegateBLL(_userAuth, _userBLL); _roleProvider = MockRepository.GenerateStub<RoleProvider>(); _userAuth.RoleProvider = _roleProvider; _currentUser.UserName = "******"; _userBLL.Expect(a => a.GetUser()).Return(_currentUser).Repeat.Any(); for (int i = 0; i < 3; i++) { _users.Add(CreateValidEntities.User(i+3)); //_users[i].Delegate = _users[0]; } }
public UserController(IUserBLL userbll) { _iUserBll = userbll; }
public UserAdministrationController(IUserBLL userBLL, IMessageGateway messageGateway) { UserBLL = userBLL; MessageGateway = messageGateway; }
public UserService(IUserBLL userBLL) { this.userBLL = userBLL; }
public static UserListViewModel Create(IUserBLL userBLL, IRepository<Project> projectRepository, int? filterProjectId) { var users = filterProjectId == null ? userBLL.GetAllUsers() : userBLL.GetAllUsers().Where(x => x.Projects.Contains(projectRepository.GetById(filterProjectId.Value))); var viewModel = new UserListViewModel { Users = users.ToList(), Projects = userBLL.GetAllProjectsByUser(projectRepository).ToList(), SelectedFilterProjectId = filterProjectId }; return viewModel; }
public ReportController(IReportBLL reportBLL, IUserBLL userBLL) { _reportBLL = reportBLL; _userBLL = userBLL; }
/// <summary> /// Creates the user view model, including populating the lookups /// </summary> public static UserViewModel Create(IUserBLL userBLL, IRepository repository) { var viewModel = new UserViewModel { Supervisors = userBLL.GetSupervisors().OrderBy(a => a.LastName).ToList(), Projects = userBLL.GetAllProjectsByUser(repository.OfType<Project>()).OrderBy(a => a.Name).ToList(), FundTypes = userBLL.GetAvailableFundTypes(repository.OfType<FundType>()).OrderBy(a => a.Name).ToList(), AvailableRoles = userBLL.GetVisibleRoles(), Subordinates = new List<User>() }; return viewModel; }
public LoginController() { _userBll = ServiceLocator.Current.GetInstance<IUserBLL>(); }
public static TimeRecordEntryViewModel Create(IRepository repository, IUserBLL userBLL, ITimeRecordBLL timeRecordBLL, TimeRecord timeRecord, ITimeRecordCalendarGenerator calendarGenerator) { var viewModel = new TimeRecordEntryViewModel { TimeRecord = timeRecord, TotalHours = repository.OfType<TimeRecordEntry>() .Queryable .Where(x => x.Record.Id == timeRecord.Id) .Sum(x => x.Hours), CalendarDays = calendarGenerator.GenerateCalendar(timeRecord), Projects = userBLL.GetAllProjectsByUser(repository.OfType<Project>()).ToList(), FundTypes = userBLL.GetUser().FundTypes, ActivityCategories = repository.OfType<ActivityCategory>() .Queryable .Where(c => c.IsActive) .OrderBy(c => c.Name) .ToList(), AdjustmentEntries = repository.OfType<TimeRecordEntry>() .Queryable .Where(x => x.Record.Id == timeRecord.Id && x.AdjustmentDate != null) .OrderBy(x => x.AdjustmentDate) .ToList() }; return viewModel; }