예제 #1
0
        private void start()
        {
            DataSet User = new DataSet();

            string sql = "SELECT SubName FROM Lessons " +
                         "JOIN Subjects ON (Lessons.SubjectsID=Subjects.SubjectsID) " +
                         "WHERE Lessons.GroupNameID = " + MainWindow.GroupNameID + "";

            User = WorkWithBD.outPutdb(sql).Tables[0].DataSet;

            for (int i = 0; i < User.Tables[0].DefaultView.Count; i++)
            {
                MainListView.Items.Add(new TextBlock()
                {
                    Text = User.Tables[0].DefaultView[i].Row[0].ToString(),
                    VerticalAlignment = VerticalAlignment.Center,
                    Height            = 60,
                    FontSize          = 16,
                    TextWrapping      = TextWrapping.Wrap
                });
            }
        }
예제 #2
0
        private void start()
        {
            DataSet User = new DataSet();
            string  sql  = "EXEC SelectAllClass";

            User = WorkWithBD.outPutdb(sql).Tables[0].DataSet;

            for (int i = 0; i < User.Tables[0].DefaultView.Count; i++)
            {
                MainListView.Items.Add(new TextBlock()
                {
                    Text = User.Tables[0].DefaultView[i].Row[1].ToString(),
                    VerticalAlignment = VerticalAlignment.Center,
                    Height            = 60,
                    FontSize          = 16,
                    TextWrapping      = TextWrapping.Wrap
                });
            }
            sql  = "SELECT Employee.SubjectsID, Subjects.SubName FROM Employee JOIN Subjects ON (Employee.SubjectsID = Subjects.SubjectsID) WHERE FIOEmployee = '" + MainWindow.NAME + "' ";
            User = WorkWithBD.outPutdb(sql).Tables[0].DataSet;
            MainWindow.SubjectID = User.Tables[0].DefaultView[0].Row[0].ToString();
        }
        private void start()
        {
            SexCB.Items.Add("М");
            SexCB.Items.Add("Ж");

            DataSet User = new DataSet();
            string  sql  = "EXEC SelectAllClass";

            User = WorkWithBD.outPutdb(sql).Tables[0].DataSet;

            for (int i = 0; i < User.Tables[0].DefaultView.Count; i++)
            {
                ClassCB.Items.Add(User.Tables[0].DefaultView[i].Row[1].ToString());
            }
            sql  = "EXEC SelectAllMedGroup";
            User = WorkWithBD.outPutdb(sql).Tables[0].DataSet;

            for (int i = 0; i < User.Tables[0].DefaultView.Count; i++)
            {
                MedGroupCB.Items.Add(User.Tables[0].DefaultView[i].Row[0].ToString());
            }
        }
예제 #4
0
 private void AddBN_Click(object sender, RoutedEventArgs e)
 {
     if (Convert.ToDateTime(DayFor.Text) < Convert.ToDateTime(DayOn.Text))
     {
         MessageBox.Show("Проверьте введенную дату");
         return;
     }
     else
     {
         try
         {
             DataSet ds = new DataSet();
             ds = WorkWithBD.outPutdb("EXEC SelectClassLog @GroupName = '" + ClassCB.Text + "', " +
                                      "@DayOn = '" + Convert.ToDateTime(DayOn.Text) + "', @DayFor = '" + Convert.ToDateTime(DayFor.Text) + "'");
             WorkWithWord.writeClass(ds, "reportClass");
             Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
예제 #5
0
        private void start()
        {
            string sql = "EXEC SelectAllStudent";

            DataGridTotal.ItemsSource = (WorkWithBD.outPutdb(sql)).Tables[0].DefaultView;
        }
예제 #6
0
        private void start()
        {
            string sql = ("EXEC SelectLogs @NameGroup='" + MainWindow.NameGroup + "', @SubjectId=" + MainWindow.SubjectID);

            DataGridTotal.ItemsSource = (WorkWithBD.outPutdb(sql)).Tables[0].DefaultView;
        }
예제 #7
0
        private void start() // проверить студента, у которого есть оценки
        {
            string sql = "SelectStudentLog @SubName='" + MainWindow.SubName + "',@StudentID=" + MainWindow.StudentID;

            DataGridTotal.ItemsSource = (WorkWithBD.outPutdb(sql)).Tables[0].DefaultView;
        }
예제 #8
0
        private void createChartsSubjectsGroup()// вывод, когда выбран предмет и группа
        {
            if (!checkDate())
            {
                MessageBox.Show("Введите корректную дату");
                return;
            }
            SeriesCollection = new SeriesCollection();

            DataSet dataSetID = new DataSet();

            dataSetID = WorkWithBD.outPutdb("SELECT Subjects.SubjectsID FROM Subjects Where SubName = '" + SubjectCB.SelectedItem.ToString() + "'");

            string idSubject = dataSetID.Tables[0].DefaultView[0].Row[0].ToString();

            for (int i = 0; i < FIOCB.Items.Count; i++)
            {
                ChartValues <int> ts = new ChartValues <int>(); // массив куда занесем оценки

                DataSet User = new DataSet();
                User = WorkWithBD.outPutdb("SELECT GroupNameID FROM GroupName Where Name = '" + GroupCB.Items[i].ToString() + "'");
                string id = User.Tables[0].DefaultView[0].Row[0].ToString();

                User = WorkWithBD.outPutdb("SELECT Logs.Rating FROM Logs " +
                                           "JOIN Student ON (Logs.StudentID = Student.StudentID) " +
                                           "Where Student.GroupNameID = " + id + " " +
                                           "AND Logs.Data > '" + Convert.ToDateTime(DayFor.Text) + "' AND Logs.Data < '" + Convert.ToDateTime(DayTo.Text) + "'");

                dataSetID = WorkWithBD.outPutdb("SELECT Student.StudentID FROM Student Where FIO = '" + FIOCB.Items[i].ToString() + "'");

                string idStudent = dataSetID.Tables[0].DefaultView[0].Row[0].ToString();

                for (int j = 0; j < ((Convert.ToDateTime(DayTo.Text) - Convert.ToDateTime(DayFor.Text)).Days); j++) // считать среднии оценки по группе в даный день
                {
                    try
                    {
                        DataSet UserBuf = new DataSet();
                        UserBuf = WorkWithBD.outPutdb("SELECT Logs.Rating FROM Logs " +
                                                      "JOIN Student ON(Logs.StudentID = Student.StudentID) " +
                                                      "Where Student.GroupNameID = " + id + " AND " +
                                                      "Logs.Data = '" + Convert.ToDateTime(Convert.ToDateTime(DayFor.Text).AddDays(j)).ToString() + "' " +
                                                      "AND Logs.SubjectsID = " + idSubject + " " +
                                                      "AND Logs.StudentID = " + idStudent);

                        ts.Add(Convert.ToInt32(UserBuf.Tables[0].DefaultView[0].Row[0].ToString()));
                    }
                    catch { }
                }

                SeriesCollection.Add(new LineSeries
                {
                    Title             = FIOCB.Items[i].ToString(),
                    Values            = ts, // массив оценок
                    PointGeometry     = DefaultGeometries.Square,
                    PointGeometrySize = 5
                });
            }
            Labels = new List <string>();

            for (int i = 0; i < (Convert.ToDateTime(DayTo.Text) - Convert.ToDateTime(DayFor.Text)).Days; i++)
            {
                Labels.Add((Convert.ToDateTime(DayFor.Text).AddDays(i)).ToString().Split(' ')[0]);
            }
            YFormatter = value => value.ToString("C");

            DataContext = this;
        }