public static bool AddEmployeesBLL(Employee emp, Employee_Security empsec, string desig, string grade) { bool isEmployeeAdded = false; bool isEmployeeValidated = false; try { isEmployeeValidated = ValidateEmployeeBLL(emp, empsec, desig, grade); if (isEmployeeValidated) { isEmployeeAdded = EmployeeOperations.AddEmployeesDAL(emp, empsec, desig, grade); return(isEmployeeAdded); } else { throw new PayrollException("Error"); } } catch (PayrollException) { throw; } catch (System.Exception) { throw; } }
public static string LoginCheckBLL(int id, string pwd) { string username = null; bool isLoginValid; try { isLoginValid = ValidLoginBLL(id, pwd); if (isLoginValid) { username = EmployeeOperations.LoginCheckDAL(id, pwd); return(username); } else { throw new PayrollException("Error"); } } catch (PayrollException) { throw; } catch (System.Exception) { throw; } }
// GET: Employee public ActionResult Index() { EmployeeOperations employeeOperations = new EmployeeOperations(); var employees = employeeOperations.GetEmployeeData(); return(View(employees)); }
private void btnEmployee_Click(object sender, EventArgs e) { var employeeForm = new FormEmployee(); var employeeRepository = new DataAccessEmployee(); var employeePresenter = new EmployeeOperations(employeeForm, employeeRepository); employeeForm.Show(); }
public async Task GenericEmployeeFindWithIncludesTask() { var employee = await EmployeeOperations.GenericRepositoryFindWithIncludesAsync(3); Assert.IsFalse(employee.CountryIdentifierNavigation == null); Assert.IsFalse(employee.ContactTypeIdentifierNavigation == null); Assert.IsFalse(employee.Orders == null); Assert.IsFalse(employee.ReportsToNavigation == null); }
public void Setup() { AutofacConfig.RegisterTypes(); var stratisEndPoint = new StratisEndPointAdhocService(); var rsaEngine = new EncryptDecrypt(); _moocMicroCredentialProvider = new MoocMicroCredentialProvider(stratisEndPoint, rsaEngine); _employeeOperations = new EmployeeOperations(stratisEndPoint, rsaEngine, _moocMicroCredentialProvider); _employerOperations = new EmployerOperations(stratisEndPoint, rsaEngine, _moocMicroCredentialProvider); }
/* Render */ public ActionResult Index() { Account account = base.GetLoginAccount(false); if (account == null || !EmployeeOperations.CanRender(account)) { return(base.ToLoginPage()); } return(View()); }
/// <summary> /// Provides ability to update current employee in the data grid /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ButtonCurrent_OnClick(object sender, RoutedEventArgs e) { if (Question("Update current employee?")) { var employee = EmployeeGrid.SelectedItem as Employees; if (!EmployeeOperations.Update(employee)) { MessageBox.Show("Update failed"); } } }
public void DetectChangesEmployee() { var results = EmployeeOperations.GetChanges(); string[] propertyNames = { "City", "CountryIdentifier" }; var changedResults = results .Select(item => item.Item1).ToArray(); Assert.IsTrue(propertyNames.SequenceEqual(changedResults)); }
public int AddEmployee_BLL(Employee pobj, Users users) { try { EmployeeOperations pd = new EmployeeOperations(); return(pd.AddEmployee_DAL(pobj, users)); } catch (TaxiExceptions) { throw; } }
public bool UpdateEmployee_BLL(Employee pobj) { try { EmployeeOperations pd = new EmployeeOperations(); return(pd.UpdateEmployee_DAL(pobj)); } catch (TaxiExceptions) { throw; } }
public bool DeleteEmployee_BLL(int employeeID) { try { EmployeeOperations pd = new EmployeeOperations(); return(pd.DeleteEmployee_DAL(employeeID)); } catch (TaxiExceptions) { throw; } }
public Employee SearchEmployee_BLL(int employeeID) { try { EmployeeOperations pd = new EmployeeOperations(); return(pd.SearchEmployee_DAL(employeeID)); } catch (TaxiExceptions) { throw; } }
public DataTable DisplayEmployee_BLL() { try { EmployeeOperations pd = new EmployeeOperations(); return(pd.DisplayEmployee_DAL()); } catch (TaxiExceptions) { throw; } }
public async Task GenericEmployeesFindTask() { var employee = await EmployeeOperations.GenericRepositoryFindAsync(new[] { "CountryIdentifierNavigation", "ContactTypeIdentifierNavigation" }); Assert.IsTrue( employee.ContactTypeIdentifierNavigation != null && employee.CountryIdentifierNavigation != null); }
public void DetectChangesEmployee1() { // var not used so it's apparent what is being returned List <(string PropertyName, object OriginalValue, object CurrentValue)> results = EmployeeOperations.GetChanges1(); string[] propertyNames = { "City", "CountryIdentifier" }; var changedResults = results .Select(item => item.PropertyName).ToArray(); Assert.IsTrue(propertyNames.SequenceEqual(changedResults)); }
public ActionResult ReadEmployee(int id) { using (var context = new DataContext()) { try { Account account = base.GetLoginAccount(); Account dbm = EmployeeOperations.TryRead(account, context, id); return(Json(new UIEmployee_CRU(dbm))); } catch (Exception e) { base.HandleException("ReadEmployee", e); return(null); } } }
public ActionResult ListEmployees(int draw, int start, int length, int authz, int active) { using (var context = new DataContext()) { try { Account account = base.GetLoginAccount(); IQueryable <Account> query = EmployeeOperations.TryList(account, context); // Handle filtering query = query.Where(a => a.active == active); if (authz != Account.AUTHZ_ANY) { query = query.Where(a => a.authz == authz); } // Possibly apply filter var searchstring = Request["search[value]"]; if (!String.IsNullOrWhiteSpace(searchstring)) { query = query.Where(a => a.firstname.Contains(searchstring) || a.lastname.Contains(searchstring)); } int recordsFiltered = query.Count(); // Execute query IList <Account> dbms = query.OrderBy(a => a.firstname).ThenBy(a => a.lastname).Skip(start).Take(length).ToList(); int recordsTotal = context.Accounts.Count(); // Compose view models IList <UIEmployee_List> uims = new List <UIEmployee_List>(); foreach (Account dbm in dbms) { uims.Add(new UIEmployee_List(dbm)); } return(Json(new { draw = draw, recordsTotal = recordsTotal, recordsFiltered = recordsFiltered, data = uims })); } catch (Exception e) { base.HandleException("ListEmployees", e); return(null); } } }
public int AddEmployee_BLL(Employee newEmp) { int rowsAffected = 0; EmployeeOperations operationObj; try { if (validateEmp(newEmp)) { operationObj = new EmployeeOperations(); rowsAffected = operationObj.AddEmployee(newEmp); } } catch (EmployeeException ex) { throw ex; } catch (SqlException se) { throw se; } catch (Exception ex) { throw ex; } return rowsAffected; }
public static bool AddLeavesBLL(Leave_Details leave) { bool isLeaveAdded = false; try { isLeaveAdded = EmployeeOperations.AddLeavesDAL(leave); return(isLeaveAdded); } catch (PayrollException) { throw; } catch (System.Exception) { throw; } }
public static DataTable SearchEmpById(int id) { DataTable eList = new DataTable(); try { eList = EmployeeOperations.SearchEmpById(id); return(eList); } catch (PayrollException) { throw; } catch (System.Exception) { throw; } }
public static List <string> LoginSecurityBLL(int id) { List <string> qa = new List <string>(); try { qa = EmployeeOperations.LoginSecurityDAL(id); return(qa); } catch (PayrollException) { throw; } catch (System.Exception) { throw; } }
public static int GetLeaveBalanceBLL(int empid) { try { int balance; balance = EmployeeOperations.GetLeaveBalanceDAL(empid); return(balance); } catch (PayrollException) { throw; } catch (System.Exception) { throw; } }
public static bool UpdateDetailsBLL(int empid, string fname, string lname, string address) { try { bool isUpdated = false; isUpdated = EmployeeOperations.UpdateDetailsDAL(empid, fname, lname, address); return(isUpdated); } catch (PayrollException) { throw; } catch (System.Exception) { throw; } }
public static bool UpdateEmployeedetailsDAL(int empid, string fname, string lname, string desig, string grade) { try { bool isUpdated = false; isUpdated = EmployeeOperations.UpdateEmployeedetailsDAL(empid, fname, lname, desig, grade); return(isUpdated); } catch (PayrollException) { throw; } catch (System.Exception) { throw; } }
public DataTable LoadDeparment_BLL() { DataTable dtDept; try { empOperation = new EmployeeOperations(); dtDept = empOperation.LoadDeparment(); } catch (SqlException se) { throw se; } catch (Exception ex) { throw ex; } return dtDept; }
public ActionResult DeleteEmployee(int id) { AjaxStatus status = new AjaxStatus(); using (var context = new DataContext()) { try { Account account = base.GetLoginAccount(); EmployeeOperations.TryDelete(account, context, id); context.SaveChanges(); } catch (Exception e) { base.HandleException("DeleteEmployee", e); status.SetError(e.Message); } } return(Json(status)); }
public DataTable GetEmployee_BLL() { DataTable dtEmp; try { empOperation = new EmployeeOperations(); dtEmp = empOperation.GetEmployee(); } catch (SqlException se) { throw se; } catch (Exception ex) { throw ex; } return dtEmp; }
public CandidateController(UnitOfWork unitOfWork) { _roleManager = new RoleManager <IdentityRole>(new RoleStore <IdentityRole>(new ApplicationDbContext())); _unitOfWork = unitOfWork; _unitOfWork.UniSADbContext = new UniSA.DataAccess.UniSADbContext(); var stratisEndPoint = new StratisEndPointAdhocService(); var moocMicroCredentialProvider = new MoocMicroCredentialProvider(new StratisEndPointAdhocService(), new EncryptDecrypt()); var employeeProvider = new EmployeeOperations(stratisEndPoint, new EncryptDecrypt(), moocMicroCredentialProvider); HttpClient client = new HttpClient(); client.BaseAddress = new Uri(ConfigurationManager.AppSettings["StratisBlockChainBaseUrl"]); var stratisApiRequests = new UniSA.Services.StratisBlockChainServices.StratisApi.StratisApiFullfilRequestComponent(client);; moocMicroCredentialProvider.StratisApiFullfilRequestComponent = stratisApiRequests; _repositoryEndPointService = new RepositoryEndPointServices(_unitOfWork, moocMicroCredentialProvider); _repositoryEndPointService.EmployeeOperations = employeeProvider; moocMicroCredentialProvider.RepositoryEndPointService = _repositoryEndPointService; employeeProvider.RepositoryEndPointService = _repositoryEndPointService; employeeProvider.StratisApiFullfilRequestComponent = stratisApiRequests; }
public ActionResult CreateEmployee(UIEmployee_CRU uim) { AjaxStatus status = new AjaxStatus(); using (var context = new DataContext()) { try { Account account = base.GetLoginAccount(); Account model = uim.CreateModel(); EmployeeOperations.TryCreate(account, context, model); context.SaveChanges(); } catch (Exception e) { base.HandleException("CreateEmployee", e); status.SetError(e.Message); } } return(Json(status)); }