コード例 #1
0
 public AsistenciaMaestros()
 {
     InitializeComponent();
     TeacherAttendance.InitCombos(this);
     lstTeacherAtt          = TeacherAttendance.initTable();
     myDataGrid.ItemsSource = lstTeacherAtt;
 }
コード例 #2
0
        private void btnCheckBlueEdit_Click(object sender, RoutedEventArgs e)
        {
            bool isValid = TeacherAttendance.validateAddRow(this);

            if (isValid)
            {
                BitmapImage b = new BitmapImage();
                b.BeginInit();
                b.UriSource = new Uri("pack://application:,,,/LIVEX;component/Images/001-checked-1.png");
                b.EndInit();
                imgCheck.Stretch = Stretch.Uniform;
                imgCheck.Source  = b;

                TeacherAttendance.EditSelected(this);

                if (dpFrom.Text == "" || dpUntil.Text == "")
                {
                    myDataGrid.ItemsSource = TeacherAttendance.initTable();
                }
                else if (dpFrom.Text != "" || dpUntil.Text != "")
                {
                    myDataGrid.ItemsSource = TeacherAttendance.FilterTable(Convert.ToDateTime(dpFrom.Text), Convert.ToDateTime(dpUntil.Text));
                }

                TeacherAttendance.ResetRowCombos(this);
            }
        }
コード例 #3
0
        private void btnUpload_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Title  = "Seleccione el archivo";
            openFile.Filter = "csv(*.csv)|*.csv";
            if (openFile.ShowDialog() == true)
            {
                int result = TeacherAttendance.uploadTimerFile(openFile.FileName, openFile.SafeFileName);
                if (result == 1)
                {
                    lstTeacherAtt          = TeacherAttendance.initTable();
                    myDataGrid.ItemsSource = lstTeacherAtt;
                }
            }
        }
コード例 #4
0
        private void btnDelete_Click(object sender, RoutedEventArgs e)
        {
            Button           am     = (Button)sender;
            MessageBoxResult result = MessageBox.Show("¿Esta seguro de borrar el registro?", "Delete", MessageBoxButton.YesNo);

            if (MessageBoxResult.Yes == result)
            {
                TeacherAttendance.DeleteRow(this, am.DataContext);

                if (dpFrom.Text == "" || dpUntil.Text == "")
                {
                    myDataGrid.ItemsSource = TeacherAttendance.initTable();
                }
                else if (dpFrom.Text != "" || dpUntil.Text != "")
                {
                    myDataGrid.ItemsSource = TeacherAttendance.FilterTable(Convert.ToDateTime(dpFrom.Text), Convert.ToDateTime(dpUntil.Text));
                }
            }
        }