Beispiel #1
0
 public Boolean insertSocialTax(enSocialTax enSocialTax)
 {
     try
     {
         str = "INSERT INTO socialTax (";
         str += "personalID,";
         str += "socialTaxIDCard,";
         str += "hospitalCode,";
         str += "hospital";
         str += ")VALUES(";
         str += "@personalID,";
         str += "@socialTaxIDCard,";
         str += "@hospitalCode,";
         str += "@hospital";
         str += ");";
         Dbcmd = db.GetSqlStringCommand(str);
         db.AddInParameter(Dbcmd, "@personalID", DbType.Int32, enSocialTax.personalID);
         db.AddInParameter(Dbcmd, "@socialTaxIDCard", DbType.String, enSocialTax.socialTaxIDCard);
         db.AddInParameter(Dbcmd, "@hospitalCode", DbType.String, enSocialTax.hospitalCode);
         db.AddInParameter(Dbcmd, "@hospital", DbType.String, enSocialTax.hospital);
         db.ExecuteNonQuery(Dbcmd);
         return true;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Beispiel #2
0
 public Boolean updateSocialTax(enSocialTax enSocialTax)
 {
     try
     {
         str = "UPDATE socialTax SET ";
         str += "personalID=@personalID,";
         str += "socialTaxIDCard=@socialTaxIDCard,";
         str += "hospitalCode=@hospitalCode,";
         str += "hospital=@hospital";
         str += " WHERE socialTaxID=@socialTaxID;";
         Dbcmd = db.GetSqlStringCommand(str);
         db.AddInParameter(Dbcmd, "@personalID", DbType.Int32, enSocialTax.personalID);
         db.AddInParameter(Dbcmd, "@socialTaxIDCard", DbType.String, enSocialTax.socialTaxIDCard);
         db.AddInParameter(Dbcmd, "@hospitalCode", DbType.String, enSocialTax.hospitalCode);
         db.AddInParameter(Dbcmd, "@hospital", DbType.String, enSocialTax.hospital);
         db.AddInParameter(Dbcmd, "@socialTaxID", DbType.Int32, enSocialTax.socialTaxID);
         db.ExecuteNonQuery(Dbcmd);
         return true;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }