Files
ayanova7/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/DashBoardInfoRI.cs
2018-06-29 19:47:36 +00:00

82 lines
3.2 KiB
C#

///////////////////////////////////////////////////////////
// DashBoardInfoRI.cs
// Implementation of Class DashBoardInfoRI
// CSLA type: Read-only object
// Created on: 09-Jan-2012
// Object design: John / Joyce
// Coded: John 09-Jan-2012
///////////////////////////////////////////////////////////
using System;
using System.Data;
using CSLA.Data;
using GZTW.Data;
using CSLA;
using System.Threading;
using CSLA.Security;
using System.Collections.Generic;
namespace GZTW.AyaNova.BLL
{
#pragma warning disable 1591
/// <summary>
/// Fetches header and user information for Dashboard form / page
/// </summary>
[Serializable]
public class DashBoardInfoRI : ReadOnlyBase
{
/// <summary>
/// Private constructor to prevent direct instantiation
/// </summary>
private DashBoardInfoRI()
{
}
public long defaultListCount { get { return 3L; } }
public string CurrentUserNameFormatted { get; private set; }
public string CurrentCompanyOrRegionName { get; private set; }
public string More { get; private set; }
public bool FetchScheduleableUserInfo { get; private set; }
public long myOverdueTotal { get; private set; }
public long myScheduledTotal { get; private set; }
public long compNotAssignedTotal { get; private set; }
public long compOverdueTotal { get; private set; }
public long compScheduledTotal { get; private set; }
public long myMemoTotal { get; private set; }
public long myReminderTotal { get; private set; }
public long compCSRTotal { get; private set; }
public static DashBoardInfoRI Get(string sMore)
{
DashBoardInfoRI di = new DashBoardInfoRI();
di.More = sMore;
di.FetchScheduleableUserInfo = true;
if (User.IsAdmin) di.FetchScheduleableUserInfo = false;
if (User.CurrentUserType != UserTypes.Schedulable)
di.FetchScheduleableUserInfo = false;
di.CurrentUserNameFormatted = UserPickList.GetListOfOneSpecificUser(User.CurrentThreadUserID)[0].Name;
di.CurrentCompanyOrRegionName = AyaBizUtils.REGTO;
if (!User.CurrentUserIsInDefaultRegion)
di.CurrentCompanyOrRegionName = NameFetcher.GetItem(new TypeAndID(RootObjectTypes.Region, User.CurrentUserRegionID)).RecordName;
di.myOverdueTotal = DashBoardScheduledUserListRI.GetCount("myOverdue");
di.myScheduledTotal = DashBoardScheduledUserListRI.GetCount("myScheduled");
di.myMemoTotal = DashBoardMemoListRI.GetCount();
di.myReminderTotal = DashboardReminderListRI.GetCount();
di.compNotAssignedTotal = DashBoardScheduledUserListRI.GetCount("compNotAssigned");
di.compOverdueTotal = DashBoardScheduledUserListRI.GetCount("compOverdue");
di.compScheduledTotal = DashBoardScheduledUserListRI.GetCount("compScheduled");
di.compCSRTotal = DashBoardClientServiceRequestListRI.GetCount();
return di;
}
}//eoc
#pragma warning restore 1591
}//ens