Exemplo n.º 1
0
        private void BtCommint_Click(object sender, EventArgs e)
        {
            switch (tbNewPassword.Text != tbConfPass.Text)
            {
            case (true):
                tbConfPass.Clear();
                tbNewPassword.Clear();
                break;

            case (false):
                DataBaseProcedure procedure = new DataBaseProcedure();
                DataBaseTables    tables    = new DataBaseTables();
                tables.qrAccess_rights += " and [Access_rights_name] = " +
                                          "'Студент'";
                tables.dtAccess_rightsFill();
                Int32 Access_Rights_id =
                    Convert.ToInt32(tables.dtAccess_rights.
                                    Rows[0][0].ToString());
                procedure.spProfile_New_User(tbNewLogin.Text,
                                             tbConfPass.Text, Access_Rights_id, 1,
                                             tbImagePath.Text);
                procedure.spStudent_Insert(tbNewLogin.Text,
                                           ((StudentsForm)parentCreate).tbStudentSurname.Text,
                                           ((StudentsForm)parentCreate).tbStudentName.Text,
                                           ((StudentsForm)parentCreate).tbStudentMiddleName.Text,
                                           ((StudentsForm)parentCreate).mtbTicketNumber.Text,
                                           Convert.ToInt32(((StudentsForm)parentCreate).
                                                           cbGroup.SelectedValue.ToString()));
                BtCancel_Click(sender, e);
                break;
            }
        }
        private void accessRightsFill()
        {
            Action action = () =>
            {
                DataBaseTables tables = new DataBaseTables();
                tables.dtAccess_rightsFill();
                tables.dependency.OnChange  += onchangeAccessRights;
                cbAccessRights.DataSource    = tables.dtAccess_rights;
                cbAccessRights.ValueMember   = "ID_Access_rights";
                cbAccessRights.DisplayMember = "Access_rights_name";
            };

            Invoke(action);
        }