Exemplo n.º 1
0
 //update a type
 public static bool UpdateType(RiskType type)
 {
     MySqlParameter[] parms = new MySqlParameter[] { 
         new MySqlParameter(PARAM_TYPENUMBER, type.TypeNumber),
         new MySqlParameter(PARAM_TYPENAME, type.TypeName)};
     return MySqlHelper.ExecuteNonQuery(MySqlHelper.CONN_STR, CommandType.Text, UPDATE_TYPE, parms);
 }
Exemplo n.º 2
0
 //Get type by id from database
 public static bool GetTypeByNumber(String TypeNumber, out RiskType type)
 {
     MySqlParameter parm = new MySqlParameter(PARAM_TYPENUMBER, MySqlDbType.VarChar, 45);
     parm.Value = TypeNumber;
     using (MySqlDataReader sdr = MySqlHelper.ExecuteReader(MySqlHelper.CONN_STR, CommandType.Text, SELECT_TYPE_BY_TYPENAME, parm))
     {
         if (sdr.Read())
         {
             type = new RiskType(sdr.GetString(0), sdr.GetString(1));
             return true;
         }
         else
         {
             type = null;
             return false;
         }
     }
 }