Пример #1
0
        private void LoadAsstList()
        {
            ListCourse course = (ListCourse)lstCourses.SelectedItem;

            Assignment[] assts;
            try {
                assts = m_cds.GetAssignments(course.Course.ID);
            } catch (Exception er) {
                MessageBox.Show("Error: " + er.Message, "Error connecting to FrontDesk",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            lstAssts.BeginUpdate();
            lstAssts.Items.Clear();
            foreach (Assignment asst in assts)
            {
                lstAssts.Items.Add(new ListAsst(asst));
            }
            lstAssts.EndUpdate();

            if (lstAssts.Items.Count == 0)
            {
                Wizard.SetWizardButtons(WizardButton.Back);
            }
            else
            {
                Wizard.SetWizardButtons(WizardButton.Back | WizardButton.Next);
                lstAssts.SelectedIndex = 0;
            }
        }
Пример #2
0
        private void DataInvest(string nameInvest)
        {
            Graph graph = new Graph();

            NameInvest = nameInvest;
            graph.TakeData(NameInvest);
            CurrentCourse = graph.CurrentCourse;
            ListCourse.AddRange(graph.ListCourse);
        }
Пример #3
0
 private decimal Stock(string linkGraph)
 {
     ClearLists();
     foreach (Match match in Regex.Matches(TakeHtml(linkGraph), @";\d+.n(.*?);(.*?);"))
     {
         DateTime dateTime = new DateTime(1970, 1, 1).AddSeconds(Convert.ToInt32(match.Groups[1].Value));
         ListTimeCourse.Add(dateTime);
         CurrentCourse = Convert.ToDecimal(match.Groups[2].Value.Replace(".", ","));
         ListCourse.Add(Convert.ToDouble(CurrentCourse));
     }
     return(CurrentCourse);
 }
Пример #4
0
 private decimal Crypto(string linkGraph)
 {
     ClearLists();
     foreach (Match match in Regex.Matches(TakeHtml(linkGraph), @".new Date.'(.*?)'., (.*?)]"))
     {
         DateTime dateTime = DateTime.ParseExact(match.Groups[1].Value, "yyyy-M-dd HH:mm:ss.fff", null);
         ListTimeCourse.Add(dateTime);
         ListCourse.Add(Convert.ToDouble(match.Groups[2].Value.Replace(".", ",")));
         CurrentCourse = Convert.ToDecimal(match.Groups[2].Value.Replace(".", ","));
     }
     return(CurrentCourse);
 }
Пример #5
0
 private decimal Currency(string linkGraph)
 {
     ClearLists();
     foreach (Match match in Regex.Matches(TakeHtml(linkGraph), @", .(\d+), (.*?)]"))
     {
         DateTime dateTime = DateTimeOffset.FromUnixTimeMilliseconds(Convert.ToInt64(match.Groups[1].Value)).DateTime;
         ListTimeCourse.Add(dateTime);
         ListCourse.Add(Convert.ToDouble(match.Groups[2].Value.Replace(".", ",")));
         CurrentCourse = Convert.ToDecimal(match.Groups[2].Value.Replace(".", ","));
     }
     return(CurrentCourse);
 }
 private void Initialisationlistecourse()
 {
     ListCourse.Add(new Course {
         Nom = "Marathon de New-York", Lieu = "New-York", Distance = 42.195f
     });
     ListCourse.Add(new Course {
         Nom = "Marathon de Toulouse", Lieu = "Toulouse", Distance = 42.195f
     });
     ListCourse.Add(new Course {
         Nom = "Semi-Marathon de Seine-St-Denis", Lieu = "Seine-St-Denis", Distance = 21.1f
     });
 }
Пример #7
0
        public App()
        {
            InitializeComponent();

            if (ListCourse == null)
            {
                ListCourse = new List <Course>();
            }
            Initialisationlistecourse();

            MainPage = new ListCourse();
        }
Пример #8
0
        private decimal Metals(string linkGraph, int numMetal)
        {
            ClearLists();
            Regex r = new Regex("date'>(.*?)<td>(.*?)<td>(.*?)<td>(.*?)<td>(.*?)<tr>");

            Match m = r.Match(TakeHtml(linkGraph));

            while (m.Success)
            {
                ListTimeCourse.Add(Convert.ToDateTime(m.Groups[1].Value));
                ListCourse.Add(Convert.ToDouble(m.Groups[numMetal].Value.Replace(".", ",")));
                m = m.NextMatch();
            }
            ListCourse.Reverse();
            ListTimeCourse.Reverse();
            CurrentCourse = Convert.ToDecimal(ListCourse[ListCourse.Count - 2]);
            return(CurrentCourse);
        }
Пример #9
0
        private void removeCourseToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ListCourse list = new ListCourse();

            list.Show();
        }
Пример #10
0
 private void ClearLists()
 {
     ListCourse.Clear();
     ListTimeCourse.Clear();
 }
Пример #11
0
        private void M020103_ItemClick(object sender, ItemClickEventArgs e)
        {
            ListCourse list = new ListCourse();

            list.ShowDialog();
        }