public void Execute(HowLeakyInputsModel inputs, Action <HowLeakyOutputs> onCompletion, Action <Exception> onError) { try { if (LoadInputs(inputs)) { PrepareForNewSimulation(); while (TodaysDate.DateInt <= EndDate.DateInt) { SimulateDay(); TodaysDate.IncrementDay(); } onCompletion(Outputs); } else { if (onError != null) { onError(new Exception("Could not load inputs")); } } } catch (Exception ex) { if (onError != null) { onError(ex); } } }
public async Task FirstCurrentSongsDatabase() { try { HttpResponseMessage deleteHttpResponse = await HttpClientServer.DeleteAsync("api/CurrentSongs"); if (deleteHttpResponse.IsSuccessStatusCode) { } else { ServerStatus = "Server fail, try again!"; MessageBox.Show("Server fail, try again!"); } TodaysDate = DateTime.Now; TodaysDate = TodaysDate.AddHours(-8); string dateString = TodaysDate.ToString("yyyy-MM-dd"); string historyPath = VdjDirectory + "\\History\\"; SongHistoryPath = historyPath + dateString + ".m3u"; bool checkIfOldSongPlayed = System.IO.File.Exists(SongHistoryPath); if (checkIfOldSongPlayed == true) { System.IO.File.Delete(SongHistoryPath); } } catch { IsServerStartButtonEnabled = true; ServerStatus = "Server fail, try again!"; MessageBox.Show("Server fail, try again!"); } }
public static void Main(string[] args) { // Create UserInputName UserInputName = newUserInput.Name; UserBookName UserBookName = newBook.Name; GenreName GenreName = newGenre.Name; TimeItTook TimeItTook = newTimeItTook; TodaysDate TodaysDate = newTodaysDate; Console.WriteLine("What is your Name?"); Console.ReadLine(); Console.WriteLine("What is your favorite book?"); Console.ReadLine(); Console.WriteLine("What genre is this book?); Console.ReadLine(); Console.WriteLine("How long did it take you to read this book?") Console.ReadLine(); Console.WriteLine("What is today's Date?"); Console.ReadLine(); // Update }
// GET: HistoFeed public ActionResult Index() { var Today = new TodaysDate { TDay = DateTime.Now.Day, TMonth = DateTime.Now.ToString("MMMM"), TYear = DateTime.Now.Year }; return(View(Today)); }
void pdoc_PrintPage(object sender, PrintPageEventArgs e) { Graphics graphics = e.Graphics; Font font = new Font("Georgia", 8); Font fontBold = new Font("Georgia", 8, FontStyle.Bold); Pen boldPen = new Pen(Color.Black, 3); Pen lightPen = new Pen(Color.Black, 1); float fontHeight = font.GetHeight(); int startX = 3; int startY = 2; int Offset = 5; string RestaurantName = ConfigurationManager.AppSettings["RestaurantName"]; graphics.DrawString(RestaurantName, new Font("Courier New", 13, FontStyle.Bold), new SolidBrush(Color.Black), startX, startY + Offset); graphics.DrawString(TodaysDate.ToShortDateString() + TodaysDate.ToShortTimeString(), font, new SolidBrush(Color.Black), startX + 180, startY + Offset); Offset = Offset + 30; //Total graphics.DrawString(string.Format("Order Total : {0}", OrderTotal), font, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 20; graphics.DrawString(string.Format("Denominator Total : {0}", DenominatorTotl), font, new SolidBrush(Color.Black), startX, startY + Offset); Offset = Offset + 20; graphics.DrawString(string.Format("Difference : {0}", Difference), font, new SolidBrush(Color.Black), startX, startY + Offset); }
public void SetLegalAgeDate(int intYears) { LegalAgeDate = TodaysDate.AddYears(-1 * intYears); }
public void StartDay() { TodaysDate.Increment(); TodaysWeather = Location.GenerateWeather(); }