From 677831dd7ba7241bb21545181ca18c21238107c5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 25 Aug 2022 18:17:50 +0000 Subject: [PATCH] case 4180 --- source/WinFormApp/AssemblyInfo.cs | 2 +- source/WinFormApp/Form1.cs | 1177 +---------------- source/bizobjects/AyaLib/AssemblyInfo.cs | 2 +- .../AyaLib/GZTW.AyaNova.BLL/AyaBizUtils.cs | 41 +- .../GenProcessClientNotifications.cs | 2 +- .../GZTW.AyaNova.BLL/GenProcessDeliveries.cs | 3 +- .../GZTW.AyaNova.BLL/GenSMSMessageDelivery.cs | 2 +- .../GenSMTPMessageDelivery.cs | 2 +- 8 files changed, 41 insertions(+), 1190 deletions(-) diff --git a/source/WinFormApp/AssemblyInfo.cs b/source/WinFormApp/AssemblyInfo.cs index 5c57012..dd7a255 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.15.0")] +[assembly: AssemblyFileVersionAttribute("7.6.16.0")] diff --git a/source/WinFormApp/Form1.cs b/source/WinFormApp/Form1.cs index 409238b..8f645d2 100644 --- a/source/WinFormApp/Form1.cs +++ b/source/WinFormApp/Form1.cs @@ -4253,1191 +4253,24 @@ namespace AyaNova { #if(DEBUG) + // ____ ___ ___ ____ __ _ _ __ + //(_ _)( _)/ __)(_ _)( )( \( )/ _) + // )( ) _)\__ \ )( )( ) (( (/\ + // (__) (___)(___/ (__) (__)(_)\_)\__/ + //Case 515 testing if (keyData == Keys.F12) { - //DBManager.FireBirdRecomputeStatistics(); - #region Generate huge tracts o' data - //Random rand=new Random(); - - //Guid gTestSecurityGroupID = new Guid("{EA613C39-38F0-470E-9B76-ABB9B05C5F3A}"); - - //for (int x = 0; x < 999; x++) - //{ - // User u = User.NewItem(); - // u.EmployeeNumber = x.ToString(); - // u.FirstName = "User"; - // u.LastName = x.ToString(); - // u.Initials = "xx"; - // u.EmailAddress = x.ToString() + "@" + "test.com"; - // u.UserType = UserTypes.Schedulable; - // u.MemberOfGroup = gTestSecurityGroupID; - // u.Login = x.ToString(); - // u.Password = x.ToString(); - // if (!u.IsSavable) - // System.Diagnostics.Debugger.Break(); - // u.Save(); - - - //} - - //for (int x = 0; x < 20000; x++) - //{ - // Client c = Client.NewItem(); - // c.Name = "Client" + x.ToString("00000"); - // c.Notes = "The quick brown fox jumped over the six lazy dogs"; - // c.Phone1="555"+x.ToString("00000"); - // c.Contact = "Client Contact"; - // c.GoToAddress.City = "City"; - // c.GoToAddress.Country = "Country"; - // c.GoToAddress.Postal = rand.Next(90000, 99000).ToString(); - // c.WebAddress = "http://www.client" + x.ToString("00000") + ".com"; - // Address.Copy(c.GoToAddress, c.MailToAddress); - // c.AccountNumber = x.ToString(); - // if (!c.IsSavable) - // System.Diagnostics.Debugger.Break(); - // c.Save(); - //} - - - //for (int x = 0; x < 20000; x++) - //{ - // Vendor c = Vendor.NewItem(); - // c.Name = "Test" + x.ToString("00000"); - // c.Notes = "The quick brown fox jumped over the six lazy dogs"; - // c.Phone1 = "555" + x.ToString("00000"); - // c.Contact="Vendor Contact"; - // c.GoToAddress.City = "City"; - // c.GoToAddress.Country = "Country"; - // c.GoToAddress.Postal = rand.Next(90000, 99000).ToString(); - // c.WebAddress = "http://www.vendor" + x.ToString("00000") + ".com"; - // Address.Copy(c.GoToAddress, c.MailToAddress); - // c.AccountNumber = x.ToString(); - // if (!c.IsSavable) - // System.Diagnostics.Debugger.Break(); - // c.Save(); - //} - - - //VendorPickList vpl = VendorPickList.GetList(); - - - //for (int x = 0; x < 20000; x++) - //{ - // Part c = Part.NewItem(); - // c.PartNumber = x.ToString(); - // c.Cost = 5.00m; - // c.Retail = 15.00m; - // c.WholesalerID = vpl[rand.Next(vpl.Count)].ID; - // c.Name= "Part" + x.ToString("00000"); - // c.Save(); - //} - - //Units - - //manufacturers - //for (int x = 20001; x < 20050; x++) - //{ - // Vendor c = Vendor.NewItem(); - // c.VendorType = VendorTypes.Manufacturer; - // c.Name = "VendorMan" + x.ToString("00000"); - // c.Notes = "The quick brown fox jumped over the six lazy dogs"; - // c.Phone1 = "555" + x.ToString("00000"); - // c.Contact = "VendorMan Contact"; - // c.GoToAddress.City = "VendManCity"; - // c.GoToAddress.Country = "VendManCountry"; - // c.GoToAddress.Postal = rand.Next(90000, 99000).ToString(); - // c.WebAddress = "http://www.vendor" + x.ToString("00000") + ".com"; - // Address.Copy(c.GoToAddress, c.MailToAddress); - // c.AccountNumber = x.ToString(); - // if (!c.IsSavable) - // System.Diagnostics.Debugger.Break(); - // c.Save(); - //} - - //VendorPickList vendorMans = VendorPickList.GetList(VendorTypes.Manufacturer); - - ////Unitmodels - //for (int x = 0; x < 500; x++) - //{ - // UnitModel c = UnitModel.NewItem(); - // c.ModelNumber = x.ToString(); - // c.VendorID = vendorMans[rand.Next(vendorMans.Count)].ID; - // c.LifeTimeWarranty = true; - // c.Name = "UnitModel" + x.ToString("00000"); - // c.Save(); - //} - - //UnitModelPickList umpl= UnitModelPickList.GetList(); - - //ClientPickList cpl = ClientPickList.GetList(); - - //int nSerial=1; - //foreach (ClientPickList.ClientPickListInfo cp in cpl) - //{ - // Unit u = Unit.NewItem(); - // u.ClientID = cp.ID; - // u.UnitModelID = umpl[rand.Next(umpl.Count)].ID; - // u.Serial = nSerial.ToString(); - // u.Description="Unit" + nSerial.ToString(); - // nSerial++; - // u.Save(); - //} - - - - //Service Rates - // Rates rs = Rates.GetItems(false); - //for (int x = 0; x < 50; x++) - //{ - - // Rate r= rs.Add(); - // r.AccountNumber = "svc" + x.ToString(); - // r.Charge = 25.00m; - // r.Cost = 10.00m; - // r.Description = "Service Rate" + x.ToString(); - // r.Name = "SVCRATE " + x.ToString(); - // r.RateType = RateTypes.Service; - // rs.Save(); - - - //} - - //Travel Rates - //for (int x = 0; x < 50; x++) - //{ - - // Rate r = rs.Add(); - // r.AccountNumber = "trv" + x.ToString(); - // r.Charge = 25.00m; - // r.Cost = 10.00m; - // r.Description = "Travel Rate" + x.ToString(); - // r.Name = "TRVRATE " + x.ToString(); - // r.RateType = RateTypes.Travel; - // rs.Save(); - - - //} - - //UserPickList uplproj=UserPickList.GetList(false); - - //DateTime dtStart; - //DateTime dtStop; - ////Projects - - //for (int x = 0; x < 500; x++) - //{ - // dtStart = new DateTime(2000, 1, 1).AddDays(rand.Next(4380));//4380 days = 12 years - - // Project c = Project.NewItem(); - // c.AccountNumber = x.ToString(); - // c.DateStarted = dtStart; - // c.Name = "Project" + x.ToString(); - // c.ProjectOverseerID = uplproj[rand.Next(uplproj.Count)].ID; - - // c.Save(); - //} - - - //Workorders - // ClientPickList cpl = ClientPickList.GetList(); - // UserPickList upl = UserPickList.GetList(false); - // WorkorderStatusPickList wspl = WorkorderStatusPickList.GetList(); - // ProjectList projects = ProjectList.GetList(""); - // WorkorderCategories wocats = WorkorderCategories.GetItems(); - // PriorityPickList priors = PriorityPickList.GetList(); - // WorkorderItemTypePickList woitypes = WorkorderItemTypePickList.GetList(); - // RandomText text = new RandomText(); - // RatePickList rl= RatePickList.GetListAllActiveRates(); - // System.Collections.Generic.List serviceRates=new System.Collections.Generic.List(); - // System.Collections.Generic.List travelRates=new System.Collections.Generic.List(); - // PartPickList ppl=PartPickList.GetAllParts(); - // foreach(RatePickList.RatePickListInfo i in rl) - // { - // if(i.RateType== RateTypes.Service) - // serviceRates.Add(i.ID); - // else - // travelRates.Add(i.ID); - // } - // TaxCodeList tcl = TaxCodeList.GetList(); - - - // int nCount=1; - // for (int year = 2009; year < 2010; year++) - // for(int month=10;month < 13; month++) - // for (int day = 1; day < 29; day++) - // for(int hour=9;hour<18;hour++) - // { - // DateTime dtStart = new DateTime(year, month, day, hour, 0, 0); - - // DateTime dtStop = dtStart.AddHours(1); - - // Workorder w = Workorder.NewItem(WorkorderTypes.Service); - // w.ClientID = cpl[rand.Next(cpl.Count)].ID; - // w.WorkorderCategoryID = wocats[rand.Next(wocats.Count)].ID; - // w.WorkorderService.WorkorderStatusID = wspl[rand.Next(wspl.Count)].ID; - // w.ProjectID = projects[rand.Next(projects.Count)].LT_O_Project.Value; - // w.Summary = text.GetRandomSentence(5); - // w.WorkorderService.CloseByDate = dtStart.AddDays(1); - // w.WorkorderService.ServiceDate = dtStart; - // w.CustomerReferenceNumber = text.GetRandomSentence(1); - // w.InternalReferenceNumber = "Second run"+nCount.ToString(); - // w.Onsite = true; - - // WorkorderItem wi = w.WorkorderItems[0]; - // wi.Summary = text.GetRandomText(1, 1, 2, 3, 8); - // wi.TechNotes = text.GetRandomText(1, 1, 1, 3, 8); - // wi.PriorityID = priors[rand.Next(priors.Count)].ID; - // wi.TypeID = woitypes[rand.Next(woitypes.Count)].ID; - // wi.WorkorderStatusID = wspl[rand.Next(wspl.Count)].ID; - // wi.WarrantyService = rand.Next(101) > 50 ? true : false; - // wi.RequestDate = dtStart; - // //Unit? 20percent chance - // if (rand.Next(101) > 80) - // { - // wi.UnitID = UnitPickList.GetListByClient(w.ClientID)[0].ID; - // } - // //sched users 1 or as many as 4 - // int nMaxSchedUsers = rand.Next(1, 5); - // for (int nSchedUsers = 0; nSchedUsers < nMaxSchedUsers; nSchedUsers++) - // { - // WorkorderItemScheduledUser su = wi.ScheduledUsers.Add(wi); - // su.EstimatedQuantity = 1; - // su.UserID = upl[rand.Next(upl.Count)].ID; - // su.ServiceRateID = serviceRates[rand.Next(serviceRates.Count)]; - // su.StartDate = dtStart; - // su.StopDate = dtStop; - // } - - // //parts 0 to 5 - // int nMaxParts = rand.Next(0, 6); - // for (int nParts = 0; nParts < nMaxParts; nParts++) - // { - // WorkorderItemPart p = wi.Parts.Add(wi); - // p.PartID = ppl[rand.Next(ppl.Count)].ID; - // p.Quantity = rand.Next(1, 11); - // p.TaxPartSaleID = tcl[0].ID; - // p.Used = true; - // } - - // //Labor - // foreach (WorkorderItemScheduledUser scheduser in wi.ScheduledUsers) - // { - // w.CreateLaborFromScheduledUser(wi.ID, scheduser.ID); - // } - - // foreach (WorkorderItemLabor labor in wi.Labors) - // { - // labor.ServiceDetails=text.GetRandomText(2, 1, 4, 5, 15); - // } - - // //travel - // //travel 0 or as many as 4 - // int nMaxTravel = rand.Next(0, 5); - // for (int nTravel = 0; nTravel < nMaxTravel; nTravel++) - // { - // WorkorderItemTravel su = wi.Travels.Add(wi); - - // su.UserID = upl[rand.Next(upl.Count)].ID; - // su.TravelRateID = travelRates[rand.Next(travelRates.Count)]; - // su.TravelStartDate = dtStart; - // su.TravelStopDate = dtStop; - // su.TravelDetails = text.GetRandomSentence(5); - - // } - - // //closed? 20percent chance - // if (rand.Next(101) > 80) - // { - // w.ServiceCompleted = true; - // w.Closed = true; - // } - //System.Diagnostics.Debug.Assert(w.IsSavable); - - - // w.Save(); - // nCount++; - - - // } - - ////schedule markers - //RandomText text = new RandomText(); - //UserListScheduleable schedUserList = UserListScheduleable.GetList(); - //DateTime dt=new DateTime(2009,9,1); - //for (int x = 0; x < 1000; x++) - //{ - // ScheduleMarker sm = ScheduleMarker.NewItem(); - // sm.ARGB = rand.Next(0, 10000); - // sm.dtStartDate=dt.AddDays(rand.Next(120)).AddHours(rand.Next(8,18)); - // sm.dtStopDate = sm.dtStartDate.AddHours(1); - // sm.Name = text.GetRandomSentence(5); - // sm.Notes = text.GetRandomText(1, 1, 5, 3, 8); - // sm.ScheduleMarkerSourceType = ScheduleMarkerSourceTypes.User; - // sm.SourceID = schedUserList[rand.Next(schedUserList.Count)].ID; - // sm.Save(); - - //} - - - #endregion generate huge tracts o' data - - #region ayascript to update and close selected workorders - //System.Collections.Generic.List l= new System.Collections.Generic.List(); - // l.Add(new Guid("c9d07183-89d6-4dc0-bacb-e46a6c7a1b9a")); - // l.Add(new Guid("d3eea5a5-6181-4484-afc6-20279aa9670d")); - // l.Add(new Guid("06afffc4-5d6c-4e0d-bc44-de996a69f69d")); - // l.Add(new Guid("7da89c49-c94e-4d57-94ef-d25507e5e512")); - // l.Add(new Guid("83e1ed3e-f831-445f-b3cd-5caac218d383")); - - // //Reserve a place to store any errors during operation - // System.Text.StringBuilder sbErrors=new StringBuilder(); - - // foreach (Guid i in l) - // { - // //Fetch the workorder object from it's ID and do not place it in the most recently used object list (NoMRU) - // Workorder w = Workorder.GetItemNoMRU(i); - - // //Already closed? - // if (w.Closed) - // continue;//It's already closed so move on to next one - - // //If we're here it's not closed so let's close it.. - - // //SET WORKORDER STATUS - // //Note: There is no need to set the workorder status to the global settings automatical status on close - // //as that will be done automatically when you set it to closed=true below, however if for some reason you want to do it - // //anyway, it would be done here like this: - // w.WorkorderService.WorkorderStatusID = AyaBizUtils.GlobalSettings.WorkorderClosedStatus; - - // //First set it to service completed as that is a prerequisite to close it - // w.ServiceCompleted = true; - - // //Now close it. No need to set closed workorder status since it automatically will do it here - // w.Closed = true; - - // //Make sure there are no broken rules and it can be saved - // if (w.IsSavable) - // w.Save(); - // else - // { - // sbErrors.AppendLine("Workorder " + w.WorkorderService.ServiceNumber.ToString() + " is not saveable:"); - // sbErrors.AppendLine(w.BrokenRulesText); - // sbErrors.AppendLine("****************************************"); - // } - // } - - // //display errors if necessary - // if (sbErrors.Length > 0) - // { - // MessageBox.Show(sbErrors.ToString()); - // } - - // MessageBox.Show("Done!"); - - #endregion - - - #region ayascript to updated selected workorders - - - ////============== START OF SCRIPT ========================= - - - //string WorkorderNumberMustBeLessThanThis = "3025";//<--Set your maximum work order number to set closed here - - //WorkorderServiceList wsl = WorkorderServiceList.GetList(" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - //" \r\n" + - - //" "); - - ////Reserve a place to store any errors during operation - //System.Text.StringBuilder sbErrors = new StringBuilder(); - - ////WORKORDER STATUS TO SET ALL ITEMS AND WORKORDER - ////"Closed" status Id - //Guid workorderStatusIdToSet = new Guid("9E818C52-074D-441E-AB12-825BF8C126DD"); - - - //foreach (WorkorderServiceList.WorkorderServiceListInfo i in wsl) - //{ - - - // //placeholder to keep track of current workorder in case an error ensues - // string currentWorkorder = string.Empty; - // try - // { - - // //Fetch the workorder object from it's ID and do not place it in the most recently used object list (NoMRU) - // Workorder w = Workorder.GetItemNoMRU(i.LT_O_Workorder.Value); - - // //get the workorder number in case we need to report an error with it - // currentWorkorder = w.WorkorderService.ServiceNumber.ToString(); - - // //Already closed or service completed? - // if (w.Closed || w.ServiceCompleted) - // { - // //Scan the workorder and all items to see if it's already set correctly... - // bool alreadySetCorrectly = true; - - // //check the workorder header status - // if (w.WorkorderService.WorkorderStatusID == workorderStatusIdToSet) - // { - // //header matched so check all workorder item's status - // foreach (WorkorderItem wi in w.WorkorderItems) - // { - // if (wi.WorkorderStatusID != workorderStatusIdToSet) - // { - // //Status is not set correctly so no need to continue checking - // alreadySetCorrectly = false; - // break; - // } - // } - - // } - // else - // alreadySetCorrectly = false; - - // //Respond to the results of the workorder scan.. - - // if (alreadySetCorrectly) - // continue; //We got through the entire workorder and it's all correct so we can skip this one - // else - // { - // //something doesn't match so reopen the workorder and allow it to be set below - // w.Closed = false; - // w.ServiceCompleted = false; - // } - // } - - // //If we're here it needs status set and closed... - - // //SET WORKORDER AND ITEMS STATUS - // w.WorkorderService.WorkorderStatusID = workorderStatusIdToSet; - // foreach (WorkorderItem wi in w.WorkorderItems) - // wi.WorkorderStatusID = workorderStatusIdToSet; - - // //Set it to service completed as that is a prerequisite to close it - // w.ServiceCompleted = true; - - // //Now close it and save it - // w.Closed = true; - // w.Save(); - - // } - // catch (Exception ex) - // { - // sbErrors.AppendLine("Error processing workorder " + currentWorkorder); - // sbErrors.AppendLine(ex.Message); - // while (ex.InnerException != null) - // { - // ex = ex.InnerException; - // if (!string.IsNullOrWhiteSpace(ex.InnerException.Message)) - // sbErrors.AppendLine(ex.Message); - // } - // sbErrors.AppendLine("****************************************"); - // } - //} - - ////display errors if necessary - //if (sbErrors.Length > 0) - //{ - // MessageBox.Show(sbErrors.ToString()); - //} - - //MessageBox.Show("Done!"); - ////=============END OF SCRIPT =============== - - #endregion - - User u = User.GetItem(new Guid("619AAD67-B95E-4674-844B-5057EBE8AF05")); - - string srch = "" + - "" + - ""; - var v = WorkorderQuoteScheduledUserList.GetList(srch); - - - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - - - 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) { - // ____ ___ ___ ____ __ _ _ __ - //(_ _)( _)/ __)(_ _)( )( \( )/ _) - // )( ) _)\__ \ )( )( ) (( (/\ - // (__) (___)(___/ (__) (__)(_)\_)\__/ //ctrl-alt-g for GRID FILTER CRITERIA - #region RUN NOTIFICATIONS ON DEMAND - Status("Processing user notifications..."); - GenProcessDeliveries.DeliverNotifications(); - - Status("Processing client notifications..."); - GenProcessClientNotifications.DeliverNotifications(); - #endregion - - #region gen workorders COMMENTED OUT - - //============================================================================== - //Workorders - //Random rand=new Random(); - //ClientPickList cpl = ClientPickList.GetList(); - //UserPickList upl = UserPickList.GetList(false); - //WorkorderStatusPickList wspl = WorkorderStatusPickList.GetList(); - //ProjectList projects = ProjectList.GetList(""); - //WorkorderCategories wocats = WorkorderCategories.GetItems(); - //PriorityPickList priors = PriorityPickList.GetList(); - //WorkorderItemTypePickList woitypes = WorkorderItemTypePickList.GetList(); - //RandomText text = new RandomText(); - //RatePickList rl = RatePickList.GetListAllActiveRates(); - //System.Collections.Generic.List serviceRates = new System.Collections.Generic.List(); - //System.Collections.Generic.List travelRates = new System.Collections.Generic.List(); - //PartPickList ppl = PartPickList.GetAllParts(); - //foreach(RatePickList.RatePickListInfo i in rl) - //{ - // if(i.RateType == RateTypes.Service) - // serviceRates.Add(i.ID); - // else - // travelRates.Add(i.ID); - //} - //TaxCodeList tcl = TaxCodeList.GetList(); - - - //int nCount = 1; - ////for(int year = 2012; year < 2013; year++) - //// for(int month = 1; month < 13; month++) - //// for(int day = 1; day < 29; day++) - //// for(int hour = 9; hour < 18; hour++) - - - // for(int n=0;n<10001;n++) - // { - // int year = 2012; - // int month = rand.Next(1, 13); - // int day = rand.Next(1, 29); - // int hour = rand.Next(9, 18); - - // DateTime dtStart = new DateTime(year, month, day, hour, 0, 0); - - // DateTime dtStop = dtStart.AddHours(1); - - // Workorder w = Workorder.NewItem(WorkorderTypes.Service); - // w.ClientID = cpl[rand.Next(cpl.Count)].ID; - // w.WorkorderCategoryID = wocats[rand.Next(wocats.Count)].ID; - // w.WorkorderService.WorkorderStatusID = wspl[rand.Next(wspl.Count)].ID; - // w.ProjectID = projects[rand.Next(projects.Count)].LT_O_Project.Value; - // w.Summary = text.GetRandomSentence(5); - // w.WorkorderService.CloseByDate = dtStart.AddDays(1); - // w.WorkorderService.ServiceDate = dtStart; - // w.CustomerReferenceNumber = text.GetRandomSentence(1); - // w.InternalReferenceNumber = "Generated data " + nCount.ToString(); - // w.Onsite = true; - - // WorkorderItem wi = w.WorkorderItems[0]; - // wi.Summary = text.GetRandomText(1, 1, 2, 3, 8); - // wi.TechNotes = text.GetRandomText(1, 1, 1, 3, 8); - // wi.PriorityID = priors[rand.Next(priors.Count)].ID; - // wi.TypeID = woitypes[rand.Next(woitypes.Count)].ID; - // wi.WorkorderStatusID = wspl[rand.Next(wspl.Count)].ID; - // wi.WarrantyService = rand.Next(101) > 50 ? true : false; - // wi.RequestDate = dtStart; - // //Unit? 20percent chance - // //If the client has any units - // { - // UnitPickList clientUnitList = UnitPickList.GetListByClient(w.ClientID); - // if(clientUnitList.Count > 0 && rand.Next(101) > 80) - // { - // wi.UnitID = clientUnitList[0].ID; - // } - // } - - // //sched users 1 or as many as 4 - // int nMaxSchedUsers = rand.Next(1, 5); - // for(int nSchedUsers = 0; nSchedUsers < nMaxSchedUsers; nSchedUsers++) - // { - // WorkorderItemScheduledUser su = wi.ScheduledUsers.Add(wi); - // su.EstimatedQuantity = 1; - - // UserPickList.UserPickListInfo upi = upl[rand.Next(upl.Count)]; - // //ensure it's a scheduleable user - // while(upi.Type != UserTypes.Schedulable) - // upi = upl[rand.Next(upl.Count)]; - - // su.UserID = upi.ID; - // su.ServiceRateID = serviceRates[rand.Next(serviceRates.Count)]; - // su.StartDate = dtStart; - // su.StopDate = dtStop; - // } - - // //parts 0 to 5 - // //int nMaxParts = rand.Next(0, 6); - // //for(int nParts = 0; nParts < nMaxParts; nParts++) - // //{ - // // WorkorderItemPart p = wi.Parts.Add(wi); - - // // //get non serialized parts only for this action - // // p.PartID = ppl[rand.Next(ppl.Count)].ID; - - - // // p.Quantity = rand.Next(1, 11); - // // p.TaxPartSaleID = tcl[0].ID; - // // p.Used = true; - // //} - - // //Labor - // foreach(WorkorderItemScheduledUser scheduser in wi.ScheduledUsers) - // { - // w.CreateLaborFromScheduledUser(wi.ID, scheduser.ID); - // } - - // foreach(WorkorderItemLabor labor in wi.Labors) - // { - // labor.ServiceDetails = text.GetRandomText(2, 1, 4, 5, 15); - // } - - // //travel - // //travel 0 or as many as 4 - // int nMaxTravel = rand.Next(0, 5); - // for(int nTravel = 0; nTravel < nMaxTravel; nTravel++) - // { - // WorkorderItemTravel su = wi.Travels.Add(wi); - - // su.UserID = upl[rand.Next(upl.Count)].ID; - // su.TravelRateID = travelRates[rand.Next(travelRates.Count)]; - // su.TravelStartDate = dtStart; - // su.TravelStopDate = dtStop; - // su.TravelDetails = text.GetRandomSentence(5); - - // } - - // //closed? 80percent chance - // if(rand.Next(101) > 20) - // { - // w.ServiceCompleted = true; - // w.Closed = true; - // } - - - // if(!w.IsSavable) - // { - // CopyableMessageBox cm = new CopyableMessageBox(w.WhatsBroken); - // System.Diagnostics.Debugger.Break(); - // } - // w.Save(); - // nCount++; - - - // } - - //=============================================================================== - - #endregion - - #region Import utility COMMENTED OUT - - - ////============================================================================== - ////Lists to contain item Id's to compare to and ensure no duplicates imported - //System.Collections.Generic.Dictionary allUnits = new System.Collections.Generic.Dictionary(); - //System.Collections.Generic.Dictionary allUnitModels = new System.Collections.Generic.Dictionary(); - //System.Collections.Generic.Dictionary allClients = new System.Collections.Generic.Dictionary(); - //{ - // //Get lists of items that are already pre-entered in AyaNova and need to be matched by name - // ClientPickList clientList = ClientPickList.GetList(); - // UnitPickList unitList = UnitPickList.GetListOfAll(); - // UnitModelPickList unitModelList = UnitModelPickList.GetList(); - - // //Populate the lists from items already in the AyaNova database - // foreach(ClientPickList.ClientPickListInfo i in clientList) - // allClients.Add(i.Name.Trim(), i.ID); - - // foreach(UnitModelPickList.UnitModelPickListInfo i in unitModelList) - // allUnitModels.Add(i.Name.Trim(), i.ID); - - // foreach(UnitPickList.UnitPickListInfo i in unitList) - // allUnits.Add(i.Serial.Trim(), i.ID); - - // //free up the temporary list objects fetched - // clientList = null; - // unitList = null; - // unitModelList = null; - //} - - ////Read the data from the csv file "units.csv" located in c:\temp, change below to your file name and path as required - //string[] rawLines = System.IO.File.ReadAllLines(@"c:\temp\units.csv"); - - ////warning - //if(MessageBox.Show("Warning: There is no Undo, your AyaNova database will be changed permanently!\r\nBe *certain* you have a backup of your database before proceeding.\r\n\r\nAre you sure you want to continue?", "Import", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes) - // return false; - - ////hourglass cursor - //Cursor.Current = Cursors.WaitCursor; - - ////Iterate through the raw data, break it into fields and try to match with existing data and generate pm's accordingly - //long recordsImported = 0; - //bool firstRow = true; - //foreach(string rawItem in rawLines) - //{ - // //skip first row that has column names not actual data - // if(firstRow) - // { - // firstRow = false; - // continue; - // } - - // //split current row into fields - // string[] row = rawItem.Split(','); - // if(row.GetLength(0) != 10) - // throw new System.ApplicationException("Import failed (restore DB, fix problem and try again): Current import row doesn't have expected 10 fields. Row data:\r\n" + rawItem); - - // //##### Field 0 Unit Serial number ##### - // string sn = row[0].Trim(); - // if(string.IsNullOrWhiteSpace(sn)) - // throw new System.ApplicationException("Import failed (restore DB, fix problem and try again): Current import row doesn't have a serial number. Row data:\r\n" + rawItem); - - // //Has it already been imported? - // if(allUnits.ContainsKey(sn)) - // continue;//skip to the next record - - // //Not there already so import unit but first get a client id... - - // //##### Field 1 Client ##### - // string ClientName = row[1].Trim(); - // if(string.IsNullOrWhiteSpace(ClientName)) - // throw new System.ApplicationException("Import failed (restore DB, fix problem and try again): Current import row doesn't have a client. Row data:\r\n" + rawItem); - - // Guid ClientId = Guid.Empty; - // if(allClients.ContainsKey(ClientName)) - // ClientId = allClients[ClientName]; - - // if(ClientId == Guid.Empty) - // { - // //Create a new client - // Client c = Client.NewItem(); - // c.Name = ClientName; - // ClientId = c.ID; - // if(!c.IsSavable) - // throw new System.ApplicationException("Import failed (restore DB, fix problem and try again): Current import row Client record can not be saved. Row data:\r\n" + rawItem); - // c.Save(); - // //add to list so it won't try to import client again next time - // allClients.Add(ClientName, ClientId); - // } - - // //##### Field 2 UnitModel ##### - // Guid UnitModelId = Guid.Empty; - // string UnitModelName = row[2].Trim(); - - // //If unit model name is not empty then deal with it (Unitmodel is optional for a unit) - // if(!string.IsNullOrWhiteSpace(UnitModelName)) - // { - - // //see if we already have it - // if(allUnitModels.ContainsKey(UnitModelName)) - // UnitModelId = allUnitModels[UnitModelName]; - - // if(UnitModelId == Guid.Empty) - // { - // //Create a new UnitModel - // UnitModel c = UnitModel.NewItem(); - // c.Name = UnitModelName; - // UnitModelId = c.ID; - // if(!c.IsSavable) - // throw new System.ApplicationException("Import failed (restore DB, fix problem and try again): Current import row UnitModel record can not be saved. Row data:\r\n" + rawItem); - // c.Save(); - // allUnitModels.Add(UnitModelName, UnitModelId); - // } - // } - - - // //##### Field 3 Text1 ##### - // string text1 = row[3].Trim(); - - // //##### Field 4 PurchaseDate ##### - // string purchaseDate = row[4].Trim(); - // DateTime dtPurchaseDate = DateTime.MinValue;//MinValue means no date - // if(!string.IsNullOrWhiteSpace(purchaseDate)) - // { - // DateTime.TryParse(purchaseDate, out dtPurchaseDate); - // } - - // //##### Field 5 Description ##### - // string description = row[5].Trim(); - - // //##### Field 6 Receipt number ##### - // string receipt = row[6].Trim(); - - // //##### Field 7 Text2 ##### - // string text2 = row[7].Trim(); - - // //##### Field 8 Text3 ##### - // string text3 = row[8].Trim(); - - // //##### Field 9 Text4 ##### - // string text4 = row[9].Trim(); - - - // //Import the unit now that we have all the info required - // Unit u = Unit.NewItem(); - // u.ClientID = ClientId; - // u.UnitModelID = UnitModelId; - // u.Serial = sn; - // u.Text1 = text1; - - // if(dtPurchaseDate != DateTime.MinValue) - // u.PurchasedDate = dtPurchaseDate; - // u.Text2 = text2; - // u.Description = description; - // u.Receipt = receipt; - // u.Text2 = text2; - // u.Text3 = text3; - // u.Text4 = text4; - // Guid unitId = u.ID; - // u.Save(); - // allUnits.Add(sn, unitId); - // recordsImported++; - //} - //Cursor.Current = Cursors.Default; - //MessageBox.Show("Finished importing " + recordsImported.ToString() + " records"); - ////Done. - ////=============================================================================== - - - - #endregion import util - - #region Close selected workorders by criteria COMMENTED OUT - - ////**** CLOSE SELECTED WORKORDERS THAT MATCH THE FOLLOWING ****** - ////Change these values as required - //string WorkorderStatusName = "Service is Completed"; - //string ClientName = "ABC Accounting"; - ////************************************************************** - - ////No need to change anything below here if different status or client in future - - ////Reserve a place to store any errors during operation - //System.Text.StringBuilder sbErrors = new StringBuilder(); - - ////GET THE STATUS ID - ////placeholder for status once it's found - //Guid workorderStatusId = Guid.Empty; - - //WorkorderStatusPickList wospl = WorkorderStatusPickList.GetList(); - //try - //{ - // //try to fetch the status by name and get the Id from it - // workorderStatusId = wospl[WorkorderStatusName].ID; - //} - //catch - //{ - // sbErrors.AppendLine("Status of \"" + WorkorderStatusName + "\" was not found in the database, can't proceed!"); - //} - - - ////GET THE CLIENT ID - ////placeholder for client Id once it's found - //Guid clientId = Guid.Empty; - - //ClientPickList cpl = ClientPickList.GetList(); - //foreach (ClientPickList.ClientPickListInfo i in cpl) - //{ - // if (i.Name.Equals(ClientName)) - // { - // clientId = i.ID; - // break; - // } - //} - - //if (clientId == Guid.Empty) - // sbErrors.AppendLine("Client called \"" + ClientName + "\" was not found in the database, can't proceed!"); - - ////counter of successfully closed and saved workorders - //long workordersClosed = 0; - - ////do we have a status and client Id? - //if (workorderStatusId != Guid.Empty && clientId != Guid.Empty) - //{ - // //Yup, so continue... - - // //GET APPLICABLE WORKORDERS VIA WORKORDER SERVICE LIST AND CRITERIA - // WorkorderServiceList wsl = WorkorderServiceList.GetList(" \r\n" + - // " \r\n" + - // " \r\n" + - // " \r\n" + - // " \r\n" + - // " \r\n" + - // " \r\n" + - - // " \r\n" + - // " \r\n" + //belongs to client specified - // " \r\n" + - // " \r\n" + - // " \r\n" + //has status specified - // " \r\n" + - // " \r\n" + - // " \r\n" + //is service completed - // " \r\n" + - // " \r\n" + - // " \r\n" + //is not closed - // " \r\n" + - // " " ); - - - // //Iterate the resulting list and close accordingly - // foreach (WorkorderServiceList.WorkorderServiceListInfo i in wsl) - // { - // //placeholder to keep track of current workorder number - // //in case an error ensues and we have to report it later - // string currentWorkorderNumber = string.Empty; - - // try - // { - // //Fetch the workorder object from it's ID and do not place it in the most recently used object list (NoMRU) - // Workorder w = Workorder.GetItemNoMRU(i.LT_O_Workorder.Value); - - // //get the workorder number in case we need to report an error with it - // currentWorkorderNumber = w.WorkorderService.ServiceNumber.ToString(); - - // //try to close it - // if (w.IsCloseAllowed) - // { - // w.Closed = true; - // if (w.IsSavable) - // { - // w.Save(); - // workordersClosed++; - // } - // else - // sbErrors.AppendLine("Error processing workorder " + currentWorkorderNumber + " not saveable for some reason."); - // } - // else - // { - // sbErrors.AppendLine("Error processing workorder " + currentWorkorderNumber + " not closeable for some reason."); - // } - // } - // catch (Exception ex) - // { - // //Save failed for some reason so report it... - // sbErrors.AppendLine("Error processing workorder " + currentWorkorderNumber); - // sbErrors.AppendLine(ex.Message); - // while (ex.InnerException != null) - // { - // ex = ex.InnerException; - // if (!string.IsNullOrWhiteSpace(ex.InnerException.Message)) - // sbErrors.AppendLine(ex.Message); - // } - // sbErrors.AppendLine("****************************************"); - // } - // } - //} - - ////display errors if necessary - //if (sbErrors.Length > 0) - //{ - // MessageBox.Show(sbErrors.ToString()); - //} - - //MessageBox.Show("Finished, " + workordersClosed.ToString() + " workorders were closed and saved"); - #endregion - - #region Generator on demand COMMENTED OUT - //try - //{ - // AyaBizUtils.TG = true; - - // Cursor.Current = Cursors.WaitCursor; - // Status("Processing PM workorders..."); - // GenProcessPM.GeneratePMWorkorders(); - - - //} - //catch - //{ - - // throw; - //} - //finally - //{ - // AyaBizUtils.TG = false; - //} - #endregion generator on demand - - #region Generate serialized inventory for a single part COMMENTED OUT - //Random rand = new Random(); - //int snCount = 0; - ////get all active warehouses without exception - //PartWarehousePickList whsList = PartWarehousePickList.GetActiveOnlyListWithExceptions(new System.Collections.Generic.List()); - - //for (int x = 0; x < 500; x++) - //{ - // PartInventoryAdjustment p = PartInventoryAdjustment.NewItem(); - // p.DateAdjusted = DateTime.Now; - // p.ReasonForAdjustment = "coding test"; - // PartInventoryAdjustmentItem i = p.Items.Add(p); - // //HUB - // i.PartID = new Guid("A54B1C5D-8EF7-43AB-A35C-C9FE2A875A46"); - // i.PartWarehouseID = whsList[rand.Next(whsList.Count)].ID; - // i.QuantityAdjustment = 1; - // snCount++; - // PartSerial ps = i.SerialNumbers[0]; - // ps.PartID = i.PartID; - // ps.PartWarehouseID = i.PartWarehouseID; - // ps.SerialNumber = "TESTSN_" + snCount.ToString(); - - // if (p.IsSavable) - // p.Save(); - // else - // { - // MessageBox.Show("Error with item " + snCount.ToString() + "\r\n" + p.BrokenRulesText); - // System.Diagnostics.Debugger.Break(); - // break; - // } - //} - - #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 ========================= - //a2a2632b-8945-4d93-8513-2ee65c91adc3 - - /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - //Workorder.GetDescendant( - //try - //{ - // //*********** This is the only block you really need ******* - // PartList pl = PartList.GetListForSingleItem(new Guid("a2a2632b-8945-4d93-8513-2ee65c91adc3"));//my test part id - // PartList.PartListInfo pli = pl[0]; - // string sTheManufaturerName = pli.LT_Part_Label_ManufacturerID.Display; - // string sTheManufacturerNumber = pli.LT_Part_Label_ManufacturerNumber; - // string sTheWholeSalerName = pli.LT_Part_Label_WholesalerID.Display; - // string sTheWholeSalerNumber = pli.LT_Part_Label_WholesalerNumber; - // //*************** But the outer try catch will give you the actual error if you need it **** - //} - //catch (Exception ex) { - // Exception ActualException = null; - // while (ActualException.InnerException != null) - // ActualException = ActualException.InnerException; - // string ActualErrorMessage = ActualException.Message; - //} - //var vvvv = "blah"; - ////etc - - - //=============END OF SCRIPT =============== - - - //END OF TESTING diff --git a/source/bizobjects/AyaLib/AssemblyInfo.cs b/source/bizobjects/AyaLib/AssemblyInfo.cs index 5cc0f97..1aecd84 100644 --- a/source/bizobjects/AyaLib/AssemblyInfo.cs +++ b/source/bizobjects/AyaLib/AssemblyInfo.cs @@ -64,4 +64,4 @@ using System.Security.Permissions; // Configure log4net using the .config file //[assembly: log4net.Config.XmlConfigurator(ConfigFile="Log4Net.config",Watch=true)] //[assembly: log4net.Config.XmlConfigurator( ConfigFile="Log4Net.config",Watch=true )] -[assembly: AssemblyFileVersionAttribute("7.6.15.0")] +[assembly: AssemblyFileVersionAttribute("7.6.16.0")] diff --git a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/AyaBizUtils.cs b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/AyaBizUtils.cs index efb628e..f655d6d 100644 --- a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/AyaBizUtils.cs +++ b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/AyaBizUtils.cs @@ -840,7 +840,7 @@ namespace GZTW.AyaNova.BLL //sent key then asked to cancel case "1496793532": #endregion - + #region Case 3517 // "RegisteredTo": "The Underground Sprinkler Co" //sent key then asked to cancel - VERY SKETCHY CUSTOMER @@ -969,7 +969,7 @@ namespace GZTW.AyaNova.BLL //SHA256 shaM = new SHA256Managed(); //UTF8Encoding enc = new UTF8Encoding(); //string shash = BitConverter.ToString(shaM.ComputeHash(enc.GetBytes(schema))).Replace("-", ""); - if (nSchemaCount != 1406) + if (nSchemaCount != 1406) { //case 1142, apparently if it's sql2000 they can get this as well so adjusting error message @@ -1013,7 +1013,7 @@ namespace GZTW.AyaNova.BLL #endregion #region Validate subscription allows this build date of biz object library - + // if the subscription has expired and it was built after the subsription expired //then throw the exception if ((GlobalX.SubscriptionExpired && (Timestamp.BuildAt > ExpiryDate))) @@ -1345,7 +1345,7 @@ namespace GZTW.AyaNova.BLL } - + /// /// downloaded trial expired @@ -1579,7 +1579,7 @@ namespace GZTW.AyaNova.BLL // return ""; //} - + //case 2094 /// /// Get subscription expiry date for plugin @@ -2565,8 +2565,8 @@ namespace GZTW.AyaNova.BLL #if(DEBUG) throw new System.ArgumentException("AyaBizUtils->GetSearchResultFor: " + RootObjectType.ToString() + " IS NOT IMPLEMENTED"); #else - //case 1116 - return new SearchResult(); + //case 1116 + return new SearchResult(); #endif } @@ -2639,7 +2639,7 @@ namespace GZTW.AyaNova.BLL #else //In a release build only order by first 4 columns for performance //anything more is pretty much redundant 99.9% of the time - if(nSortColumnsAddedToCriteria>4) break; + if (nSortColumnsAddedToCriteria > 4) break; #endif sCurrentColumnName = TabRow["CM"].ToString(); @@ -2686,7 +2686,7 @@ namespace GZTW.AyaNova.BLL //case 3603 #if (DEBUG) throw; -#else +#else return ""; #endif } @@ -2816,7 +2816,7 @@ namespace GZTW.AyaNova.BLL //case 3603 #if (DEBUG) throw; -#else +#else return ""; #endif } @@ -4497,13 +4497,30 @@ namespace GZTW.AyaNova.BLL int startIndex = s.IndexOf(openTag); if (startIndex == -1) throw new System.IndexOutOfRangeException("ExtractString->Error: open tag not found"); - startIndex+=openTag.Length; + startIndex += openTag.Length; int endIndex = s.IndexOf(closeTag, startIndex); - if(endIndex==-1) + if (endIndex == -1) throw new System.IndexOutOfRangeException("ExtractString->Error: closing tag not found"); return s.Substring(startIndex, endIndex - startIndex); } + + + + + + + /// + /// Replace bare linefeeds issue case 4180 + /// + /// + /// string with any bare \n replaced with \r\n + public static string ReplaceBareLineFeeds(string s) + { + //the string may and probably does already have \r\n in addition to bare line feeds + //so replace those with bare linefeeds so it's *all* bare linefeeds then fix up + return s.Replace("\r\n", "\n").Replace("\n", "\r\n"); + } #endregion misc string helpers #region Regular expressions diff --git a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenProcessClientNotifications.cs b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenProcessClientNotifications.cs index 4fe7a4e..9c1425a 100644 --- a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenProcessClientNotifications.cs +++ b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenProcessClientNotifications.cs @@ -89,7 +89,7 @@ namespace GZTW.AyaNova.BLL //email.SetFromMimeText(n.GetContentAsString); email.Mailer = "AyaNova service management software licensed to " + AyaBizUtils.REGTO; - email.Body = sMessageFields[1]; + email.Body = AyaBizUtils.ReplaceBareLineFeeds(sMessageFields[1]);//case 4180 email.Subject = sMessageFields[2]; //case 1601 diff --git a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenProcessDeliveries.cs b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenProcessDeliveries.cs index 449552c..b3755e4 100644 --- a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenProcessDeliveries.cs +++ b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenProcessDeliveries.cs @@ -85,7 +85,8 @@ namespace GZTW.AyaNova.BLL sms.Login=GZTW.AyaNova.BLL.AyaBizUtils.GlobalSettings.NotifySMTPAccount; sms.Password=GZTW.AyaNova.BLL.AyaBizUtils.GlobalSettings.NotifySMTPPassword; - sms.Message=info.Message; + + sms.Message=AyaBizUtils.ReplaceBareLineFeeds(info.Message);//case 4180 sms.Subject="";//info.Subject; sms.ToAddress=info.Address; sms.Deliver(); diff --git a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenSMSMessageDelivery.cs b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenSMSMessageDelivery.cs index 07961d2..195c2f3 100644 --- a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenSMSMessageDelivery.cs +++ b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenSMSMessageDelivery.cs @@ -47,7 +47,7 @@ namespace GZTW.AyaNova.BLL // Create a simple email. Chilkat.Email email = new Chilkat.Email(); - email.Body = Message; + email.Body = AyaBizUtils.ReplaceBareLineFeeds(Message);//case 4180 email.Subject = Subject; //case 1601 diff --git a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenSMTPMessageDelivery.cs b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenSMTPMessageDelivery.cs index c0fbda0..aa0b5fe 100644 --- a/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenSMTPMessageDelivery.cs +++ b/source/bizobjects/AyaLib/GZTW.AyaNova.BLL/GenSMTPMessageDelivery.cs @@ -43,7 +43,7 @@ namespace GZTW.AyaNova.BLL // Create a simple email. Chilkat.Email email = new Chilkat.Email(); - email.Body = Message; + email.Body = AyaBizUtils.ReplaceBareLineFeeds(Message);//case 4180 email.Subject = Subject; //case 1601