Ejemplo n.º 1
0
    public override void addStudent(Student student)
    {
        MySqlCommand dbcmd = getDbCommand();

        dbcmd.CommandText = "INSERT INTO students (name, family, mdlname, studgroup, login, password, ipaddress, choosed) VALUES ( '" +
                            student.Name1 + "', '" + student.Family1 + "', '" + student.MdlName1 + "', '" +
                            student.StudGroup1 + "', '" + student.Login1 + "', '" + MenuUIManager.PasswEncryption(student.Password1) +
                            "', '" + student.Ipaddress1 + "', '" + student.Choosed1 + "' )";
        dbcmd.ExecuteNonQuery();
    }
Ejemplo n.º 2
0
    public override int addTeacher(Teacher teacher)
    {
        MySqlCommand dbcmd = getDbCommand();

        dbcmd.CommandText = "INSERT INTO teachers (name, family, mdlname, position, login, password, ipaddress, regtime, choosed) VALUES ( '" +
                            teacher.Name1 + "', '" + teacher.Family1 + "', '" + teacher.MdlName1 + "', '" +
                            teacher.Position1 + "', '" + teacher.Login1 + "', '" + MenuUIManager.PasswEncryption(teacher.Password1) +
                            "', '" + teacher.Ipaddress1 + "', '" + teacher.Regtime1.ToString("yyyy-MM-dd H:mm:ss") + "', '" + teacher.Choosed1 + "' )";
        dbcmd.ExecuteNonQuery();
        return((int)dbcmd.LastInsertedId);
    }
Ejemplo n.º 3
0
    void EnterButton()
    {
        var teachersDB   = new TeachersDB();
        var currPassword = MenuUIManager.PasswEncryption(passw.text);
        var reader       = teachersDB.findTeacher(login.text);

        if (reader.HasRows)
        {
            reader.Read();
            if (reader[1].ToString() == currPassword)
            {
                MenuUIManager.currTeacherId = Convert.ToInt32(reader[0]);
                MenuUIManager.Instance.OpenTaskPanel();
            }
            else
            {
                Debug.Log("Введенные логин и пароль не соответствуют друг другу");
            }
        }
        else
        {
            Debug.Log("Введенный логин не найден в БД");
        }
    }