コード例 #1
0
        private void btn14gun_Click(object sender, RoutedEventArgs e)
        {
            DateTime test = DateTime.Now;

            test             = test.AddDays(14);
            txtSendDate.Text = DateDifference.RemoveHour(test);
        }
コード例 #2
0
        private void DetailStudent_Loaded(object sender, RoutedEventArgs e)
        {
            frame = ((MainWindow)Application.Current.MainWindow).ConFrame;
            ChangesDetection();

            if (detailType == DetailType.Add)
            {
            }

            if (detailType == DetailType.Edit)
            {
                List <Book> list = new List <Book>();
                try
                {
                    if (IsExcelData != true)
                    {
                        list = bookManager.GetBooksOfStudent(student.Identity);
                        lblBookCount.Content = "Öğrenci kütüphaneden toplam " + student.StudentBookCount + " adet kitap almış.";
                    }
                }
                catch (Exception)
                {
                }


                booksOfStudent.Children.Clear();

                foreach (var item in list)
                {
                    Label label = new Label()
                    {
                        Height = 40,
                        VerticalContentAlignment = VerticalAlignment.Center,
                        Margin   = new Thickness(0, 0, 0, 10),
                        FontSize = 16,
                    };
                    label.Content = DateDifference.RemoveHour(item.DateOfIssue)
                                    + " tarihinde > \"" + item.BookName + "\" adlı kitap";
                    booksOfStudent.Children.Add(label);
                }

                LoadDatas();
            }
        }
コード例 #3
0
        private void ShowData()
        {
            if (detailType == DetailType.Edit)
            {
                try
                {
                    lbldetail.Content  = DateDifference.RemoveHour(book.DateOfIssue) + " Kitap şurada: ";
                    lbldetail.Content += studentManager.Get(book.BookLocation).StudentName;
                }
                catch (Exception)
                {
                }
                lblDetailTitle.Content = book.BookName;
                txt_isim.Text          = book.BookName;
                txt_tur.Text           = book.BookType;
                try
                {
                    txt_raf.Text = book.BookBarcode.ToString();
                }
                catch (Exception)
                {
                }
                txt_yazar.Text       = book.BookAuthor;
                txt_yayinci.Text     = book.BookPublisher;
                txt_yayintarihi.Text = DateDifference.RemoveHour(book.BookReleaseDate);
                txtSendDate.Text     = DateDifference.RemoveHour(book.DateOfCommitment);
            }

            if (KeySet.Yetki == false)
            {
                btnDelete.Visibility = Visibility.Hidden;
                btnSave.Visibility   = Visibility.Hidden;

                foreach (var item in anapanel.Children)
                {
                    if (item is TextBox)
                    {
                        TextBox ann = item as TextBox;
                        ann.IsHitTestVisible = true;
                        ann.IsReadOnly       = true;
                    }
                }
            }
        }
コード例 #4
0
        private void Settings_Loaded(object sender, RoutedEventArgs e)
        {
            List <Book> books = bookManager.EscrowBooks();

            stkStatesOfBooks.Children.Clear();

            foreach (var item in books)
            {
                Style   style   = this.FindResource("ButtonStyle") as Style;
                Student student = studentManager.Get(item.BookLocation);

                StackPanel panel = new StackPanel();
                panel.Orientation = Orientation.Horizontal;


                Button button1 = new Button();
                button1.Click  += Button1_Click;
                button1.Content = "Kitap: " + item.BookName;
                button1.Style   = style;
                button1.Width   = 250;

                panel.Children.Add(button1);


                Button button2 = new Button();
                button2.Click  += Button2_Click;
                button2.Content = "Öğrenci: " + student.StudentName;
                button2.Style   = style;
                button2.Width   = 250;

                panel.Children.Add(button2);

                Label label3 = new Label();
                label3.FontSize = 16;

                string detay = DateDifference.WhatDifference(DateTime.Now, item.DateOfCommitment).ToString();

                BrushConverter bc = new BrushConverter();

                int detayNum = Temizle(detay);



                label3.Content = " - " + DateDifference.RemoveHour(item.DateOfIssue) + " aldı - "
                                 + DateDifference.RemoveHour(item.DateOfCommitment) +
                                 " vermeli - ";

                if (detayNum == 0)
                {
                    label3.Foreground = (Brush)bc.ConvertFrom("orange");
                    label3.Content   += "bugün vermeli";
                    listBugun.Add(item);
                }
                else if (detayNum < 0)
                {
                    label3.Foreground = (Brush)bc.ConvertFrom("red");
                    label3.Content   += detay.Replace("-", null) + " süresi geçti";
                    listDolanlar.Add(item);
                }
                else if (detayNum > 1)
                {
                    label3.Foreground = (Brush)bc.ConvertFrom("green");
                    label3.Content   += detay + " var";
                    listZamaniVar.Add(item);
                }
                else if (detayNum == 1)
                {
                    label3.Foreground = (Brush)bc.ConvertFrom("steelblue");
                    label3.Content   += " yarın vermeli";
                    listYarin.Add(item);
                }


                panel.Children.Add(label3);

                stkStatesOfBooks.Children.Add(panel);
            }
        }