public DissociateTokenTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public GetFileContentTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public SystemRestoreFileTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public SubscribeTopicTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public CreateNewTxIdTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public GetAddressBookTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public GetNetworkVersionInformationTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public IActionResult SendExpirationStatusEmail() { if (!_context.ChemicalFamily.Any() || !_context.Users.Any()) { return(BadRequest()); } var todayDateShort = DateTime.Now.ToShortDateString(); var todayDate = DateTime.Parse(todayDateShort); var dayOfWeek = (int)todayDate.DayOfWeek; var allChemicals = _context.Chemicals.ToList(); var chemicalsExpire = allChemicals .Where(x => (x.ExpirationDate - todayDate).TotalDays <= 1 || DateTime.Compare(x.ExpirationDate, todayDate) <= 0) .OrderByDescending(x => x.ExpirationDate) .ToList(); //change 30 as needed, maybe by user setting var chemicalsSoon = allChemicals .Where(x => (x.ExpirationDate - todayDate).TotalDays >= 2) .Where(x => (x.ExpirationDate - todayDate).TotalDays < 30) .OrderBy(x => x.ExpirationDate) .ToList(); var users = _context.Users.Where(x => x.Notifications == true).ToList(); var emailToList = new List <User>(); if (chemicalsExpire.Count == 0 && chemicalsSoon.Count == 0) { return(NoContent()); } foreach (var user in users) { if (user.Frequency == Enum.GetName(typeof(frequencyOfEmail), frequencyOfEmail.Daily)) { emailToList.Add(user); } else if (user.Frequency == Enum.GetName(typeof(frequencyOfEmail), frequencyOfEmail.Weekly)) { if (dayOfWeek == 1) { emailToList.Add(user); } } else if (user.Frequency == Enum.GetName(typeof(frequencyOfEmail), frequencyOfEmail.Monthly)) { if ((dayOfWeek == 1 && todayDate.Day <= 7) || (todayDate.Day == 1 && dayOfWeek <= 5)) { emailToList.Add(user); } } } if (emailToList.Count == 0) { return(NoContent()); } var sbExpired = new StringBuilder(); if (chemicalsExpire.Count > 0) { sbExpired.AppendLine("The following are the chemical(s) that are expired or will expire in the next day:<br /><ul>"); foreach (var chemical in chemicalsExpire) { var lineText = "<li> " + chemical.ChemicalName + " with Barcode " + chemical.Barcode.ToString() + " expires on " + chemical.ExpirationDate.ToShortDateString(); if (chemical.Location != null && !string.IsNullOrEmpty(chemical.Location)) { lineText += " found in " + chemical.Location; } lineText += "</li><br />"; sbExpired.AppendLine(lineText); } sbExpired.Append("</ul><br />"); } var sbSoon = new StringBuilder(); if (chemicalsSoon.Count > 0) { sbSoon.AppendLine("The following are the chemical(s) that will expire in the next 2-30 days:<br /><ul>"); foreach (var chemical in chemicalsSoon) { var lineText = "<li>" + chemical.ChemicalName + " (Barcode: " + chemical.Barcode.ToString() + ") expires on " + chemical.ExpirationDate.ToShortDateString(); if (chemical.Location != null && !string.IsNullOrEmpty(chemical.Location)) { lineText += " found in " + chemical.Location; } lineText += "</li><br />"; sbSoon.AppendLine(lineText); } sbSoon.Append("</ul><br />"); } var emailMessageBody = "This is an automated message regarding chemical expiration status. <br /><br />"; emailMessageBody += chemicalsExpire.Count > 0 ? sbExpired.ToString() : ""; emailMessageBody += chemicalsSoon.Count > 0 ? sbSoon.ToString() : ""; SmtpClient client = new SmtpClient(); client.Host = "smtp.googlemail.com"; client.Port = 587; client.UseDefaultCredentials = false; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.EnableSsl = true; var emailer = new NetworkCredentials(); client.Credentials = new NetworkCredential(emailer.NetworkUserEmail, emailer.NetworkUserPassword); var msg = new MailMessage(); msg.IsBodyHtml = true; msg.From = new MailAddress(emailer.NetworkUserEmail); foreach (var to in emailToList) { msg.To.Add(new MailAddress(to.Email)); } msg.Subject = "FlowBase Notification: Expiration Status"; msg.Body = emailMessageBody; client.Send(msg); return(Ok(emailToList)); }
public DeleteCryptoAccountTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public GetRecordTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public SubmiLargeMessageTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public UnsafeSubmitTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public ContractBytecodeTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public GetFeeScheduleInfoTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public SuspendNetworkTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public TimeDriftTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public AddClaimTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public IActionResult SendReorderEmail() { if (!_context.ChemicalFamily.Any() || !_context.Users.Any()) { return(BadRequest()); } var todayDateShort = DateTime.Now.ToShortDateString(); var todayDate = DateTime.Parse(todayDateShort); var dayOfWeek = (int)todayDate.DayOfWeek; var allChemicals = _context.Chemicals.ToList(); var users = _context.Users.Where(x => x.Notifications == true).ToList(); if (users.Count == 0) { return(NoContent()); } var emailToList = new List <User>(); foreach (var user in users) { if (user.Frequency == Enum.GetName(typeof(frequencyOfEmail), frequencyOfEmail.Daily)) { emailToList.Add(user); } else if (user.Frequency == Enum.GetName(typeof(frequencyOfEmail), frequencyOfEmail.Weekly)) { if (dayOfWeek == 1) { emailToList.Add(user); } } else if (user.Frequency == Enum.GetName(typeof(frequencyOfEmail), frequencyOfEmail.Monthly)) { if ((dayOfWeek == 1 && todayDate.Day <= 7) || (todayDate.Day == 1 && dayOfWeek <= 5)) { emailToList.Add(user); } } } if (emailToList.Count == 0) { return(NoContent()); } var reorderChemicals = _context.ChemicalFamily.Where(x => x.Quantity <= x.reorderThreshold && x.reorderThreshold != -1).OrderBy(x => x.reorderThreshold).ToList(); if (reorderChemicals.Count == 0) { return(NoContent()); } var sbReorder = new StringBuilder(); if (reorderChemicals.Count > 0) { sbReorder.AppendLine("The following are the chemical(s) that need to be reordered:<br /><ul>"); foreach (var chemical in reorderChemicals) { var lineText = "<li> " + chemical.ChemicalName + " (Current Quantity: " + chemical.Quantity.ToString() + ") needs an order of " + chemical.ReorderQuantity; lineText += "</li><br />"; sbReorder.AppendLine(lineText); } sbReorder.Append("</ul><br />"); } var emailMessageBody = "This is an automated message regarding chemical reorder status. <br /><br />"; emailMessageBody += reorderChemicals.Count > 0 ? sbReorder.ToString() : ""; SmtpClient client = new SmtpClient(); client.Host = "smtp.googlemail.com"; client.Port = 587; client.UseDefaultCredentials = false; client.DeliveryMethod = SmtpDeliveryMethod.Network; client.EnableSsl = true; var emailer = new NetworkCredentials(); client.Credentials = new NetworkCredential(emailer.NetworkUserEmail, emailer.NetworkUserPassword); var msg = new MailMessage(); msg.IsBodyHtml = true; msg.From = new MailAddress(emailer.NetworkUserEmail); foreach (var to in emailToList) { msg.To.Add(new MailAddress(to.Email)); } msg.Subject = "FlowBase Notification: Reorder Status"; msg.Body = emailMessageBody; client.Send(msg); return(Ok(emailToList)); }
public EventEmittingContractTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public GetAssetInfoTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public UpdateAccountTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public GetPendingTransactionInfoTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public TransferTokenTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public ConfiscateAssetTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public SignatureTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
private void MainForm_Load(object sender, EventArgs e) { NetworkCredentials.Instance().NetworkDomain = Properties.Settings.Default.networkdomain; NetworkCredentials.Instance().NetworkUsername = Properties.Settings.Default.networkusername; NetworkCredentials.Instance().NetworkPassord = Properties.Settings.Default.networkpassword; //NetworkFileSystemUtilsProxy p = new NetworkFileSystemUtilsProxy(); //p.UncFileExist(@"\\DESKTOP-E9KNOCC\ciccio\ciccio.txt"); //initialize skinning properties barManager.ForceInitialize(); MyBarLocalizer.Active = new MyBarLocalizer(); SkinHelper.InitSkinPopupMenu(mPaintStyle); //initialize navigator _navUtil = new NavigationUtils(splitContainerControl.Panel2, this); //renders startup controls if (_customerId == "") { _navUtil.NavigateToStartupControl(Properties.Settings.Default.Main_StartCommand); } else { try { IOpenCommand cmd = new CustomerCommand(this); Hashtable h = new Hashtable(); h.Add("Id", _customerId); cmd.Execute(h); HistoryOfCommands.Instance().AddCommandToHistory(cmd); MemoryHelper.ReduceMemory(); } catch (Exception ex) { ErrorHandler.Show(ex); _navUtil.NavigateToStartupControl(Properties.Settings.Default.Main_StartCommand); } } //sets the caption text this.Text = "Gestionale appuntamenti - " + Properties.Settings.Default.Main_AppName; //sets the name of the current logged user string nome = ((User)(SecurityManager.Instance.CurrentUser)).Username; sItem.Caption = string.Format("Benvenuto: {0}!", nome); if (DataAccessServices.Instance().PersistenceFacade.DBType == DB.DBType.Access) { // barRipristina.Visibility = BarItemVisibility.Always;ù barButtonbackup.Visibility = BarItemVisibility.Always; UpdateLastBackInfo(); barBack.Visibility = BarItemVisibility.Always; } else { //barRipristina.Visibility = BarItemVisibility.Never; barButtonbackup.Visibility = BarItemVisibility.Never; barBack.Visibility = BarItemVisibility.Never; } //sets initial view splitContainerControl.Collapsed = Properties.Settings.Default.Main_PanelCollapsed; administration.Visible = !Properties.Settings.Default.Main_ShowOnlyAgendaFunctions; }
public GetAccountBalanceTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public GetExchangeRatesTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public CreateContractTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
public DeleteFileTests(NetworkCredentials network, ITestOutputHelper output) { _network = network; _network.Output = output; }
WebClient GetClient () { if (OAuthTokenSecret != null) return new WebClient (); return null; #if false // In the future, for connecting to non-OAuth twitter sites else return new AuthenticatedWebClient () { Credentials = new NetworkCredentials (login, pass); } #endif }