public ActionResult EditOnlyEmpRole(EmployeeManagementViewModel emvm) { EmployeeManagementServiceClient emsc = new EmployeeManagementServiceClient(); emsc.editOnlyEmpRole(emvm.Employee); return(RedirectToAction("IndexEmployee")); }
public ActionResult CreateEmp(EmployeeManagementViewModel emvm) { EmployeeManagementServiceClient emsc = new EmployeeManagementServiceClient(); emsc.createEmp(emvm.Employee); return(RedirectToAction("IndexEmployee")); }
public void RemoveEmployeeTestValid() { var employeeDal = new MockEmployeeDal { ThrowError = false }; var viewModel = new EmployeeManagementViewModel(employeeDal); employeeDal.employeeToAdd.FirstName = "Fname"; employeeDal.employeeToAdd.LastName = "Lname"; employeeDal.employeeToAdd.Username = "******"; employeeDal.employeeToAdd.Password = "******"; employeeDal.employeeToAdd.IsManager = true; employeeDal.AddEmployee(employeeDal.employeeToAdd, employeeDal.employeeToAdd.Password); var count = employeeDal.employeeList.Count; employeeDal.RemoveEmployee(employeeDal.employeeToAdd.Username); var countAfter = employeeDal.employeeList.Count; Assert.AreEqual(count - 1, countAfter); }
public ActionResult ShowEmpData(string id) { EmployeeManagementServiceClient emsc = new EmployeeManagementServiceClient(); EmployeeManagementViewModel emvm = new EmployeeManagementViewModel(); emvm.Employee = emsc.findEmp(id); return(View("ShowEmpData", emvm)); }
public ActionResult EditOnlyEmpRole(string id) { EmployeeManagementServiceClient emsc = new EmployeeManagementServiceClient(); EmployeeManagementViewModel emvm = new EmployeeManagementViewModel(); emvm.Employee = emsc.findEmp(id); return(View("EditOnlyEmpRole", emvm)); }
public void GetEmployeeHistoryIsInValid() { var employeeDal = new MockEmployeeDal { ThrowError = false }; var viewModel = new EmployeeManagementViewModel(employeeDal); viewModel.RetrieveEmployeeHistory(); }
static void Main(string[] args) { Forms.Init(); var platformServices = new OouiPlatformServices(); var vm = new EmployeeManagementViewModel(platformServices); UI.Publish("/", new MainPage() { BindingContext = vm }.GetOouiElement()); #if DEBUG UI.Port = 12345; UI.Host = "localhost"; Process.Start("explorer", $"http://{UI.Host}:{UI.Port}"); Console.ReadLine(); #endif }
public void AddEmployeeTestInvalid() { var employeeDal = new MockEmployeeDal { ThrowError = false }; var viewModel = new EmployeeManagementViewModel(employeeDal); employeeDal.employeeToAdd.FirstName = "Fname"; employeeDal.employeeToAdd.LastName = "Lname"; employeeDal.employeeToAdd.Username = "******"; employeeDal.employeeToAdd.Password = "******"; employeeDal.employeeToAdd.IsManager = true; var count = employeeDal.employeeList.Count; employeeDal.AddEmployee(employeeDal.employeeToAdd, "Invalid"); }
public AddEmployeePage() { this.InitializeComponent(); this.ViewModel = new EmployeeManagementViewModel(); this.DataContext = this.ViewModel; }