public EmployeesFilterPaneCollapsed(EmployeeCollectionViewModel collectionViewModel) : base(() => CreateViewModel(() => new EmployeesFilterTreeViewModel(collectionViewModel))) { InitializeComponent(); presenterCore = CreatePresenter(); BindCommands(); }
public EmployeesFilterPane(EmployeeCollectionViewModel collectionViewModel) : base(() => CreateViewModel(() => new EmployeesFilterTreeViewModel(collectionViewModel))) { InitializeComponent(); FiltersTreeListAppearances.Apply(treeList); this.presenterCore = CreatePresenter(); BindCommands(); }
public EmployeesFilterPaneCollapsed(EmployeeCollectionViewModel collectionViewModel) : base(typeof(EmployeesFilterTreeViewModel), new object[] { collectionViewModel }) { InitializeComponent(); presenterCore = CreatePresenter(); BindCommands(); }
public ActionResult Index() { EmployeeManager manager = new EmployeeManager(); EmployeeCollectionViewModel model = manager.GetEmployeeList(); return(View(model)); }
public EmployeeCollectionViewModel GetEmployeeList(EmployeeCollectionViewModel model = null) { if (model == null) { model = new EmployeeCollectionViewModel(); } // Get data var query = _unitOfWork.GetRepository <Mst_Profile>().GetQueryable(o => o.Status == 1); // Set Where cause if (!string.IsNullOrWhiteSpace(model.SearchEmployeeName)) { query = query.Where(o => o.FirstName.StartsWith(model.SearchEmployeeName) || o.LastName.StartsWith(model.SearchEmployeeName)); } if (model.SearchPosition != null && model.SearchPosition >= 0) { query = query.Where(o => o.Position == model.SearchPosition); } if (model.SearchDevision != null && model.SearchDevision >= 0) { query = query.Where(o => o.Devision == model.SearchDevision); } // Mapping dto with model model.EmployeeCollection = query.Select(o => new EmployeeModel() { ProfileId = o.ProfileId, UserId = o.UserId, FirstName = o.FirstName, LastName = o.LastName, NickName = o.NickName, Position = o.Position, Devision = o.Devision, Email = o.Email, Telephone = o.Telephone, Address = o.Address, Photo = o.Photo }).ToList(); // Set Lookup model.LookupPosition = Helper.LookupPosition; model.LookupDevision = Helper.LookupDevision; // Mapping Id with lookup name for (int i = 0; i < model.EmployeeCollection.Count; i++) { EmployeeModel employee = model.EmployeeCollection[i]; employee.PositionName = Helper.GetNameFromLookup(employee.Position, model.LookupPosition); employee.DevisionName = Helper.GetNameFromLookup(employee.Devision, model.LookupDevision); model.EmployeeCollection[i] = employee; } return(model); }
public EmployeesFilterPane(EmployeeCollectionViewModel collectionViewModel) : base(typeof(EmployeesFilterTreeViewModel), new object[] { collectionViewModel }) { InitializeComponent(); FiltersTreeListAppearances.Apply(treeList); this.presenterCore = CreatePresenter(); BindCommands(); }
public EmployeesWindow() { InitializeComponent(); viewModel = new EmployeeCollectionViewModel(); this.DataContext = viewModel; }
public EmployeesFilterPane(EmployeeCollectionViewModel collectionViewModel) : base(() => CreateViewModel(() => new EmployeesFilterTreeViewModel(collectionViewModel))) { InitializeComponent(); FiltersTreeListAppearances.Apply(treeList); this.presenterCore = CreatePresenter(); BindCommands(); }
// ************************************* // EMPLOYEE INFORMATION, ADD, DELETE, EDIT // ************************************* public ActionResult AddEmployee() { var collection = new EmployeeCollectionViewModel { ApplicationUser = new RegisterViewModel(), Employee = new Employee(), Departments = db.Departments.ToList(), Ranks = db.Ranks.ToList(), Lookups = db.Lookups.ToList() }; return(View(collection)); }
public ActionResult List(string name, int position, int devision) { EmployeeManager manager = new EmployeeManager(); EmployeeCollectionViewModel model = new EmployeeCollectionViewModel { SearchEmployeeName = name, SearchPosition = position, SearchDevision = devision }; model = manager.GetEmployeeList(model); return(PartialView("List", model)); }
public async Task <ActionResult> AddEmployee(EmployeeCollectionViewModel model) { var user = new ApplicationUser { UserName = model.ApplicationUser.UserName, Email = model.ApplicationUser.Email, UserRole = "Employee", }; var result = await UserManager.CreateAsync(user, model.ApplicationUser.Password).ConfigureAwait(false); if (result.Succeeded) { await UserManager.AddToRoleAsync(user.Id, "Employee").ConfigureAwait(false); var rank = db.Ranks.Where(c => c.rankId == model.RankId).SingleOrDefault(); var depart = db.Departments.Where(c => c.depId == model.DepartmentId).SingleOrDefault(); var employee = new Employee { FirstName = model.Employee.FirstName, LastName = model.Employee.LastName, Cnic = model.Employee.Cnic, Status = model.Employee.Status, DateofJoining = DateTime.Now, Email = model.ApplicationUser.Email, DepId = model.DepartmentId, Rank = model.DepartmentId, UserId = user.Id }; db.Employees.Add(employee); db.SaveChanges(); return(RedirectToAction("EmployeeList")); } return(HttpNotFound()); }
public EmployeePeekListPresenter(GridView gridView, EmployeeCollectionViewModel viewModel) : base(gridView, viewModel) { }
public EmployeesFilterPaneCollapsed(EmployeeCollectionViewModel collectionViewModel) : base(() => CreateViewModel(() => new EmployeesFilterTreeViewModel(collectionViewModel))) { InitializeComponent(); presenterCore = CreatePresenter(); BindCommands(); }
public EmployeeCollectionPresenter(GridControl gridControl, EmployeeCollectionViewModel viewModel, System.Action <int> updateUIAction) : base(gridControl, viewModel, updateUIAction) { }
private static EmployeeCollectionViewModel CreateEmployeeCollectionViewModel(IServiceProvider services) { return(EmployeeCollectionViewModel.LoadViewModel( services.GetRequiredService <IEmployeeCollectionService>())); }