Esempio n. 1
0
 public void TrainessEdit(int Class, string Family_name, string First_name, string Middle_name)
 {
     BDConnection.Select("UPDATE `trainesses` SET `class` = '" + Class + "'," +
                         " `family_name` = '" + Family_name + "', `first_name` = '" + First_name + "', `middle_name` = '" + Middle_name + "' WHERE (`idTrainess` = '" + idTrainess + "');");
     this.Class       = Class;
     this.Family_name = Family_name;
     this.First_name  = First_name;
     this.Middle_name = Middle_name;
 }
Esempio n. 2
0
        public static List <DataUser> Select()
        {
            List <DataUser> listUser = new List <DataUser>();
            DataTable       data     = BDConnection.Select("SELECT * FROM biblioteka.users;");

            foreach (DataRow row in data.Rows)
            {
                listUser.Add(new DataUser(row));
            }
            return(listUser);
        }
Esempio n. 3
0
        public static List <DataTrainess> Select(string Search)
        {
            List <DataTrainess> listTrainess = new List <DataTrainess>();
            DataTable           data         = BDConnection.Select("SELECT * FROM trainesses WHERE Family_name LIKE '%" + Search + "%';");

            foreach (DataRow row in data.Rows)
            {
                listTrainess.Add(new DataTrainess(row));
            }
            return(listTrainess);
        }
Esempio n. 4
0
        public static List <DataIssuance> Select()
        {
            List <DataIssuance> listIssuance = new List <DataIssuance>();
            DataTable           data         = BDConnection.Select("SELECT * FROM ISP333_VaskovaAN_biblioteka.issuance Inner join trainess left issuance.trainess = trainess.idTrainess where trainess = trainess.idTrainess;"); //?????????

            foreach (DataRow row in data.Rows)
            {
                listIssuance.Add(new DataIssuance(row));
            }
            return(listIssuance);
        }
Esempio n. 5
0
        public static bool Login(string login, string password, out DataUser listUser)
        {
            DataTable data = BDConnection.Select("SELECT * FROM users WHERE login = '******' and password = '******';");

            listUser = null;
            if (data.Rows.Count > 0)
            {
                listUser = new DataUser(data.Rows[0]);
                return(true);
            }
            return(false);
        }
Esempio n. 6
0
 public static void TrainessAdd(int Class, string Family_name, string First_name, string Middle_name)
 {
     BDConnection.Select("INSERT INTO trainesses (`class`, `family_name`, `first_name`, `middle_name`) " +
                         "VALUES ('" + Class + "', '" + Family_name + "', '" + First_name + "', '" + Middle_name + "');");
 }
Esempio n. 7
0
 public void Delete()
 {
     BDConnection.Select("DELETE FROM trainesses WHERE(`idTrainess` = '" + idTrainess + "')");
 }