Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            SchedulerBox.Clear();
            List <Scheduler> SchList = new List <Scheduler>();

            try
            {
                int ID = int.Parse(MovieTextBox.Text);
                SchList = client.GetSchedulerListByMovieID(ID).ToList();
                if (0 < SchList.Count())
                {
                    string copier = "-----------------------------------------\n";
                    foreach (Scheduler sch in SchList)
                    {
                        copier += " ID: " + sch.SchID + "\n Date: " + sch.Date + "\n Time: " + sch.Starttime + "\n Hall: " + sch.HallID;
                        copier += "\n -----------------------------------\n";
                    }
                    SchedulerBox.AppendText(copier);
                }
                else
                {
                    SchedulerBox.AppendText("There are no Schedulers witht that movie");
                }
            }
            catch (Exception i)
            {
                SchedulerBox.AppendText("Something went wrong\n" + i);
            }
        }
Пример #2
0
 private void button9_Click(object sender, EventArgs e)
 {
     SchViewBox.Clear();
     try
     {
         DateTime         date = Convert.ToDateTime(DateSearchBox.Text);
         List <Scheduler> list = client.GetSchListByDate(date).ToList();
         System.Console.WriteLine("movien er " + list.First().MovieID);
         if (list.Count > 0)
         {
             string copier = "-----------------------------------------\n";
             foreach (Scheduler sch in list)
             {
                 copier += " ID: " + sch.SchID + "\n Date: " + sch.Date + "\n Time: " + sch.Starttime + "\n Hall: " + sch.HallID;
                 copier += "\n -----------------------------------\n";
             }
             SchViewBox.AppendText(copier);
         }
         else
         {
             SchedulerBox.AppendText("There are no Schedulers for that date");
         }
     }
     catch
     {
         SchViewBox.AppendText("Something went wrong");
     }
 }