/// <summary> /// Get all staff /// Convert to ListStaff in VM /// </summary> /// <param name="isInUse"></param> /// <returns></returns> public ActionResult Employees(int index = 1, bool inuse = true) { logger.EnterMethod(); try { var allStaffes = this._iStaffServices.GetStaffByPage(index, inuse); var vM_ListStaff = ConvertVM.ListStaff_To_VM_ListStaff(allStaffes.ToList()); List <long> listStaffId = new List <long>(); foreach (var item in allStaffes) { listStaffId.Add(item.Id); } var listContactInformation = ConvertVM.ListContactInformation_To_ListVMContactInformation( this._iContactInformationServices.GetContactInformationFromListStaff(listStaffId)); var allPages = this._iStaffServices.CountTotalPages(); return(View(ConvertVM.VM_ListStaff_Add_Paging(SelfConvertVM.VM_ListStaffAddContactInformation(listContactInformation, vM_ListStaff), index, allPages))); } catch (Exception e) { logger.Error("Error: [" + e.Message + "]"); return(View("ErrorAdminPage")); } finally { logger.LeaveMethod(); } }