72 lines
2.3 KiB
C#
72 lines
2.3 KiB
C#
using System;
|
|
using System.Threading;
|
|
using CSLA.Security;
|
|
|
|
|
|
namespace GZTW.AyaNova.BLL
|
|
{
|
|
/// <summary>
|
|
///Triggers processing of pending notifications and preventive maintenance items
|
|
/// </summary>
|
|
public class GenProcess
|
|
{
|
|
private GenProcess()
|
|
{
|
|
//
|
|
// TODO: Add constructor logic here
|
|
//
|
|
}
|
|
|
|
/// <summary>
|
|
/// One stop call to process all Generator items without having to call them individually.
|
|
/// For example this will call GenProcessPM.GeneratePMWorkorders() followed by GenProcessDeliveries.DeliverNotifications()
|
|
/// etc etc.
|
|
///
|
|
/// This is the preferred method to call Generator processing in your code.
|
|
///
|
|
///
|
|
/// </summary>
|
|
/// <param name="UserName"></param>
|
|
/// <param name="Password"></param>
|
|
public static void GO(string UserName, string Password)
|
|
{
|
|
|
|
|
|
if(!Thread.CurrentPrincipal.Identity.IsAuthenticated)
|
|
AyaBizUtils.Login(UserName,Password);
|
|
if(Thread.CurrentPrincipal.Identity.IsAuthenticated)
|
|
{
|
|
GZTW.AyaNova.BLL.AyaBizUtils.mGlobalSettings=Global.GetItem();
|
|
}
|
|
else
|
|
throw new ApplicationException("Generator - Authentication error");
|
|
|
|
//Changed 02-June-2006 swapped order of these
|
|
//so that if notifications are crashing out generator
|
|
//the pm's will process when the user re-runs it while diagnosing the problem
|
|
//The thinking behind this is that pm's are less likely to crash than notifications
|
|
//and we've gone over ways of handling any crash and decided it's best to just hard
|
|
//crash without handling the exception if it get's this far so that the end user
|
|
//sees the exception dialog right away and we find out before too much time goes by
|
|
|
|
|
|
GenProcessPM.GeneratePMWorkorders();
|
|
|
|
GenProcessDeliveries.DeliverNotifications();
|
|
|
|
//case 53
|
|
GenProcessClientNotifications.DeliverNotifications();
|
|
|
|
//case 1325
|
|
//TODO: Code this
|
|
//GenProcessEmailToCSR.GenerateEMI();
|
|
|
|
|
|
//case 1448
|
|
//todo: code this
|
|
//GenProcessRequestToWorkorder.GenerateWorkorders();
|
|
|
|
}
|
|
}
|
|
}
|