示例#1
0
        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);
                }
            }
        }
示例#2
0
        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!");
            }
        }
示例#3
0
         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





        }
示例#4
0
        // 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));
        }
示例#5
0
        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);
        }
示例#6
0
 public void SetLegalAgeDate(int intYears)
 {
     LegalAgeDate = TodaysDate.AddYears(-1 * intYears);
 }
示例#7
0
 public void StartDay()
 {
     TodaysDate.Increment();
     TodaysWeather = Location.GenerateWeather();
 }