Files
BeWoPlaner/BeWoPlanerMobil/Controllers/DevExpressSchedulerController.cs

674 lines
28 KiB
C#

using BeWoPlanerMobil.Models;
using BeWoPlanerMobil.Service;
using BeWoPlanerMobil.Util;
using BeWoPlanerMobil.Util.Constants;
using BeWoPlanerMobil.Util.SchedulerUtils;
using BeWoPlanerMobil.Views.DevExpressScheduler;
using BS.Shared;
using BS.Shared.Core;
using BS.Shared.DataContracts;
using BS.Shared.DataContracts.Compact;
using BS.Shared.Extensions;
using DevExpress.Web.Mvc;
using DevExpress.XtraScheduler;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
namespace BeWoPlanerMobil.Controllers
{
/*
* ToDo:
* 1. Filterung einbauen (Mitarbeiter, Klienten, Ressourcen, Privat, Aufgaben, Abwesenheiten)
* 2. "In die Zeiterfassung übertragen" und "Verfügbare Mitarbeiter prüfen" einbauen
* 3. Rechte implementieren!
* 4. Übersetzungen
*/
public class DevExpressSchedulerController : AbstractBaseController
{
[Authorize]
public override string SaveCollapsibleStatus(bool isOpen, string identifier)
{
return SaveCollapsibleStatusToModel(Model, isOpen, identifier);
}
private DevExpressSchedulerModel _Model;
public DevExpressSchedulerModel Model
{
get
{
if(false == MobileSessionFacade.IsUserLoggedIn())
{
Logout();
return null;
}
if(_Model != null)
{
return _Model;
}
_Model = new DevExpressSchedulerModel();
InitModel(_Model);
InitViewModel();
return _Model;
}
}
private AppointmentModel _AppointmentModel;
public AppointmentModel AppointmentModel
{
get
{
if(false == MobileSessionFacade.IsUserLoggedIn())
{
Logout();
return null;
}
if(_AppointmentModel != null)
{
return _AppointmentModel;
}
_AppointmentModel = new AppointmentModel();
InitModel(_AppointmentModel);
InitAppointmentModel();
return _AppointmentModel;
}
}
private void InitAppointmentModel()
{
AppointmentModel.PossibleEmployees = EmployeeService.GetAllAuthorizedCompactEmployees();
AppointmentModel.PossibleCustomers = CustomerService.GetAllAuthorizedCompactCustomers();
AppointmentModel.PossibleResources = KalenderService.GetAllResources();
}
private void InitViewModel()
{
if(false == MobileSessionFacade.IsUserLoggedIn() || Request.Browser.Browser.Equals("InternetExplorer") || Model?.LoggedInEmployee?.EmployeeOid is null)
{
Logout();
return;
}
var x = Model.SelectedEmployeeOidsForFiltering;
Model.PossibleEmployees = EmployeeService.GetAllAuthorizedCompactEmployees();
Model.PossibleCustomers = CustomerService.GetAllAuthorizedCompactCustomers();
Model.PossibleResources = KalenderService.GetAllResources();
if(Model.HasRightToInsertRessourceAppointments || Model.HasRightToViewAllResourceAppointments)
{
var allResources = KalenderService.GetAllResources().OrderBy(r => r.Name).ToList();
var categories2Resources = new Dictionary<ValueListEntryDC, List<ResourceDC>>();
foreach(var category in allResources.Select(resource => resource.ResourceCategory))
{
categories2Resources.AddOrUpdateValueInDictionary(category, allResources.Where(resource => resource.ResourceCategory.Equals(category)).OrderBy(r => r.Name).ToList());
}
Model.ResourceCategories2Resources = categories2Resources.OrderBy(kvp => kvp.Key.DisplayName).ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
}
if(Model.LoggedInEmployee?.EmployeeOid.HasValue ?? false)
{
var compactEmployee = EmployeeService.GetActiveCompactEmployeeWithOid(Model.LoggedInEmployee.EmployeeOid.Value);
Model.MyTeamEmployees = EmployeeService.GetAllTeamMember(compactEmployee).OrderBy(employee => employee.LastName).ToList();
}
else
{
Model.MyTeamEmployees = new List<CompactEmployeeDC>();
}
if(Model.HasRightToViewTeams && (Model?.LoggedInEmployee?.EmployeeOid.HasValue ?? false))
{
Model.MyTeams = EmployeeService.GetAllActiveCompactTeamsForEmployee(Model.LoggedInEmployee.EmployeeOid.Value).OrderBy(team => team.Name).ToList();
}
Model.TeamMemberCustomerOids = EmployeeService.LoadTeamsRelatedCustomerOids(LoggedInUser.Employee.EmployeeOid);
Model.SelectedEmployeesForFiltering = Model.PossibleEmployees.Where(possibleEmployee => Model.SelectedEmployeeOidsForFiltering?.Contains(possibleEmployee.EmployeeOid) ?? false).ToList();
Model.SelectedCustomersForFiltering = Model.PossibleCustomers.Where(possibleCustomer => Model.SelectedCustomerOidsForFiltering?.Contains(possibleCustomer.CustomerOid) ?? false).ToList();
Model.SelectedResourcesForFiltering = Model.PossibleResources.Where(possibleResource => possibleResource.ResourceOid.HasValue && (Model.SelectedResourceOidsForFiltering?.Contains(possibleResource.ResourceOid.Value) ?? false)).ToList();
ReloadAppointments();
}
private void ReloadAppointments()
{
if(Model.LoggedInEmployee.EmployeeOid is null)
{
throw new Exception("Bei DevExpressSchedulerController.ReloadAppointments() ist die Oid des angemeldeten Benutzers wider Erwarten NULL!");
}
UpdateSelectedObjects();
var employeeOid = Model.LoggedInEmployee.EmployeeOid.Value;
var user = LoggedInUser;
var userSettings = user?.Settings.FirstOrDefault(f => f.Type.Equals(SettingsType.ApplicationSettings))?.Value;
Model.CurrentViewType = (SchedulerViewType) UserSettingsUtils.GetSettingValueAsInteger(userSettings, SettingsKeys.SchedulerViewType);
var intervalStart = DateTimeExtensions.GetDayOfWeek(DayOfWeek.Monday);
var intervalEnd = intervalStart.AddDays(7);
var appointments = KalenderService.LoadFilteredAppointmentsMitAufgaben
(
Model.HasRightKalenderMitarbeitertermineAnsehen,
employeeOid,
intervalStart,
intervalEnd,
Model.SelectedEmployeeOidsForFiltering,
Model.SelectedCustomerOidsForFiltering,
Model.SelectedResourceOidsForFiltering,
Model.ShowOnlyEmployees,
Model.ShowOnlyCustomers,
Model.ShowOnlyResources,
Model.ShowOnlyMyOwnAppointments,
Model.ShowOnlyMyOwnAppointments,
Model.ShowTasks
);
var selectedCustomerOids = Model.PossibleCustomers.Select(s => s.CustomerOid).ToList();
var selectedEmployeeOids = Model.PossibleEmployees.Select(s => s.EmployeeOid).ToList();
var customerAbsenceTimes = KalenderService.GetAllActiveCustomersAbsenceTimesInInterval(intervalStart, intervalEnd, employeeOid, selectedCustomerOids);
var employeeAbsenceTimes = KalenderService.GetAllActiveEmployeeAbsenceTimesInInterval(intervalStart, intervalEnd, employeeOid, selectedEmployeeOids);
var allAbsenceTimes = new List<AbsenceTimeDC>();
allAbsenceTimes.AddRange(customerAbsenceTimes);
allAbsenceTimes.AddRange(employeeAbsenceTimes);
appointments.AddRange(ConvertAbsenceTimesToAppointments(allAbsenceTimes, Model.PossibleCustomers, Model.PossibleEmployees));
Model.Appointments = appointments;
}
private List<SchedulerAppointmentDC> ConvertAbsenceTimesToAppointments(List<AbsenceTimeDC> absenceTimes, List<CompactCustomerDC> allCustomers, List<CompactEmployeeDC> allEmployees)
{
var appointments = new List<SchedulerAppointmentDC>();
foreach(var absenceTime in absenceTimes)
{
var subject = $"{absenceTime.Reason.Description}";
var employee = absenceTime.EmployeeOid.HasValue ? allEmployees.FirstOrDefault(f => f.EmployeeOid == absenceTime.EmployeeOid.Value) : null;
var customer = absenceTime.CustomerOid.HasValue ? allCustomers.FirstOrDefault(f => f.CustomerOid == absenceTime.CustomerOid.Value) : null;
var allDay = absenceTime.IsAllDay;
var isEmployeeAbsenceTime = absenceTime.EmployeeOid.HasValue;
IFilterableDC dc = employee;
var originator = employee;
if(false == isEmployeeAbsenceTime)
{
dc = customer;
originator = EmployeeService.FindCompactEmployeeByFullname(absenceTime.InsUser);
}
if(false == dc is null)
{
subject += $" ({dc.SimpleDescription})";
}
var absenceTimeEnd = absenceTime.End;
var end = absenceTime.End ?? DateTime.MaxValue;
var isMultipleDayAbsenceTime = absenceTime.End is null || absenceTime.Start.Value.Date != absenceTime.End.Value.Date;
if(isMultipleDayAbsenceTime && allDay && end != DateTime.MaxValue)
{
absenceTimeEnd = end.AddDays(1);
}
if(originator is null)
{
originator = LoggedInUser.Employee;
}
var appointment = new SchedulerAppointmentDC
{
AbsenceReason = absenceTime.Reason,
AllDay = true,
Description = absenceTime.Notice,
StartDate = absenceTime.Start,
EndDate = absenceTimeEnd,
ActivationType = ActivationTypeId.Active,
FormerAbsenceTimeOid = absenceTime.AbsenceTimeOid,
Originator = originator,
Subject = subject,
Krankheitsmeldung = absenceTime.KrankheitsMeldung
};
if(false == customer is null && employee is null)
{
appointment.CustomerList = new List<CompactCustomerDC> { customer };
}
appointments.Add(appointment);
}
return appointments;
}
[Authorize]
public ActionResult DevExpressScheduler()
{
if(false == MobileSessionFacade.IsUserLoggedIn() || Model is null)
{
return RedirectToActionPermanent("Index", "Login");
}
Model.Resources = new List<object>();
return View(Model);
}
[Authorize]
public ActionResult SchedulerPagePartial()
{
return PartialView("SchedulerPagePartial", Model);
}
[Authorize]
public ActionResult EditAppointment()
{
UpdateAppointment();
return PartialView("SchedulerPagePartial", Model);
}
[Authorize]
private void UpdateAppointment()
{
var appointmentsToInsert = SchedulerExtension.GetAppointmentsToInsert<SchedulerAppointmentDC>(
"scheduler",
Model.Appointments,
SchedulerHelper.DefaultAppointmentStorage,
SchedulerHelper.DefaultResourceStorage);
var appointmentsToUpdate = SchedulerExtension.GetAppointmentsToUpdate<SchedulerAppointmentDC>(
"scheduler",
Model.Appointments,
SchedulerHelper.DefaultAppointmentStorage,
SchedulerHelper.DefaultResourceStorage
);
var appointmentsToRemove = SchedulerExtension.GetAppointmentsToRemove<SchedulerAppointmentDC>(
"scheduler",
Model.Appointments,
SchedulerHelper.DefaultAppointmentStorage,
SchedulerHelper.DefaultResourceStorage
);
foreach(var appointment in appointmentsToInsert)
{
appointment.CustomerList = AppointmentModel.SelectedCustomers;
appointment.ResourceList = AppointmentModel.SelectedResources;
appointment.EmployeeList = new List<Employee2SchedulerAppointmentDC>();
foreach(var selectedEmployee in AppointmentModel.SelectedEmployees ?? new List<CompactEmployeeDC>())
{
appointment.EmployeeList.Add(new Employee2SchedulerAppointmentDC { Employee = selectedEmployee });
}
appointment.Originator = Model.LoggedInUser.Employee;
KalenderService.InsertSchedulerAppointment(appointment);
ViewData["EditableAppointmentModel"] = appointment;
}
foreach(var appointment in appointmentsToUpdate)
{
if(AppointmentModel.SelectedCustomers != null)
{
appointment.CustomerList = AppointmentModel.SelectedCustomers;
}
if(AppointmentModel.SelectedResources != null)
{
appointment.ResourceList = AppointmentModel.SelectedResources;
}
if(AppointmentModel.SelectedEmployees != null)
{
appointment.EmployeeList = new List<Employee2SchedulerAppointmentDC>();
foreach(var selectedEmployee in AppointmentModel.SelectedEmployees)
{
appointment.EmployeeList.Add(new Employee2SchedulerAppointmentDC { Employee = selectedEmployee });
}
}
appointment.ActivationType = ActivationTypeId.Active;
KalenderService.UpdateSchedulerAppointments(new List<SchedulerAppointmentDC> { appointment });
}
KalenderService.DeleteSchedulerAppointments(
appointmentsToRemove
.Where(appointment => appointment.SchedulerAppointmentOid.HasValue && appointment.NewSchedulerAppointmentVersion.HasValue)
.ToDictionary(k => k.SchedulerAppointmentOid.Value, v => v.NewSchedulerAppointmentVersion.Value));
ReloadAppointments();
}
[HttpPost]
public ActionResult CustomerMultiSelectPartial(string value)
{
var selectedCustomerOids = GridLookupExtension.GetSelectedValues<long?>("CustomerGridLookup") ?? Array.Empty<long?>();
AppointmentModel.SelectedCustomerOids = selectedCustomerOids.Where(oid => oid.HasValue).Select(oid => oid.Value).ToList();
return PartialView("CustomerMultiSelectPartial", AppointmentModel);
}
[HttpPost]
public ActionResult ResourceGridLookupPartial(string value)
{
var selectedResourceOids = GridLookupExtension.GetSelectedValues<long?>("ResourceGridLookup") ?? Array.Empty<long?>();
AppointmentModel.SelectedResourceOids = selectedResourceOids.Where(oid => oid.HasValue).Select(oid => oid.Value).ToList();
return PartialView("ResourceMultiSelectPartial", AppointmentModel);
}
[HttpPost]
public ActionResult EmployeeGridLookupPartial(string value)
{
/*
* Im AppointmentModel müssen die PossibleEmployees bleiben, denn daraus wählt man die Mitarbeiter, die noch nicht mit dem Termin
* verknüpft sind und es müssen - zumindest beim Bearbeiten - die bereits mit dem Termin verbundenen Mitarbeiter-zu-Termin-Relationen
* zwischengespeichert werden.
*
*/
var selectedEmployeeOids = GridLookupExtension.GetSelectedValues<long?>("EmployeeGridLookup") ?? Array.Empty<long?>();
AppointmentModel.SelectedEmployeeOids = selectedEmployeeOids.Where(oid => oid.HasValue).Select(oid => oid.Value).ToList();
return PartialView("EmployeeMultiSelectPartial", AppointmentModel);
}
[Authorize]
public string SelectActiveViewType(string viewTypeName)
{
if(Enum.TryParse<SchedulerViewType>(viewTypeName, out var viewType))
{
Model.CurrentViewType = viewType;
UpdateUserSettingsWithoutReload(SettingsKeys.SchedulerViewType, ((int) viewType).ToString());
}
return LeerzeichenFuerGetMethoden;
}
[Authorize]
public ActionResult CustomCallbackAction(string apptID, string actionId, string[] args)
{
if(actionId == "ToServiceRecord")
{
long? selectedAppointmentOid;
var isRecurring = false;
// Serientermin
if(apptID.Contains("_"))
{
var splitApptId = apptID.Split('_');
selectedAppointmentOid = long.Parse(splitApptId[0]);
var recurrenceIndex = int.Parse(splitApptId[1]);
TempData[TempDataConstants.AppointmentRecurrenceIndexKey] = recurrenceIndex;
}
else
{
selectedAppointmentOid = long.Parse(apptID);
}
var appointment = selectedAppointmentOid.HasValue ? Model.GetAppointmentByOid(selectedAppointmentOid.Value) : null;
TempData[TempDataConstants.AppointmentOidKey] = appointment?.SchedulerAppointmentOid;
TempData[TempDataConstants.AppointmentStartKey] = appointment?.StartDate;
TempData[TempDataConstants.AppointmentEndKey] = appointment?.EndDate;
TempData[TempDataConstants.AppointmentSubjectKey] = appointment?.Subject;
TempData[TempDataConstants.AppointmentIsAllDayKey] = appointment?.AllDay ?? false;
TempData[TempDataConstants.AppointmentCustomerOidsKey] = string.Join(",", appointment?.CustomerList.Select(s => s.CustomerOid) ?? new List<long>());
TempData[TempDataConstants.AppointmentEmployeeOidsKey] = string.Join(",", appointment?.EmployeeList.Select(s => s.Employee.EmployeeOid) ?? new List<long>());
TempData[TempDataConstants.AppointmentIsSerienterminKey] = appointment != null && selectedAppointmentOid is null && appointment.RecurrenceInfo is string;
return RedirectToActionPermanent("PrepareServiceRecordInsert", "Main");
}
return PartialView("SchedulerPagePartial", Model);
}
[Authorize]
public string GetAppointmentType(long oid)
{
var appointment = Model.GetAppointmentByOid(oid);
var showMenuItem = false;
var isTask = appointment.IsTask;
var isAbsenceTime = appointment.AbsenceReason != null;
if(isTask)
{
//showMenuItem =
}
return JsonConvert.SerializeObject(showMenuItem);
}
private void UpdateSelectedObjects()
{
var list = new List<ResourceDC>();
Model.ResourceCategories2Resources.Values.DoForEach(l => l.DoForEach(s => list.AddIfNotIn(s)));
Model.SelectedEmployees = Model.PossibleEmployees.Where(employee => Model.SelectedEmployeeOids.Contains(employee.EmployeeOid)).ToList();
Model.SelectedCustomers = Model.PossibleCustomers.Where(customer => Model.SelectedCustomerOids.Contains(customer.CustomerOid)).ToList();
Model.SelectedResources = list.Where(resource => resource.ResourceOid.HasValue && Model.SelectedResourceOids.Contains(resource.ResourceOid.Value)).ToList();
Model.SelectedEmployeesForFiltering = Model.PossibleEmployees.Where(employee => Model.SelectedEmployeeOidsForFiltering.Contains(employee.EmployeeOid)).ToList();
Model.SelectedCustomersForFiltering = Model.PossibleCustomers.Where(customer => Model.SelectedCustomerOidsForFiltering.Contains(customer.CustomerOid)).ToList();
Model.SelectedResourcesForFiltering = list.Where(resource => resource.ResourceOid.HasValue && Model.SelectedResourceOidsForFiltering.Contains(resource.ResourceOid.Value)).ToList();
Model.SelectedEmployeesForIntervalFinder = Model.PossibleEmployees.Where(employee => Model.SelectedEmployeeOidsForIntervalFinder.Contains(employee.EmployeeOid)).ToList();
Model.SelectedCustomersForIntervalFinder = Model.PossibleCustomers.Where(customer => Model.SelectedCustomerOidsForIntervalFinder.Contains(customer.CustomerOid)).ToList();
Model.SelectedResourcesForIntervalFinder = list.Where(resource => resource.ResourceOid.HasValue && Model.SelectedResourceOidsForIntervalFinder.Contains(resource.ResourceOid.Value)).ToList();
}
[Authorize]
public ActionResult CheckEmployeeAvailability(string startString, string endString)
{
var start = DateTime.Parse(startString);
var end = DateTime.Parse(endString);
var availabilities = ReportService.GetMitarbeiterverfuegbarkeiten(AppointmentModel.PossibleEmployees, start, end);
var employee2Overtime = new EmployeeAvailabilityObject(start, end, availabilities);
Model.EmployeeAvailabilityObject = employee2Overtime;
ViewData[ViewDataConstants.SchedulerEmployeeAvailabilityConstant] = employee2Overtime;
return PartialView("SchedulerPagePartial", Model);
}
[Authorize]
public ActionResult SelectAllEmployeesForFiltering(bool isChecked)
{
if(Model is null)
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("AptFltEmployeePopupListPartial");
}
if(isChecked)
{
Model.SelectedEmployeesForFiltering = Model.PossibleEmployees;
Model.SelectedEmployeeOidsForFiltering = Model.PossibleEmployees.Select(employee => employee.EmployeeOid).ToList();
}
else
{
Model.SelectedEmployeesForFiltering?.Clear();
Model.SelectedEmployeeOidsForFiltering?.Clear();
}
return PartialView("AptFltEmployeePopupListPartial", Model);
}
[Authorize]
public ActionResult SelectAllCustomersForFiltering(bool isChecked)
{
if(Model is null)
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("AptFltCustomerPopupListPartial");
}
if(isChecked)
{
Model.SelectedCustomerOidsForFiltering = Model.PossibleCustomers.Select(customer => customer.CustomerOid).ToList();
Model.SelectedCustomersForFiltering = Model.PossibleCustomers;
}
else
{
Model.SelectedCustomerOidsForFiltering?.Clear();
Model.SelectedCustomersForFiltering?.Clear();
}
return PartialView("AptFltCustomerPopupListPartial", Model);
}
[Authorize]
public ActionResult SelectAllResourcesForFiltering(bool isChecked)
{
if(Model is null)
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("AptFltResourcePopupListPartial");
}
if(isChecked)
{
Model.SelectedResourceOidsForFiltering = Model.PossibleResources.Where(resource => resource.ResourceOid.HasValue).Select(resource => resource.ResourceOid.Value).ToList();
Model.SelectedResourcesForFiltering = Model.PossibleResources;
}
else
{
Model.SelectedResourceOidsForFiltering?.Clear();
Model.SelectedResourcesForFiltering?.Clear();
}
return PartialView("AptFltResourcePopupListPartial", Model);
}
[Authorize]
public ActionResult SelectTeamForAppointment(long teamOid)
{
if(Model is null)
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("AptFltEmployeePopupListPartial");
}
var selectedTeam = Model.MyTeams.FirstOrDefault(team => team.TeamOid.Equals(teamOid));
if(selectedTeam is null)
{
return PartialView("AptFltEmployeePopupListPartial", Model);
}
var fullTeamObj = EmployeeService.LoadTeam(teamOid);
var teamMembers = fullTeamObj?.Member ?? new List<CompactEmployeeDC>();
Model.SelectedEmployeesForFiltering.AddRangeIfElementsNotIn(teamMembers);
Model.SelectedEmployeeOids.AddRangeIfElementsNotIn(teamMembers.Select(member => member.EmployeeOid));
return PartialView("AptFltEmployeePopupListPartial", Model);
}
[Authorize]
public ActionResult UpdateEmployeeSelection(long[] selectedEmployeeOids)
{
if(Model is null)
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("AptFltEmployeePopupListPartial");
}
var selectedEmployees = Model.PossibleEmployees.Where(possibleEmployee => selectedEmployeeOids.Contains(possibleEmployee.EmployeeOid)).ToList();
Model.SelectedEmployeesForFiltering = selectedEmployees;
Model.SelectedEmployeeOidsForFiltering = selectedEmployees.Select(employee => employee.EmployeeOid).ToList();
return PartialView("AptFltEmployeePopupListPartial", Model);
}
[Authorize]
public ActionResult UpdateCustomerSelection(long[] selectedCustomerOids)
{
if(Model is null)
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("AptFltCustomerPopupListPartial");
}
var selectedCustomers = Model.PossibleCustomers.Where(possibleCustomer => selectedCustomerOids.Contains(possibleCustomer.CustomerOid)).ToList();
Model.SelectedCustomersForFiltering = selectedCustomers;
Model.SelectedCustomerOidsForFiltering = selectedCustomers.Select(customer => customer.CustomerOid).ToList();
return PartialView("AptFltCustomerPopupListPartial", Model);
}
[Authorize]
public ActionResult UpdateResourceSelection(long[] selectedResourceOids)
{
if(Model is null)
{
TempData[TempDataConstants.DoLogoutKey] = true;
return PartialView("AptFltResourcePopupListPartial");
}
var selectedResources = Model.PossibleResources.Where(possibleResource => possibleResource.ResourceOid.HasValue && selectedResourceOids.Contains(possibleResource.ResourceOid.Value)).ToList();
Model.SelectedResourcesForFiltering = selectedResources;
Model.SelectedResourceOidsForFiltering = selectedResources.Where(resource => resource.ResourceOid.HasValue).Select(resource => resource.ResourceOid.Value).ToList();
return PartialView("AptFltResourcePopupListPartial", Model);
}
[Authorize]
public string GetSelectedEmployeesForAptFlt()
{
return JsonConvert.SerializeObject(Model.SelectedEmployeeOidsForFiltering.Count);
}
[Authorize]
public string GetSelectedCustomersForAptFlt()
{
return JsonConvert.SerializeObject(Model.SelectedCustomerOidsForFiltering.Count);
}
[Authorize]
public string GetSelectedResourcesForAptFlt()
{
return JsonConvert.SerializeObject(Model.SelectedResourceOidsForFiltering.Count);
}
}
}