Ejemplo n.º 1
0
        ///
        /// <param name="year"></param>
        /// <param name="form"></param>
        public void ShowPlanOfAdmission(int year, FormOfEducation form)
        {
            try
            {
                string sqlQuery = "SELECT SNAME,AMOUNT FROM 'PLANOFADMISSION'" +
                                  " INNER JOIN 'SPECIALITY' ON SPECIID=SPECID " +
                                  " WHERE PLAN_YEAR = " + year + " AND FORMID = " + (int)form + ";";

                SQLiteDataReader reader = GetInfo.ExecuteSql(sqlQuery);
                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        dataGridPlan.Rows.Add(new object[] {
                            reader.GetValue(0).ToString(),
                            reader.GetValue(1).ToString(),
                        });
                    }
                }
                else
                {
                    dataGridPlan.Visible = false;
                    label2.Text          = "Such information is not found!";
                }
            }
            catch (SQLiteException ex)
            {
                MessageBox.Show("Oops...Something went wrong:(" + ex.ToString());
            }
        }
Ejemplo n.º 2
0
        public string Save()
        {
            string error = "";

            try
            {
                using (SQLDatabaseDataContext db = new SQLDatabaseDataContext(Program.Connectionstring))
                {
                    FormOfEducation formOfEducation = new FormOfEducation();
                    if (this.ID > 0)
                    {
                        formOfEducation = (from foe in db.FormOfEducations where foe.ID == this.ID select foe).FirstOrDefault();
                    }

                    formOfEducation.Name = this.Name;

                    if (this.ID == 0)
                    {
                        db.FormOfEducations.InsertOnSubmit(formOfEducation);
                    }
                    db.SubmitChanges();
                }
            }
            catch (Exception ex)
            {
                error = ex.Message;
            }
            return(error);
        }
Ejemplo n.º 3
0
        private void ButtonFind_Click(object sender, EventArgs e)
        {
            FormOfEducation form = FormOfEducation.partTimeForm;

            if (!CheckingInfo.CheckCorectness(textYear.Text))
            {
                MessageBox.Show("Invalid year!");
            }
            else
            {
                if (RBExtramural.Checked)
                {
                    form = FormOfEducation.extramuralForm;
                }
                else if (RBIntramural.Checked)
                {
                    form = FormOfEducation.intramuralForm;
                }

                int year = Int32.Parse(textYear.Text);

                Hide();
                RequestFindForm reqForm = new RequestFindForm(form, year);
                reqForm.Show();
            }
        }
Ejemplo n.º 4
0
 public Student(string fullName, string group, int gpa, Gender gender, FormOfEducation formOfEducation, params int[] familySalary)
 {
     FullName          = fullName;
     Group             = group;
     GPA               = gpa;
     Gender            = gender;
     FormOfEducation   = formOfEducation;
     this.familySalary = familySalary.ToList();
 }
 public Student(string _name, string _group, double _averageScore, int _salary, Gender _gender, FormOfEducation _formOfEducation)
 {
     name            = _name;
     group           = _group;
     averageScore    = _averageScore;
     salary          = _salary;
     gender          = _gender;
     formOfEducation = _formOfEducation;
 }
Ejemplo n.º 6
0
        public Student(string nameStudent, string groupName, int averageMark, int incomeFamily, Gender gender, FormOfEducation formOfEducation)
        {
            FullName = nameStudent;

            GroupName = groupName;

            AverageMark = averageMark;

            IncomeFamily = incomeFamily;

            Gender = gender;

            FormOfEducationStudent = formOfEducation;
        }
Ejemplo n.º 7
0
        public void Input()
        {
            WriteLine("Добавление студента\n");
            Write("Введите ФИО: ");
            FullName = ReadLine();
            Write("Введите группу: ");
            Group = ReadLine();
            Write("Средний балл: ");
            AverageScore = Int32.Parse(ReadLine());
            Write("Доход(тг): ");
            SalaryOnFamily = Int32.Parse(ReadLine());
            WriteLine("Пол:\n\t1 - мужской\t2 - женский");

            for (;;)
            {
                if (!Int32.TryParse(ReadLine(), out menu1))
                {
                    continue;
                }
                if (menu1 == 1)
                {
                    Sex = Sex.Male;
                    break;
                }
                else if (menu1 == 2)
                {
                    Sex = Sex.Female;
                    break;
                }
            }
            WriteLine("Форма обучения:\n\t1 - очное\t2 - заочное");
            for (; ;)
            {
                if (!Int32.TryParse(ReadLine(), out menu2))
                {
                    continue;
                }
                if (menu2 == 1)
                {
                    Education = FormOfEducation.FullTime;
                    break;
                }
                else if (menu2 == 2)
                {
                    Education = FormOfEducation.Distance;
                    break;
                }
            }
        }
