示例#1
0
 public Boolean insertPersonalType(enPersonalType enPersonalType)
 {
     try
     {
         str = "INSERT INTO personalType (personalType,status)VALUES(@personalType,@status);";
         Dbcmd = db.GetSqlStringCommand(str);
         db.AddInParameter(Dbcmd, "@personalType", DbType.String, enPersonalType.personalType);
         db.AddInParameter(Dbcmd, "@status", DbType.Int32, enPersonalType.status);
         db.ExecuteNonQuery(Dbcmd);
         return true;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
示例#2
0
 public Boolean updatePersonalType(enPersonalType enPersonalType)
 {
     try
     {
         str = "UPDATE personalType SET personalType=@personalType, status=@status WHERE personalTypeID=@personalTypeID;";
         Dbcmd = db.GetSqlStringCommand(str);
         db.AddInParameter(Dbcmd, "@personalType", DbType.String, enPersonalType.personalType);
         db.AddInParameter(Dbcmd, "@status", DbType.Int32, enPersonalType.status);
         db.AddInParameter(Dbcmd, "@personalTypeID", DbType.Int32, enPersonalType.personalTypeID);
         db.ExecuteNonQuery(Dbcmd);
         return true;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }