public ActionResult Index(string firstName = "", string lastName = "") { GenericProcess <vwEmployeeList> employeeProcess = new GenericProcess <vwEmployeeList>(); IQueryable <vwEmployeeList> list; if (!String.IsNullOrEmpty(lastName)) { list = employeeProcess.GetAll().Where(i => i.LastName.Contains(lastName) == true); } else { list = employeeProcess.GetAll(); } if (!String.IsNullOrEmpty(firstName)) { list = list.Where(i => i.FirstName.Contains(firstName) == true); } TempData["Employees"] = list.ToList(); return(View("Index", list.ToList())); }
public ActionResult MyDepartment(int departmentID) { Session[FASTConstant.SESSION_MYDEPARTMENT] = departmentID; AssignmentProcess assignProcess = new AssignmentProcess(); AccessRightsProcess accessProcess = new AccessRightsProcess(); GenericProcess <vwDepartmentList> deptProcess = new GenericProcess <vwDepartmentList>(); List <vwDepartmentList> departments = new List <vwDepartmentList>(); List <AccessRight> accessRights = accessProcess.GetAccessRightsByEmloyeeID(User.Identity.Name.ToInteger()).ToList(); accessRights = accessProcess.GetAccessRightsByEmloyeeID(User.Identity.Name.ToInteger()) .Where(i => i.AccessLevel == FASTConstant.ACCESS_LVL_MANAGER).ToList(); foreach (AccessRight right in accessRights) { departments.Add(deptProcess.GetAll().Where(i => i.DepartmentID == right.DepartmentID).FirstOrDefault()); } vwDepartmentList theDepartment = deptProcess.GetAll().Where(i => i.DepartmentID == departmentID).First(); List <vwAssetAssignmentsForManager> approvals = assignProcess.GetAssignmentsForManagerApprovalByDepartmentID(departmentID, User.Identity.Name.ToInteger()); ViewBag.Approvals = approvals; ViewBag.MyDepartments = departments; TempData["Department"] = theDepartment; return(View()); }
public ActionResult Search(string startDate, string employeeID, string assetTag, string assignmentID) { TempData["StartDate"] = startDate; TempData["EmployeeID"] = employeeID; TempData["AssetTag"] = assetTag; TempData["AssignmentID"] = assignmentID; GenericProcess <AuditTrail> auditProcess = new GenericProcess <AuditTrail>(); IQueryable <AuditTrail> results; if (!string.IsNullOrEmpty(startDate)) { DateTime date = DateTime.Now; DateTime.TryParse(startDate, out date); results = auditProcess.GetAll().Where(i => i.Date >= date); } else { results = auditProcess.GetAll(); } if (!string.IsNullOrEmpty(employeeID)) { results = results.Where(i => i.EmployeeID.ToString().Contains(employeeID) == true); } if (!string.IsNullOrEmpty(assignmentID)) { results = results.Where(i => i.AssignmentID.Contains(assignmentID) == true); } if (!string.IsNullOrEmpty(assetTag)) { results = results.Where(i => i.AssetTag.Contains(assetTag) == true); } results = results.OrderByDescending(i => i.Date); if (Request["Search"] != null) { return(View("Index", results.ToList())); } else { return(View("AuditReport", results.ToList())); } }
public ActionResult Index() { GenericProcess <AuditTrail> auditProcess = new GenericProcess <AuditTrail>(); List <AuditTrail> trails = new List <AuditTrail>(); trails = auditProcess.GetAll().OrderByDescending(i => i.Date).ToList(); return(View(trails)); }
public ActionResult NewEmployee() { GenericProcess <Department> deptProcess = new GenericProcess <Department>(); GenericProcess <Position> positionProcess = new GenericProcess <Position>(); ViewBag.Departments = deptProcess.GetAll().ToList(); ViewBag.Positions = positionProcess.GetAll().ToList(); return(View(new EmployeeViewModel())); }
public void TestBasicCrypto() { GenericProcess <Configuration> configProcess = new GenericProcess <Configuration>(); Configuration newConfig = configProcess.GetAll().Where(i => i.Name == "MailPassword").FirstOrDefault(); Assert.AreEqual("Fujitsu.1351", BasicCrypto.DecryptString(newConfig.Value)); }
public ActionResult Index(string firstName = "", string lastName = "", int accessMode = -1, int department = -1) { GenericProcess <vwAccessRight> rightProcess = new GenericProcess <vwAccessRight>(); GenericProcess <Department> deptProcess = new GenericProcess <Department>(); GenericProcess <AccessLevel> accessProcess = new GenericProcess <AccessLevel>(); IQueryable <vwAccessRight> rights; ViewBag.AccessModes = accessProcess.GetAll().ToList(); ViewBag.Departments = deptProcess.GetAll().ToList(); if (department != -1) { rights = rightProcess.GetAll().Where(i => i.DepartmentID == department); } else { rights = rightProcess.GetAll(); } if (accessMode != -1) { rights = rights.Where(i => i.AccessLevel == accessMode); } if (!String.IsNullOrEmpty(lastName)) { rights = rights.Where(i => (i.FullName.Contains(lastName))); } if (!String.IsNullOrEmpty(firstName)) { rights = rights.Where(i => (i.FullName.Contains(firstName))); } return(View(rights.ToList())); }
public void TestUpdateActiveEmail() { GenericProcess <Configuration> configProcess = new GenericProcess <Configuration>(); Configuration newConfig = configProcess.GetAll().Where(i => i.Name == "ActiveEmail").FirstOrDefault(); newConfig.Value = "3"; int result = configProcess.Update(newConfig); Assert.AreEqual(FASTConstant.RETURN_VAL_SUCCESS, result); }
public ActionResult Index() { GenericProcess <vwFixAssetList> assetProcess = new GenericProcess <vwFixAssetList>(); GenericProcess <AssetStatu> assetStatusProcess = new GenericProcess <AssetStatu>(); List <vwFixAssetList> assetList = assetProcess.GetAll().ToList(); ViewBag.AssetStatus = assetStatusProcess.GetAll().ToList(); TempData["Assets"] = assetList; return(View(assetList)); }
public ActionResult NewAccessRight() { //EmployeeProcess empProcess = new EmployeeProcess(); vwEmployeeList employee = new vwEmployeeList(); GenericProcess <AccessLevel> levels = new GenericProcess <AccessLevel>(); GenericProcess <vwDepartmentList> departments = new GenericProcess <vwDepartmentList>(); ViewBag.AccessLevel = levels.GetAll().ToList(); ViewBag.Department = departments.GetAll().ToList(); ViewBag.EmployeeID = 0; ViewBag.Rights = new List <vwAccessRight>(); return(View(employee)); }
public ActionResult NewAsset() { GenericProcess <Location> locationProcess = new GenericProcess <Location>(); GenericProcess <Issuer> issuerProcess = new GenericProcess <Issuer>(); GenericProcess <AssetType> typeProcess = new GenericProcess <AssetType>(); GenericProcess <AssetStatu> statusProcess = new GenericProcess <AssetStatu>(); GenericProcess <AssetClass> classProcess = new GenericProcess <AssetClass>(); ViewBag.Location = locationProcess.GetAll().ToList(); ViewBag.Issuer = issuerProcess.GetAll().ToList(); ViewBag.AssetType = typeProcess.GetAll().ToList(); ViewBag.AssetStatus = statusProcess.GetAll().ToList(); ViewBag.AssetClass = classProcess.GetAll().ToList(); return(View(new FixAssetViewModel())); }
public ActionResult EditAsset(string tag) { AssetProcess assetProcess = new AssetProcess(); GenericProcess <Location> locationProcess = new GenericProcess <Location>(); GenericProcess <Issuer> issuerProcess = new GenericProcess <Issuer>(); GenericProcess <AssetType> typeProcess = new GenericProcess <AssetType>(); GenericProcess <AssetStatu> statusProcess = new GenericProcess <AssetStatu>(); GenericProcess <AssetClass> classProcess = new GenericProcess <AssetClass>(); string assetTag = tag; vwFixAssetList assetToEdit = assetProcess.GetFixAssetByAssetTag(assetTag); FixAssetViewModel assetView = new FixAssetViewModel(); assetView.AssetTag = assetToEdit.AssetTag; assetView.FixAssetID = assetToEdit.FixAssetID; assetView.SerialNumber = assetToEdit.SerialNumber; assetView.Model = assetToEdit.Model; assetView.Brand = assetToEdit.Brand; assetView.AssetClassID = assetToEdit.AssetClassID; assetView.AssetStatusID = assetToEdit.AssetStatusID; assetView.AssetTypeID = assetToEdit.AssetTypeID; assetView.IssuerID = assetToEdit.IssuerID; assetView.LocationID = assetToEdit.LocationID; assetView.Remarks = assetToEdit.Remarks; if (assetToEdit.AcquisitionDate != null) { assetView.AcquisitionDate = assetToEdit.AcquisitionDate; } if (assetToEdit.ExpiryDate != null) { assetView.ExpiryDate = assetToEdit.ExpiryDate; } ViewBag.Location = locationProcess.GetAll().ToList(); ViewBag.Issuer = issuerProcess.GetAll().ToList(); ViewBag.AssetType = typeProcess.GetAll().ToList(); ViewBag.AssetStatus = statusProcess.GetAll().ToList(); ViewBag.AssetClass = classProcess.GetAll().ToList(); return(View(assetView)); }
public ActionResult Index() { GenericProcess <vwAccessRight> rightProcess = new GenericProcess <vwAccessRight>(); GenericProcess <Department> deptProcess = new GenericProcess <Department>(); GenericProcess <AccessLevel> accessProcess = new GenericProcess <AccessLevel>(); List <vwAccessRight> rights = new List <vwAccessRight>(); ViewBag.AccessModes = accessProcess.GetAll().ToList(); ViewBag.Departments = deptProcess.GetAll().ToList(); rights = rightProcess.GetAll().ToList(); return(View(rights)); }
public ActionResult Search(string assetTag = "", string serialNumber = "", int statusID = -1) { //FixAssetManagementProcess fixAssetManagement = new FixAssetManagementProcess(); //BaseProcess baseProc = new BaseProcess(); //List<FixAssetModel> assets = fixAssetManagement.Search(assetTag, serialNumber, statusID); //ViewBag.AssetStatus = baseProc.GetAllAssetStatus(); AssetProcess assetProcess = new AssetProcess(); List <vwFixAssetList> resultList = assetProcess.SearchAsset(anAssetTag: assetTag, aSerialNumber: serialNumber, aStatusID: statusID).ToList(); GenericProcess <AssetStatu> statusProcess = new GenericProcess <AssetStatu>(); ViewBag.AssetStatus = statusProcess.GetAll().ToList(); TempData["Assets"] = resultList; return(View("Index", resultList)); }
public ActionResult EditEmployee(int mod) { GenericProcess <Department> deptProcess = new GenericProcess <Department>(); GenericProcess <Position> positionProcess = new GenericProcess <Position>(); EmployeeProcess employeeProcess = new EmployeeProcess(); ViewBag.Departments = deptProcess.GetAll().ToList(); ViewBag.Positions = positionProcess.GetAll().ToList(); int employeeID = mod; FASTWeb.Models.EmployeeViewModel employeeEditView = new EmployeeViewModel(); Employee employeeToEdit = employeeProcess.GetEmployeeByID(employeeID); //move data to editview employeeEditView.EmployeeID = employeeToEdit.EmployeeID; employeeEditView.FirstName = employeeToEdit.FirstName; employeeEditView.MiddleName = employeeToEdit.MiddleName; employeeEditView.LastName = employeeToEdit.LastName; employeeEditView.EmailAddress = employeeToEdit.EmailAddress; employeeEditView.PhoneNumber = employeeToEdit.PhoneNumber; employeeEditView.Gender = employeeToEdit.Gender; employeeEditView.PositionID = employeeToEdit.PositionID; employeeEditView.DepartmentID = employeeToEdit.DepartmentID; employeeEditView.IsCompany = employeeToEdit.IsCompany; employeeEditView.CompanyName = employeeToEdit.CompanyName; employeeEditView.Status = employeeToEdit.Status; if (employeeToEdit.Status == 1) { employeeEditView.Status_booleanVal = true; } else { employeeEditView.Status_booleanVal = false; } return(View(employeeEditView)); }
public ActionResult ShowDepartmentEmployee(int departmentID) { EmployeeProcess employeeProcess = new EmployeeProcess(); GenericProcess <Common.vwDepartmentList> deptProcess = new GenericProcess <Common.vwDepartmentList>(); List <vwEmployeeList> listOfEmployees = new List <vwEmployeeList>(); vwDepartmentList department = new vwDepartmentList(); try { listOfEmployees = employeeProcess.GetEmployeesByDepartmentID(departmentID); department = deptProcess.GetAll().Where(i => i.DepartmentID == departmentID).First(); } catch { } ViewBag.Department = department.GroupName; return(View("Index", listOfEmployees)); }
public ActionResult Index() { GenericProcess <Configuration> configProcess = new GenericProcess <Configuration>(); List <Configuration> configs = configProcess.GetAll().ToList(); foreach (Configuration config in configs) { bool encrypted = false; Boolean.TryParse(config.IsEncrypted.ToString(), out encrypted); if (encrypted) { config.Value = BasicCrypto.DecryptString(config.Value); } } return(View(configs)); }
public ActionResult SearchEmployeeRights(int employeeID) { EmployeeProcess empProcess = new EmployeeProcess(); vwEmployeeList employee = empProcess.GetEmployeeProfileByID(employeeID); GenericProcess <vwAccessRight> accessProcess = new GenericProcess <vwAccessRight>(); List <vwAccessRight> rights = accessProcess.GetAll().Where(i => i.EmployeeID == employeeID).ToList(); GenericProcess <AccessLevel> levels = new GenericProcess <AccessLevel>(); GenericProcess <vwDepartmentList> departments = new GenericProcess <vwDepartmentList>(); ViewBag.EmployeeID = employeeID; ViewBag.AccessLevel = levels.GetAll().ToList(); ViewBag.Department = departments.GetAll().ToList(); ViewBag.Rights = rights; return(View("NewAccessRight", employee)); }