private Boolean Update(Database db) { try { db.Command.CommandType = CommandType.StoredProcedure; db.Command.CommandText = "tblProgramUpdate"; base.Initialize(db.Command, base.Id); db.Command.Parameters.Add("@Name", SqlDbType.VarChar).Value = _Name; db.ExecuteNonQuery(); base.Initialize(db.Command); return true; } catch (Exception ex) { throw; } }
private Boolean Delete(Database db) { try { db.Command.CommandType = CommandType.StoredProcedure; db.Command.CommandText = "tblProgramDelete"; base.Initialize(db.Command, base.Id); db.ExecuteNonQuery(); base.Initialize(db.Command); return true; } catch (Exception ex) { throw; } }
private Boolean Insert(Database db) { try { db.Command.CommandType = CommandType.StoredProcedure; db.Command.CommandText = "tblPhoneTypeInsert"; base.Initialize(db.Command, Guid.Empty); db.Command.Parameters.Add("@Type", SqlDbType.VarChar).Value = _Type; db.ExecuteNonQuery(); base.Initialize(db.Command); return true; } catch (Exception ex) { throw; } }
public Student ChangePassword(string newpassword) { Database db = new Database("student"); try { db.Command.CommandType = CommandType.StoredProcedure; db.Command.CommandText = "tblStudentChangePassword"; base.Initialize(db.Command, base.Id); db.Command.Parameters.Add("@Password", SqlDbType.VarChar).Value = newpassword; db.ExecuteNonQuery(); base.Initialize(db.Command); return this; } catch (Exception ex) { throw; } }
private bool Update(Database db) { try { db.Command.CommandType = CommandType.StoredProcedure; db.Command.CommandText = "tblClient_UPDATE"; base.Initialize(db.Command, base.Id); db.Command.Parameters.Add("@FirstName", SqlDbType.VarChar).Value = _FirstName; db.Command.Parameters.Add("@LastName", SqlDbType.VarChar).Value = _LastName; db.ExecuteNonQuery(); base.Initialize(db.Command); return true; } catch (Exception e) { return false; } }
private bool Delete(Database db) { try { db.Command.CommandType = CommandType.StoredProcedure; db.Command.CommandText = "tblClient_DELETE"; base.Initialize(db.Command, base.Id); db.ExecuteNonQuery(); base.Initialize(db.Command); return true; } catch (Exception e) { return false; } }