diff --git a/TODO.txt b/TODO.txt index 3e61f5e..a76d647 100644 --- a/TODO.txt +++ b/TODO.txt @@ -9,3 +9,6 @@ Biz 7.6 patch 6 case 3808 dupe client notification deliveries + +winform app 7.6 patch 4 +case 3816 \ No newline at end of file diff --git a/source/WinFormApp/AssemblyInfo.cs b/source/WinFormApp/AssemblyInfo.cs index 5d0d439..ef502bb 100644 --- a/source/WinFormApp/AssemblyInfo.cs +++ b/source/WinFormApp/AssemblyInfo.cs @@ -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")] diff --git a/source/WinFormApp/Form1.cs b/source/WinFormApp/Form1.cs index 4a69e28..203e0b0 100644 --- a/source/WinFormApp/Form1.cs +++ b/source/WinFormApp/Form1.cs @@ -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="" + - "" + + string srch = "" + + "" + ""; - var v=WorkorderQuoteScheduledUserList.GetList(srch); + var v = WorkorderQuoteScheduledUserList.GetList(srch); -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// -// + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // + // - 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;