Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            fakulte_DTO sec_fakulte = null;

            try
            {
                sec_fakulte = (fakulte_DTO)comboBox1.SelectedItem;
            }
            catch (Exception)
            {
                lblstatus.Text = "Lütfen Bir Fakulte Seçin.";
                return;
            }

            List <bolum_DTO> toupdate = new List <bolum_DTO>();
            var col2 = db.GetCollection <bolum_DTO>("Bolum");
            List <bolum_DTO> bolumler = col2.FindAll().ToList();

            foreach (var item in bolumler)
            {
                if (item.fakulte == sec_fakulte.foldername)
                {
                    toupdate.Add(item);
                }
            }
            if (toupdate.Count == 0)
            {
                lblstatus.Text = "Fakülteye Bölüm Eklememişsiniz.";
                return;
            }
            Thread th = new Thread(() => { Updater(toupdate); });

            th.Start();
        }
Пример #2
0
        private void comboBox4_SelectedIndexChanged(object sender, EventArgs e)
        {
            fakulte_DTO      sec_fakulte = (fakulte_DTO)comboBox4.SelectedItem;
            var              col2        = db.GetCollection <bolum_DTO>("Bolum");
            List <bolum_DTO> bolumler    = col2.FindAll().ToList();

            foreach (var item in bolumler)
            {
                if (item.fakulte == sec_fakulte.foldername)
                {
                    comboBox2.Items.Add(item);
                }
            }
        }
Пример #3
0
        private void button4_Click(object sender, EventArgs e)
        {
            fakulte_DTO sec_fakulte = null;
            try
            {
                sec_fakulte = (fakulte_DTO)comboBox1.SelectedItem;
                if (sec_fakulte == null)
                    throw new Exception();
            }
            catch (Exception)
            {
                textBox3.Text = "Lütfen Bir Fakülte Seçin.";
                return;
            }
            updatedaysbyfakulte(sec_fakulte.foldername);
            List<string> lessons = new List<string>();
            foreach (var day in days)
            {
                foreach (var times in day.time)
                {
                    foreach (var lesson in times.lesson)
                    {
                        if(lesson.@class != null)
                        lessons.Add(lesson.@class);
                    }  
                }      
            }
            List<string> uniquelist = getunique(lessons);
            uniquelist.Sort();
            textBox3.Text = "";

            int newline = 0;
            int split = 8;
            foreach (var item in uniquelist)
            {
                if (newline == split)
                {
                    textBox3.Text += Environment.NewLine;
                    newline = 0;
                }
                textBox3.Text += item;
                if (newline != split - 1)
                {
                    textBox3.Text += " | ";
                }

                newline++;
            }
        }
Пример #4
0
        private void button7_Click(object sender, EventArgs e)
        {
            fakulte_DTO sec_fakulte = null;
            string h = null;
            string m = null;
            string d = null;
            try
            {
                sec_fakulte = (fakulte_DTO)comboBox1.SelectedItem;
                if (sec_fakulte == null)
                    throw new Exception();

                h = Hours.SelectedItem.ToString();
                m = Minutes.SelectedItem.ToString();
                d = day.SelectedItem.ToString();
            }
            catch (Exception)
            {
                textBox3.Text = "Lütfen Tüm Boş Seçim Bırakmayın.";
                return;
            }
            
            string hm = h + ":" + m;
            int dayid = 0;
            foreach (var item in daysofweek)
            {
                if(d == CultureInfo.GetCultureInfo("tr-TR").DateTimeFormat.DayNames[(int)item])
                {
                    break;
                }
                dayid++;
            }
            updatedaysbyfakulte(sec_fakulte.foldername);
            List<string> lessons = new List<string>();
            foreach (var day in days)
            {
                foreach (var times in day.time)
                {
                    foreach (var lesson in times.lesson)
                    {
                        if (lesson.@class != null)
                        {
                            lessons.Add(lesson.@class);
                        }
                    }
                }
            }
            List<string> uniqueclasslist = getunique(lessons);

            List<string> doluclasslist = new List<string>();
            string sectime = hm;
            TimeSpan sectimespan = TimeSpan.Parse(sectime);
            int gun = dayid;
            foreach (var item in days[gun].time)
            {
                string[] aralik = item.time.Split('-');
                TimeSpan aralik1 = TimeSpan.Parse(aralik[0]);
                TimeSpan aralik2 = TimeSpan.Parse(aralik[1]);
                if (sectimespan >= aralik1 && sectimespan <= aralik2)
                {

                    foreach (var items in item.lesson)
                    {
                        string dersyazdir = items.@class + "|" + items.name + "|" + items.faculty;
                        if (items.@class != null)
                        {
                            doluclasslist.Add(items.@class);
                        }

                    }


                }

            }
            var bossiniflist = uniqueclasslist.Except(doluclasslist).ToList();
            textBox3.Text = "Tüm Boş Sınıflar:" + Environment.NewLine;
            int newline = 0;
            int split = 5;
            foreach (var item in bossiniflist)
            {
                if(newline == split)
                {
                    textBox3.Text += Environment.NewLine;
                    newline = 0;
                }
                textBox3.Text += item;
                if (newline != split-1)
                {
                    textBox3.Text += " | ";
                }

                newline++;
            }
        }
Пример #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            textBox3.Text = "";
            fakulte_DTO sec_fakulte = null;
            string h = null;
            string m = null;
            string d = null;
            try
            {
                sec_fakulte = (fakulte_DTO)comboBox1.SelectedItem;
                if (sec_fakulte == null)
                  throw new Exception();

                h = Hours.SelectedItem.ToString();
                m = Minutes.SelectedItem.ToString();
                d = day.SelectedItem.ToString();
            }
            catch (Exception)
            {
                textBox3.Text = "Lütfen Tüm Boş Seçim Bırakmayın.";
                return;
            }
            string hm = h + ":" + m;
            int dayid = 0;
            foreach (var item in daysofweek)
            {
                if (d == CultureInfo.GetCultureInfo("tr-TR").DateTimeFormat.DayNames[(int)item])
                {
                    break;
                }
                dayid++;
            }
            updatedaysbyfakulte(sec_fakulte.foldername);

            string sectime = hm;
            TimeSpan sectimespan = TimeSpan.Parse(sectime);
            int gun = dayid; // pazartesi
            int count = 0;
            foreach (var item in days[gun].time)
            {
                string[] aralik = item.time.Split('-');
                TimeSpan aralik1 = TimeSpan.Parse(aralik[0]);
                TimeSpan aralik2 = TimeSpan.Parse(aralik[1]);
                if (sectimespan >= aralik1 && sectimespan <= aralik2)
                {
                    
                    foreach (var items in item.lesson)
                    {
                        string dersyazdir = items.@class+" | "+items.name+" | "+items.teacher;
                        if(count == 0)
                        {
                            textBox3.Text = "Saat: "+item.time+" için tüm dersler:"+ Environment.NewLine;
                            count++;
                        }
                        if (items.@class != null)
                        {
                            textBox3.Text += "Ders: " + dersyazdir + Environment.NewLine;
                            count++;
                        }
                       
                    }

                    
                }

            }
            if(count == 1)
            {
                textBox3.Text += "Hiç Ders Bulunamadı.";
            }
            
        }