// 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); }
//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); }
// 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); }
// 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); }
// selectez toate informatiile din inventar_sala public DataTable SelectInventar() { Connection db = new Connection(); string sqlQuery = "SELECT * FROM Inventar_Sala"; return db.Select(sqlQuery, false); }
// 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); }
// selectez toti utilizatorii public DataTable SelectU() { Connection db = new Connection(); string sqlQuery = "SELECT * FROM Users "; return db.Select(sqlQuery, false); }
// 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(); }
// 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(); }