コード例 #1
0
        private void _btnchangepass_Click(object sender, RoutedEventArgs e)
        {
            //if (_btnchangepass.Content.Equals("Change Pass"))
            //{
            //    _btnchangepass.Content = "Save";
            //    passwordBox1.IsEnabled = true;
            //    passwordBox.Clear();
            //    passwordBox1.ToolTip = "Nhập Lại Pass";
            //    _btncancelsavepass.Visibility = Visibility.Visible;
            //    _btncancelsavepass.IsEnabled = true;
            //    passwordBox.Focus();
            //    return;
            //}
            //string warning = "";
            //if (String.IsNullOrWhiteSpace(passwordBox.Password))
            //{
            //    warning += "Nhập password." + '\n';
            //}
            //if (String.IsNullOrWhiteSpace(passwordBox1.Password))
            //{
            //    warning += "Pass nhập lại không đúng." + '\n';
            //}
            //if (!warning.Equals(""))
            //{
            //    MessageBox.Show(warning,
            //        "Cập Nhật Pass",
            //        MessageBoxButton.OK,
            //        MessageBoxImage.Warning);
            //    return;
            //}
            //try
            //{
            //    if (passwordBox.Password == passwordBox1.Password)
            //    {
            //        UserController us = new UserController();
            //        View_Models.User user = us.GetById(Id);
            //        user.PASSWORD = passwordBox.Password.Trim();
            //        if (us.Edit(user))
            //        {
            //            MessageBox.Show("Cập Nhật thành công", "Cập Nhật Password", MessageBoxButton.OK, MessageBoxImage.Information);
            //        }
            //        else
            //        {
            //            MessageBox.Show("Cập Nhật thất bại", "Cập Nhật Password", MessageBoxButton.OK, MessageBoxImage.Information);
            //        }
            //    }
            //    else
            //    {
            //        MessageBox.Show("Pass word nhập lại không trùng khớp", "Cập Nhật Password", MessageBoxButton.OK, MessageBoxImage.Information); return;
            //    }
            //    _btnchangepass.Content = "Change Pass";
            //    passwordBox1.IsEnabled = false;
            //    passwordBox1.Clear();
            //}
            //catch { }
            BookLoanByMemBer report = new BookLoanByMemBer("DG003");

            report.FilterString = "[DaTra] = false";
            DocumentPreviewWindow window = new DocumentPreviewWindow();

            window.PreviewControl.DocumentSource = report;
            report.CreateDocument(true);
            window.ShowDialog();
        }
コード例 #2
0
 private void _reportprint_Click(object sender, RoutedEventArgs e)
 {
     if (_rdall.IsChecked == true)
     {
         if (_rccahaitc.IsChecked == true)
         {
             BooksLoanAll report = new BooksLoanAll();
             //report.FilterString = "[DaTra] = false";
             DocumentPreviewWindow window = new DocumentPreviewWindow();
             window.PreviewControl.DocumentSource = report;
             report.CreateDocument(true);
             window.ShowDialog();
         }
         if (_rddatratc.IsChecked == true)
         {
             BooksLoanAll report = new BooksLoanAll();
             report.FilterString = "[DaTra] = true";
             DocumentPreviewWindow window = new DocumentPreviewWindow();
             window.PreviewControl.DocumentSource = report;
             report.CreateDocument(true);
             window.ShowDialog();
         }
         if (_rdchuatratc.IsChecked == true)
         {
             BooksLoanAll report = new BooksLoanAll();
             report.FilterString = "[DaTra] = false";
             DocumentPreviewWindow window = new DocumentPreviewWindow();
             window.PreviewControl.DocumentSource = report;
             report.CreateDocument(true);
             window.ShowDialog();
         }
     }
     if (_rdsachmember.IsChecked == true)
     {
         if (_cbbtendocgia.SelectedItem == null)
         {
             MessageBox.Show("Chon Doi Tuong", "Thong Bao", MessageBoxButton.OK, MessageBoxImage.Warning);
             return;
         }
         if (_ckcahai.IsChecked == true)
         {
             BookLoanByMemBer report = new BookLoanByMemBer((_cbbtendocgia.SelectedItem as View_Models.DocGia).MaDocGia);
             //report.FilterString = "[DaTra] = false";
             DocumentPreviewWindow window = new DocumentPreviewWindow();
             window.PreviewControl.DocumentSource = report;
             report.CreateDocument(true);
             window.ShowDialog();
         }
         if (_ckchuatra.IsChecked == true)
         {
             BookLoanByMemBer report = new BookLoanByMemBer((_cbbtendocgia.SelectedItem as View_Models.DocGia).MaDocGia);
             report.FilterString = "[DaTra] = false";
             DocumentPreviewWindow window = new DocumentPreviewWindow();
             window.PreviewControl.DocumentSource = report;
             report.CreateDocument(true);
             window.ShowDialog();
         }
         if (_ckdatra.IsChecked == true)
         {
             BookLoanByMemBer report = new BookLoanByMemBer((_cbbtendocgia.SelectedItem as View_Models.DocGia).MaDocGia);
             report.FilterString = "[DaTra] = true";
             DocumentPreviewWindow window = new DocumentPreviewWindow();
             window.PreviewControl.DocumentSource = report;
             report.CreateDocument(true);
             window.ShowDialog();
         }
     }
 }