コード例 #1
0
        // sterg o sala,inclusiv informatiile din inventar referitoare la sala respectiva
        public bool DeleteSalaa()
        {
            Connection db = new Connection();

            Dictionary<string, string> parameters2 = new Dictionary<string, string>();
            parameters2.Add("@ID_S", sv.getID_SALA().ToString());

            return db.InsertUpdateDelete("DeleteSalaa", parameters2, true);
        }
コード例 #2
0
        //inserez o sala
        public bool InsertSala()
        {
            Connection db = new Connection();

            Dictionary<string, string> parameters2 = new Dictionary<string, string>();
            parameters2.Add("@ID_S", sv.getID_SALA().ToString());
            parameters2.Add("@Nume_Sala", sv.getNumeS());
            parameters2.Add("@Responsabil", sv.getResp());

            return db.InsertUpdateDelete("InsertS", parameters2, true);
        }
コード例 #3
0
        // inserez in inventarul unei sali
        public bool InsertInventar()
        {
            Connection db = new Connection();

            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add("@ID_S", inv.getID().ToString());
            parameters.Add("@Numar_Scaune", inv.getScaune().ToString());
            parameters.Add("@Numar_Mese", inv.getMese().ToString());
            parameters.Add("@Numar_calculatoare", inv.getCalc().ToString());

            return db.InsertUpdateDelete("InsertInventar", parameters, true);
        }
コード例 #4
0
        // insereaza un user
        public bool InsertUser()
        {
            Connection db = new Connection();

            string sqlQuery = "INSERT INTO Users ";
            sqlQuery += "(ID_U, Username, Password) ";
            sqlQuery += "VALUES ";
            sqlQuery += "(@ID_U, @Username, @Password)";

            Dictionary<string, string> parameters = new Dictionary<string, string>();
            parameters.Add("@ID_U", us.getID().ToString());
            parameters.Add("@Username", us.getUsername());
            parameters.Add("@Password", EncryptPassword(us.getPassword()));

            return db.InsertUpdateDelete(sqlQuery, parameters, false);
        }
コード例 #5
0
        // selectez toate informatiile din inventar_sala
        public DataTable SelectInventar()
        {
            Connection db = new Connection();

            string sqlQuery = "SELECT * FROM Inventar_Sala";

            return db.Select(sqlQuery, false);
        }
コード例 #6
0
        // modific informatii despre o sala, inclusiv despre inventarul acesteia
        public bool UpdateSali()
        {
            Connection db = new Connection();

            Dictionary<string, string> parameters2 = new Dictionary<string, string>();
            parameters2.Add("@ID_S", sv.getID_SALA().ToString());
            parameters2.Add("@Nume_Sala", sv.getNumeS());
            parameters2.Add("@Responsabil", sv.getResp());
            parameters2.Add("@Numar_Scaune", inv.getScaune().ToString());
            parameters2.Add("@Numar_Mese", inv.getMese().ToString());
            parameters2.Add("@Numar_calculatoare", inv.getCalc().ToString());

            return db.InsertUpdateDelete("UpdateSala", parameters2, true);
        }
コード例 #7
0
        // selectez toti utilizatorii
        public DataTable SelectU()
        {
            Connection db = new Connection();

            string sqlQuery = "SELECT * FROM Users ";

            return db.Select(sqlQuery, false);
        }
コード例 #8
0
        // selectez o sala dupa id
        public DataRow SelectSalaById()
        {
            Connection db = new Connection();

            Dictionary<string, string> parameters2 = new Dictionary<string, string>();
            parameters2.Add("@ID_S", sv.getID_SALA().ToString());

            return db.Select("SelID_S", true, parameters2).AsEnumerable().First();
        }
コード例 #9
0
        // selectez dupa id o intrare din tabela inventar_sala
        public DataRow SelectInventarId()
        {
            Connection db = new Connection();

            Dictionary<string, string> parameters2 = new Dictionary<string, string>();
            parameters2.Add("@ID_S", inv.getID().ToString());

            return db.Select("SelInvID", true, parameters2).AsEnumerable().First();
        }