private void editData()
        {
            Connector db    = new Connector();
            string    query = String.Format("update subjects set " +
                                            "name = '{0}', classificationID = {1} where id = {2};", subjectTB.Text, ClassificationVM.getClassification(typeCB.Text).id,
                                            ((FacultyLoads)dg.SelectedItem).subjectID);

            if (db.addData(query) != -1)
            {
                SubjectVM.getSubject(((FacultyLoads)dg.SelectedItem).subjectID).name    = subjectTB.Text;
                SubjectVM.getSubject(((FacultyLoads)dg.SelectedItem).subjectID).classID = ClassificationVM.getClassification(typeCB.Text).id;
            }
            dg.Items.Refresh();
            typeCB.Items.Refresh();
            subjectTB.Items.Refresh();
        }
        private void addData()
        {
            long      lastid;
            string    query;
            Connector db = new Connector();

            if (SubjectVM.getSubject(subjectTB.Text) == null)
            {
                query = String.Format("insert into subjects ( name, classificationID) values (" +
                                      "'{0}', {1})", subjectTB.Text,
                                      ClassificationVM.getClassification(typeCB.Text).id);
                lastid = db.addData(query);
                if (lastid != -1)
                {
                    SubjectVM.Subjects.Add(new Subject
                    {
                        id      = (int)lastid,
                        name    = subjectTB.Text,
                        classID = ClassificationVM.getClassification(typeCB.Text).id
                    });
                }
            }
            query = String.Format("insert into facultyloads (facultyId, subjectId) values (" +
                                  "{0}, {1});", CurrentUser.user.id, SubjectVM.getSubject(subjectTB.Text).id);

            lastid = db.addData(query);
            if (lastid != -1)
            {
                //Console.WriteLine(query);
                LoadsVM.specificLoads.Add(new FacultyLoads
                {
                    id        = (int)lastid,
                    facultyID = CurrentUser.user.id,
                    subjectID = SubjectVM.getSubject(subjectTB.Text).id
                });
            }
        }