case 3816

This commit is contained in:
2020-08-17 17:55:53 +00:00
parent 52f0c03b0c
commit e87ca457a6
3 changed files with 103 additions and 83 deletions

View File

@@ -62,4 +62,4 @@ using System.Runtime.InteropServices;
[assembly: log4net.Config.XmlConfigurator(ConfigFile="Log4Net.config",Watch=true)]
//[assembly: log4net.Config.XmlConfigurator(Watch=true)]
[assembly: ComVisibleAttribute(false)]
[assembly: AssemblyFileVersionAttribute("7.6.3.0")]
[assembly: AssemblyFileVersionAttribute("7.6.4.0")]

View File

@@ -30,7 +30,7 @@ namespace AyaNova
private Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea _Form1_Toolbars_Dock_Area_Bottom;
private System.Windows.Forms.Panel Form1_Fill_Panel;
private UltraExplorerBar ultraExplorerBar1; //Case 534 made internal
private System.Windows.Forms.Panel RightPane;
private System.ComponentModel.IContainer components;
@@ -82,9 +82,9 @@ namespace AyaNova
Util.TempFolder = AyaBizUtils.TempFolderPath();
}
private NotifySubscriptionsForm frmSubscriptions;
@@ -102,7 +102,7 @@ namespace AyaNova
//case 1805
private DashboardForm frmDashboard;
//case 1967
//Classes outside of this form require access to some of the private components
//on this form. Previosly I just changed their definition to "internal" but
@@ -1872,7 +1872,7 @@ namespace AyaNova
log.Info(Thread.CurrentPrincipal.Identity.Name + " logged in");
//Get the settings
//NOTE: this triggers the first database call *after* the login one by indirectly triggering the ScheduleableUserCountFetcher which is the first database call and why
//we often see a log trace like this:
@@ -1899,6 +1899,14 @@ namespace AyaNova
return;
}
//case 3816
if (uLoggingIn.IsAdministrator)
{
// uLoggingIn.LastView = "LT:Dashboard.Label.Dashboard,";//dashboard is too dangerous as it triggers a sql query inside workorder structure
//global settings is more neutral and less likely to cause an UI lockup or issue
uLoggingIn.LastView = "LT:UI.Go.Administration,LT:UI.Go.Administration.GlobalSettings";
}
Util.CurrentUserDefaultPartWarehouseID = uLoggingIn.DefaultWarehouseID;
//case 939
@@ -2030,6 +2038,11 @@ namespace AyaNova
}
}
//case 3816 potential fix for temp issue to fix Admin unable to login due to error on last view
//LT:Dashboard.Label.Dashboard,
//make sFormKey="LT:Dashboard.Label.Dashboard" and sSubFormKey="" if admin
//then admin always goes to dashboard
//show form or if no match then show first visible form
@@ -2173,19 +2186,19 @@ namespace AyaNova
if (LicenseRequired)
{
string s = "This is a new version of AyaNova not previously used with this database\r\n\r\nAn active subscription license is required to use it\r\n\r\nThere are two options:\r\n1) Downgrade back to the previous version\r\n2) Install a new license\r\n\r\n";
if (!AyaBizUtils.Lite && User.AdministratorID != User.CurrentThreadUserID)
{
log.Info(s+"Current user is not the Manager account.\r\nInforming of options and exiting...");
MessageBox.Show(s+"If you would like to install a new license you must log in again using the AyaNova \"Manager\" account.");
log.Info(s + "Current user is not the Manager account.\r\nInforming of options and exiting...");
MessageBox.Show(s + "If you would like to install a new license you must log in again using the AyaNova \"Manager\" account.");
Application.Exit();
return true;
}
log.Info(s+"Prompting for license entry...");
if (MessageBox.Show(s+"You can enter a new license now by selecting OK", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
log.Info(s + "Prompting for license entry...");
if (MessageBox.Show(s + "You can enter a new license now by selecting OK", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK)
{
log.Info("User opted for license entry form...");
GlobalxForm g = new GlobalxForm(true);
@@ -2256,7 +2269,7 @@ namespace AyaNova
MessageBox.Show("The database schema has been updated.\r\nAyaNova will now close to complete the update.");
Application.Exit();
return true;
}
}
@@ -2526,7 +2539,7 @@ namespace AyaNova
ultraExplorerBar1.Groups["LT:UI.Go.Inventory"].Items["LT:WorkorderItemPartRequest.Label.List"].Visible = Util.GlobalSettings.UseInventory;
//case 2102
//case 2102
if (ultraExplorerBar1.Groups["LT:UI.Go.Inventory"].Items.Exists("LT:UI.Go.Inventory.PurchaseOrdersDetailed"))
{
//case 1000
@@ -2534,7 +2547,7 @@ namespace AyaNova
ultraExplorerBar1.Groups["LT:UI.Go.Inventory"].Items["LT:UI.Go.Inventory.PurchaseOrders"].Visible;
}
//case 2102
//case 2102
if (ultraExplorerBar1.Groups["LT:UI.Go.Inventory"].Items.Exists("LT:UI.Go.Inventory.PurchaseOrderReceiptsDetailed"))
{
//case 1000
@@ -2545,7 +2558,7 @@ namespace AyaNova
//case 2099 added in schema 105
if (ultraExplorerBar1.Groups["LT:UI.Go.Inventory"].Items.Exists("LT:UI.Go.Inventory.PartInventoryAdjustmentsDetailed"))
{
ultraExplorerBar1.Groups["LT:UI.Go.Inventory"].Items["LT:UI.Go.Inventory.PartInventoryAdjustmentsDetailed"].Visible =
ultraExplorerBar1.Groups["LT:UI.Go.Inventory"].Items["LT:UI.Go.Inventory.PartInventoryAdjustments"].Visible;
@@ -2613,9 +2626,9 @@ namespace AyaNova
//case 1967
if (ultraExplorerBar1.Groups["LT:UI.Go.User"].Items.Exists("LT:ScheduleMarker.Label.List"))
{
ultraExplorerBar1.Groups["LT:UI.Go.User"].Items["LT:ScheduleMarker.Label.List"].Visible =
((AyaBizUtils.Right("Object.ScheduleMarker") > 1) &&
(User.CurrentUserType== UserTypes.Schedulable));//only scheduleable users can have a followup or schedulemarker
ultraExplorerBar1.Groups["LT:UI.Go.User"].Items["LT:ScheduleMarker.Label.List"].Visible =
((AyaBizUtils.Right("Object.ScheduleMarker") > 1) &&
(User.CurrentUserType == UserTypes.Schedulable));//only scheduleable users can have a followup or schedulemarker
}
}
@@ -2663,7 +2676,7 @@ namespace AyaNova
ultraExplorerBar1.Groups["LT:UI.Go.Administration"].Items["LT:NotifyDeliveryLog.Label.List"].Visible = (AyaBizUtils.Right("Object.Notification") > 1);
ultraExplorerBar1.Groups["LT:UI.Go.Administration"].Items["LT:Report.Label.List"].Visible = (AyaBizUtils.Right("Object.Report") > 1);
//case 2102
if (ultraExplorerBar1.Groups["LT:UI.Go.Administration"].Items.Exists("LT:AyaFile.Label.List"))
{
@@ -2724,7 +2737,7 @@ namespace AyaNova
//}
//else
tbHelp.Tools["LITE"].SharedProps.Visible = false;
tbHelp.Tools["LITE"].SharedProps.Visible = false;
//case 1306
tbHelp.Tools["QuickStart"].SharedProps.Visible = AyaBizUtils.Trial;
@@ -3638,7 +3651,7 @@ namespace AyaNova
case "QuickStart": // case 1306
//case 3649
Util.OpenWebURL(Util.BaseHelpUrl + "index.html?quickstart_for_beginners.htm");
Util.OpenWebURL(Util.BaseHelpUrl + "index.html?quickstart_for_beginners.htm");
break;
@@ -3652,11 +3665,11 @@ namespace AyaNova
case "LT:UI.Help.CheckForUpdates": // StateButtonTool
//case 3116
//original
//original
//string surl = CheckForUpdate.UpdateUrl((AyaBizUtils.Lite ? "AyaNovaLite" : "AyaNovaFull"), System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
//New
//New
System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
System.Diagnostics.FileVersionInfo fileVersion = System.Diagnostics.FileVersionInfo.GetVersionInfo(a.Location);
string surl = CheckForUpdate.UpdateUrl((AyaBizUtils.Lite ? "AyaNovaLite" : "AyaNovaFull"), fileVersion.FileVersion);
@@ -3675,7 +3688,7 @@ namespace AyaNova
}
else
MessageBox.Show("Up to date!");
break;
case "LT:UI.Help.PurchaseLicenses": // StateButtonTool
@@ -4214,9 +4227,9 @@ namespace AyaNova
SubStatus ssdlg = new SubStatus();
ssdlg.ShowDialog();
}
}
//case 1389
MainFormLoadingComplete = true;
}
@@ -4753,47 +4766,47 @@ namespace AyaNova
User u = User.GetItem(new Guid("619AAD67-B95E-4674-844B-5057EBE8AF05"));
string srch="<WHEREITEMGROUP GROUPLOGICALOPERATOR=\"And\" UI=\"LT_WorkorderItemScheduledUser_Label_UserID\">" +
"<WHEREITEM COMPAREOPERATOR=\"Equals\" CM=\"aWorkorderItemScheduledUser.aUserID\" UICOMPAREVALUE=\"\" TYPE=\"System.Guid\" COMPAREVALUE=\""+u.ID.ToString().ToUpperInvariant()+"\" />" +
string srch = "<WHEREITEMGROUP GROUPLOGICALOPERATOR=\"And\" UI=\"LT_WorkorderItemScheduledUser_Label_UserID\">" +
"<WHEREITEM COMPAREOPERATOR=\"Equals\" CM=\"aWorkorderItemScheduledUser.aUserID\" UICOMPAREVALUE=\"\" TYPE=\"System.Guid\" COMPAREVALUE=\"" + u.ID.ToString().ToUpperInvariant() + "\" />" +
"</WHEREITEMGROUP>";
var v=WorkorderQuoteScheduledUserList.GetList(srch);
var v = WorkorderQuoteScheduledUserList.GetList(srch);
// <?xml version="1.0" encoding="utf-16" standalone="yes"?>
//<GRIDCRITERIA>
// <COLUMNITEM CM="aUser_1.aLastName" UI="LT_WorkorderItemScheduledUser_Label_UserID" PIN="0" WIDTH="171" SORT="ASC" />
// <COLUMNITEM CM="aWorkorderQuote.aQuoteNumber" UI="LT_O_WorkorderQuote" PIN="0" WIDTH="78" />
// <COLUMNITEM CM="aWorkorderItemScheduledUser.aStartDate" UI="LT_WorkorderItemScheduledUser_Label_StartDate" PIN="0" WIDTH="137" />
// <COLUMNITEM CM="aWorkorderQuote.aIntroduction" UI="LT_WorkorderQuote_Label_Introduction" PIN="0" WIDTH="132" />
// <COLUMNITEM CM="aWorkorderItemScheduledUser.aStartDate" UI="LT_WorkorderItemScheduledUser_Label_StartDateRelative" PIN="0" WIDTH="118" />
// <COLUMNITEM CM="aWorkorder.aOnsite" UI="LT_Workorder_Label_Onsite" PIN="0" WIDTH="80" />
// <COLUMNITEM CM="aWorkorderQuote.aQuoteStatusType" UI="LT_WorkorderQuote_Label_QuoteStatusType" PIN="0" WIDTH="79" />
// <COLUMNITEM CM="aWorkorderItem.aSummary" UI="LT_WorkorderItem_Label_Summary" PIN="0" WIDTH="121" />
// <COLUMNITEM CM="aWorkorder.aCustomerContactName" UI="LT_Workorder_Label_CustomerContactName" PIN="0" WIDTH="98" />
// <COLUMNITEM CM="aWorkorderQuote.aDateSubmitted" UI="LT_WorkorderQuote_Label_DateSubmitted" PIN="0" WIDTH="98" />
// <COLUMNITEM CM="grid" UI="LT_WorkorderQuote_Label_PreparedByID" PIN="0" WIDTH="136" />
// <COLUMNITEM CM="aWorkorderItemStatus.aName" UI="LT_WorkorderItem_Label_WorkorderStatusID" PIN="0" WIDTH="158" />
// <COLUMNITEM CM="aWorkorderQuote.aDateApproved" UI="LT_WorkorderQuote_Label_DateApproved" PIN="0" WIDTH="96" />
// <COLUMNITEM CM="aDispatchZone.aName" UI="LT_O_DispatchZone" PIN="0" WIDTH="120" />
// <COLUMNITEM CM="aClient.aName" UI="LT_O_Client" PIN="0" WIDTH="76" />
// <COLUMNITEM CM="aWorkorderItemScheduledUser.aStopDate" UI="LT_WorkorderItemScheduledUser_Label_StopDate" PIN="0" WIDTH="136" />
// <COLUMNITEM CM="aRate.aName" UI="LT_WorkorderItemScheduledUser_Label_ServiceRateID" PIN="0" WIDTH="124" />
// <COLUMNITEM CM="aWorkorderItemScheduledUser.aEstimatedQuantity" UI="LT_WorkorderItemScheduledUser_Label_EstimatedQuantity" PIN="0" WIDTH="140" />
// <WHEREITEMGROUP GROUPLOGICALOPERATOR="And" UI="LT_WorkorderItemScheduledUser_Label_UserID">
// <WHEREITEM COMPAREOPERATOR="Equals" CM="aWorkorderItemScheduledUser.aUserID" UICOMPAREVALUE="Eva Alexander - ALL REGIONS" TYPE="System.Guid" COMPAREVALUE="{619AAD67-B95E-4674-844B-5057EBE8AF05}" />
// </WHEREITEMGROUP>
//</GRIDCRITERIA>
// <?xml version="1.0" encoding="utf-16" standalone="yes"?>
//<GRIDCRITERIA>
// <COLUMNITEM CM="aUser_1.aLastName" UI="LT_WorkorderItemScheduledUser_Label_UserID" PIN="0" WIDTH="171" SORT="ASC" />
// <COLUMNITEM CM="aWorkorderQuote.aQuoteNumber" UI="LT_O_WorkorderQuote" PIN="0" WIDTH="78" />
// <COLUMNITEM CM="aWorkorderItemScheduledUser.aStartDate" UI="LT_WorkorderItemScheduledUser_Label_StartDate" PIN="0" WIDTH="137" />
// <COLUMNITEM CM="aWorkorderQuote.aIntroduction" UI="LT_WorkorderQuote_Label_Introduction" PIN="0" WIDTH="132" />
// <COLUMNITEM CM="aWorkorderItemScheduledUser.aStartDate" UI="LT_WorkorderItemScheduledUser_Label_StartDateRelative" PIN="0" WIDTH="118" />
// <COLUMNITEM CM="aWorkorder.aOnsite" UI="LT_Workorder_Label_Onsite" PIN="0" WIDTH="80" />
// <COLUMNITEM CM="aWorkorderQuote.aQuoteStatusType" UI="LT_WorkorderQuote_Label_QuoteStatusType" PIN="0" WIDTH="79" />
// <COLUMNITEM CM="aWorkorderItem.aSummary" UI="LT_WorkorderItem_Label_Summary" PIN="0" WIDTH="121" />
// <COLUMNITEM CM="aWorkorder.aCustomerContactName" UI="LT_Workorder_Label_CustomerContactName" PIN="0" WIDTH="98" />
// <COLUMNITEM CM="aWorkorderQuote.aDateSubmitted" UI="LT_WorkorderQuote_Label_DateSubmitted" PIN="0" WIDTH="98" />
// <COLUMNITEM CM="grid" UI="LT_WorkorderQuote_Label_PreparedByID" PIN="0" WIDTH="136" />
// <COLUMNITEM CM="aWorkorderItemStatus.aName" UI="LT_WorkorderItem_Label_WorkorderStatusID" PIN="0" WIDTH="158" />
// <COLUMNITEM CM="aWorkorderQuote.aDateApproved" UI="LT_WorkorderQuote_Label_DateApproved" PIN="0" WIDTH="96" />
// <COLUMNITEM CM="aDispatchZone.aName" UI="LT_O_DispatchZone" PIN="0" WIDTH="120" />
// <COLUMNITEM CM="aClient.aName" UI="LT_O_Client" PIN="0" WIDTH="76" />
// <COLUMNITEM CM="aWorkorderItemScheduledUser.aStopDate" UI="LT_WorkorderItemScheduledUser_Label_StopDate" PIN="0" WIDTH="136" />
// <COLUMNITEM CM="aRate.aName" UI="LT_WorkorderItemScheduledUser_Label_ServiceRateID" PIN="0" WIDTH="124" />
// <COLUMNITEM CM="aWorkorderItemScheduledUser.aEstimatedQuantity" UI="LT_WorkorderItemScheduledUser_Label_EstimatedQuantity" PIN="0" WIDTH="140" />
// <WHEREITEMGROUP GROUPLOGICALOPERATOR="And" UI="LT_WorkorderItemScheduledUser_Label_UserID">
// <WHEREITEM COMPAREOPERATOR="Equals" CM="aWorkorderItemScheduledUser.aUserID" UICOMPAREVALUE="Eva Alexander - ALL REGIONS" TYPE="System.Guid" COMPAREVALUE="{619AAD67-B95E-4674-844B-5057EBE8AF05}" />
// </WHEREITEMGROUP>
//</GRIDCRITERIA>
StringBuilder sb=new StringBuilder();
StringBuilder sb = new StringBuilder();
foreach (WorkorderQuoteScheduledUserList.WorkorderQuoteScheduledUserListInfo i in v)
{
Workorder w = Workorder.GetItemNoMRU(i.LT_Workorder_Label_ID);
w.WorkorderItems[i.LT_WorkorderItem_Label_ID].ScheduledUsers[i.LT_WorkorderItemScheduledUser_Label_ID].UserID = Guid.Empty;
w.Save();
}
}
if (keyData == Keys.F11)
@@ -5327,30 +5340,34 @@ namespace AyaNova
#endregion generate serialized inventory
#region delete a bunch of clients
//StringBuilder sbRet = new StringBuilder();
//ClientPickList cpl = ClientPickList.GetList();
//foreach (ClientPickList.ClientPickListInfo theClient in cpl)
//{
// try
// {
// sbRet.AppendLine("Attempting to delete client " + theClient.Name);
// sbRet.AppendLine("WORKORDERS");
// sbRet.AppendLine(Client.DeleteAllClientWorkorders(theClient.ID));
// sbRet.AppendLine("UNITS");
// Client.DeleteAllClientUnits(theClient.ID);
// sbRet.AppendLine("CLIENT RECORD");
// Client.DeleteItem(theClient.ID);
// }
// catch { }
//}
//CopyableMessageBox d = new CopyableMessageBox(sbRet.ToString());
//d.ShowDialog();
#endregion
//============== START OF SCRIPT =========================
StringBuilder sbRet = new StringBuilder();
ClientPickList cpl = ClientPickList.GetList();
foreach (ClientPickList.ClientPickListInfo theClient in cpl)
{
try
{
sbRet.AppendLine("Attempting to delete client " + theClient.Name);
sbRet.AppendLine("WORKORDERS");
sbRet.AppendLine(Client.DeleteAllClientWorkorders(theClient.ID));
sbRet.AppendLine("UNITS");
Client.DeleteAllClientUnits(theClient.ID);
sbRet.AppendLine("CLIENT RECORD");
Client.DeleteItem(theClient.ID);
}
catch { }
}
CopyableMessageBox d = new CopyableMessageBox(sbRet.ToString());
d.ShowDialog();
User.ClearLayout.Clear(User.AdministratorID);
//=============END OF SCRIPT ===============
@@ -5609,7 +5626,7 @@ namespace AyaNova
//after login
this.MainForm = new Form1();
((Form1)this.MainForm).LicenseRequired = true;
return;
return;
}
else
errorMessage = "Unhandled exception:\r\n" + ex.Message + "\r\n" +
@@ -5711,7 +5728,7 @@ namespace AyaNova
}//end catch block
//NOTE: SCHEMA CHECK NOW MOVED TO JUST AFTER LOGIN IS DONE BY USER
#endregion init and integrity check
@@ -5719,7 +5736,7 @@ namespace AyaNova
// Create the main form, the splash screen will close automatically
this.MainForm = new Form1();
//this.MainForm.Visible = true;
//this.MainForm.Visible = false;