Exemplo n.º 1
0
 public Boolean insertParty(enParty enParty)
 {
     try
     {
         str = "INSERT INTO party (name,status)VALUES(@name,@status);";
         Dbcmd = db.GetSqlStringCommand(str);
         db.AddInParameter(Dbcmd, "@name", DbType.String, enParty.name);
         db.AddInParameter(Dbcmd, "@status", DbType.Int32, enParty.status);
         db.ExecuteNonQuery(Dbcmd);
         return true;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Exemplo n.º 2
0
 public Boolean updateParty(enParty enParty)
 {
     try
     {
         str = "UPDATE party SET [email protected], [email protected] WHERE [email protected];";
         Dbcmd = db.GetSqlStringCommand(str);
         db.AddInParameter(Dbcmd, "@name", DbType.String, enParty.name);
         db.AddInParameter(Dbcmd, "@status", DbType.Int32, enParty.status);
         db.AddInParameter(Dbcmd, "@partyID", DbType.Int32, enParty.partyID);
         db.ExecuteNonQuery(Dbcmd);
         return true;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }