Exemple #1
0
        private void BtnGiveBook_Click(object sender, EventArgs e)
        {
            // Burada öğrencinin okuduğu kitaplar nesnesini üretiyoruz
            StudentReadInfo studentread = new StudentReadInfo();

            // Üretilen nesnenin hangi öğrenci olduğunu Comboboxtan gelen veriyi StudentList içinde bulup seçtirilir
            studentread.StudentId = DALStudent.StudentList().FirstOrDefault(n => n.StudentName == comboBox1.SelectedItem.ToString());
            // Üretilen nesnenin hangi kitap olduğunu Comboboxtan gelen veriyi BookList içinde bulup seçtirilir
            studentread.BookId = DALBook.BookList().FirstOrDefault(n => n.bookName == comboBox2.SelectedItem.ToString());
            // Öğrencinin okuduğu kitaplar nesnesi üzerinde bulunan kitapın alınma tarihine DateTimePickerdan gelen değeri atanır
            studentread.TakenDate = dateTimePicker1.Value.Date.ToString();
            // Entity katmanında TakenDate String olarak tutulduğu için gerekli tip dönüşüm işlemleri yapılır
            DateTime DueDate = Convert.ToDateTime(studentread.TakenDate);

            // DueDate kitabın teslim edilme tarihini teslim eder bunu DatetimePickerden gelen tarihe 15gün ekleyerek elde edilir.
            DueDate = DueDate.AddDays(15);
            // Entity'miz String olduğu için tekrar tip dönüşümü yapılır
            studentread.GivenDate = DueDate.ToString();
            // Entitymizin Kitabın verilip verilmediğini isGiven değişkeni üzerinde saklanır
            // Kitap verildiği taktirde isGiven true olur.
            studentread.isGiven = true;
            // Gerekli mantıksal işlemler yapılması için LLStudentBookSave methoduna gönderilir.
            LogicStudentRead.LLStudentBookSave(studentread);
            MessageBox.Show("Kitap Verildi");
            // Verilen kitapın alınıp alınmadığını tutan isBookAvailable özelliği ->Busy olarak değiştirilir.
            studentread.BookId.isBookAvailable = "Busy";
            // Kitabın durumunu güncellemek için LLStudentBookUpdate methoduna gönderilir
            LogicStudentRead.LLStudentBookUpdate(studentread.BookId);
            MessageBox.Show("Kitap Durumu Güncellendi");
        }
        private void studentGenderInfo()
        {
            int erkek = DALStudent.StudentList().Where(m => m.StudentGender == "ERKEK").Count();
            int kadın = DALStudent.StudentList().Where(m => m.StudentGender == "KADIN").Count();

            chart3.Titles.Add("Student Gender Info");
            chart3.Series["Öğrenci"].IsValueShownAsLabel = true;
            chart3.Series["Öğrenci"].Points.AddXY("Erkek", erkek);
            chart3.Series["Öğrenci"].Points.AddXY("Kadın", kadın);
        }
Exemple #3
0
        //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! BURAYA SON KEZ BAK !!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        private void BtnTakeBook_Click(object sender, EventArgs e)
        {
            // Burada öğrencinin okuduğu kitaplar nesnesini üretiyoruz
            StudentReadInfo studentread = new StudentReadInfo();

            // Üretilen nesnenin hangi öğrenci olduğunu Comboboxtan gelen veriyi StudentList içinde bulup seçtirilir
            studentread.StudentId = DALStudent.StudentList().FirstOrDefault(n => n.StudentName == comboBox1.SelectedItem.ToString());
            // Üretilen nesnenin hangi kitap olduğunu Comboboxtan gelen veriyi BookList içinde bulup seçtirilir
            studentread.BookId = DALBook.BookList().FirstOrDefault(n => n.bookName == comboBox2.SelectedItem.ToString());
            DateTime date      = DateTime.Now;
            var      shortDate = date.ToString("yyyy-MM-dd");

            studentread.GivenDate = shortDate.ToString();
            studentread.BookId.isBookAvailable = "Available";
            LogicStudentRead.LLStudentBookUpdate(studentread.BookId);
            MessageBox.Show("Kitap Durumu Güncellendi");
        }
Exemple #4
0
 public static bool LLStudentLogIn(EntityStudent student)
 {
     foreach (EntityStudent item in DALStudent.StudentList())
     {
         if (item.StudentUserName == student.StudentUserName && item.Password == student.Password)
         {
             student.StudentId       = item.StudentId;
             student.StudentName     = item.StudentName;
             student.StudentLastName = item.StudentLastName;
             student.StudentUserName = item.StudentUserName;
             student.Password        = item.Password;
             student.Repassword      = item.Repassword;
             student.StudentGender   = item.StudentGender;
             student.StudentDebt     = item.StudentDebt;
             return(true);
         }
     }
     return(false);
 }
Exemple #5
0
 public static List <EntityStudent> LLStudentList()
 {
     return(DALStudent.StudentList());
 }