Ejemplo n.º 8
0
 public RequestFindForm(FormOfEducation form, int reqYear)
 {
     InitializeComponent();
     edForm = form;
     year   = reqYear;
 }
Ejemplo n.º 9
0
 public TFormOfEducation(FormOfEducation forme)
 {
     this.ID   = forme.ID;
     this.Name = forme.Name;
 }
Ejemplo n.º 10
0
        /// 
        /// <param name="dep">Department of university</param>
        /// <param name="fac">Faculty of university</param>
        /// <param name="spec">Speciality of university</param>
        /// <param name="form">Form of education</param>
        public static bool AddEducationalUnit(Department dep, Faculty fac, Speciality spec, FormOfEducation form){
            try
            {
                string sql = String.Format("INSERT INTO 'DEPARTMENT' (DEPCODE, DEPNAME, DEPSHORTNAME) VALUES ({0}, '{1}', '{2}');",
                    dep.Code, dep.Name, dep.ShortName);
                if (!GetInfo.ExecuteReadSql(sql))
                    return false;
                sql = String.Format("INSERT INTO 'FACULTY' (FACCODE, FACNAME, FACSHORTNAME, DEPRID) VALUES ({0}, '{1}', '{2}', {3});",
                    fac.Code, fac.Name, fac.ShortName, dep.Code);
                if (!GetInfo.ExecuteReadSql(sql))
                    return false;
                sql = String.Format("INSERT INTO 'SPECIALITY' (SCODE, SNAME, SSHORTNAME, FAID, FORMID, DEPARID) VALUES ({0}, '{1}', '{2}', {3}, {4}, {5});",
                    spec.Code, spec.Name, spec.ShortName, fac.Code, (int)form, dep.Code);
                if (!GetInfo.ExecuteReadSql(sql))
                    return false;
            }
            catch(SQLiteException ex)
            {
                return false;
            }

            return true;
		}
Ejemplo n.º 11
0
        public static bool AddInfo(Department dep, Speciality spec, Faculty fac,Head head, string address, string phone, string site, int year, FormOfEducation form)
        {
            if (!AddContactInfo(phone, site, address, spec))
                return false;
            if (!AddEducationalUnit(dep, fac, spec, form))
                return false;
            if (!AddHead(head, dep, fac, spec, year))
                return false;

            return true;
        }
Ejemplo n.º 12
0
 public PlanOfAdmission(FormOfEducation edForm, int year)
 {
     InitializeComponent();
     ShowPlanOfAdmission(year, edForm);
 }
Ejemplo n.º 13
0
        private void ButtonAdd_Click(object sender, EventArgs e)
        {
            Department      dep     = null;
            Faculty         fac     = null;
            Speciality      spec    = null;
            Head            head    = null;
            int             year    = 0;
            string          address = "";
            string          phone   = "";
            string          site    = "";
            FormOfEducation edForm  = FormOfEducation.intramuralForm;

            if (textBoxDep.Text.Length != 0)
            {
                dep = new Department(GetInfo.DepMaxCode() + 1, textBoxDep.Text);
            }
            if (textBoxFac.Text.Length != 0)
            {
                fac = new Faculty(GetInfo.FacMaxCode() + 1, textBoxFac.Text);
            }
            if (textBoxSpec.Text.Length != 0)
            {
                spec = new Speciality(GetInfo.SpecMaxCode() + 1, textBoxFac.Text);
            }
            if (textBoxYear.Text.Length != 0 && CheckingInfo.CheckCorectness(textBoxYear.Text))
            {
                year = Int32.Parse(textBoxYear.Text);
            }
            if (textBoxName.Text.Length != 0 && textBoxRank.Text.Length != 0 && textBoxDegree.Text.Length != 0)
            {
                head = new Head(year, textBoxName.Text, textBoxDegree.Text, textBoxRank.Text);
            }
            if (textBoxAddress.Text.Length != 0)
            {
                address = textBoxAddress.Text;
            }
            if (textBoxPhone.Text.Length != 0)
            {
                phone = textBoxPhone.Text;
            }
            if (textBoxSite.Text.Length != 0)
            {
                site = textBoxSite.Text;
            }

            if (RBExtramural.Checked)
            {
                edForm = FormOfEducation.extramuralForm;
            }
            if (RBPart.Checked)
            {
                edForm = FormOfEducation.partTimeForm;
            }

            if (AddingInformation.AddInfo(dep, spec, fac, head, address, phone, site, year, edForm))
            {
                MessageBox.Show("Successfully added!");
            }
            else
            {
                MessageBox.Show("Error! Try again");
            }
        }