Beispiel #1
0
 public Boolean insertPromoted(enPromoted enPromoted)
 {
     try
     {
         str = "INSERT INTO promoted (personalID,updateDate,oldSalary,newSalary,oldPositionID,oldPositionDetail,newPositionID,newPositionDetail,remark)VALUES(@personalID,@updateDate,@oldSalary,@newSalary,@oldPositionID,@oldPositionDetail,@newPositionID,@newPositionDetail,@remark);";
         Dbcmd = db.GetSqlStringCommand(str);
         db.AddInParameter(Dbcmd, "@personalID", DbType.Int32, enPromoted.personalID);
         db.AddInParameter(Dbcmd, "@updateDate", DbType.DateTime, enPromoted.updateDate);
         db.AddInParameter(Dbcmd, "@oldSalary", DbType.Double, enPromoted.oldSalary);
         db.AddInParameter(Dbcmd, "@newSalary", DbType.Double, enPromoted.newSalary);
         db.AddInParameter(Dbcmd, "@oldPositionID", DbType.Int32, enPromoted.oldPositionID);
         db.AddInParameter(Dbcmd, "@oldPositionDetail", DbType.String, enPromoted.oldPositionDetail);
         db.AddInParameter(Dbcmd, "@newPositionID", DbType.Int32, enPromoted.newPositionID);
         db.AddInParameter(Dbcmd, "@newPositionDetail", DbType.String, enPromoted.newPositionDetail);
         db.AddInParameter(Dbcmd, "@remark", DbType.String, enPromoted.remark);
         db.ExecuteNonQuery(Dbcmd);
         return true;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
Beispiel #2
0
 public Boolean updatePromoted(enPromoted enPromoted)
 {
     try
     {
         str = "UPDATE promoted SET personalID=@personalID,updateDate=@updateDate,oldSalary=@oldSalary,newSalary=@newSalary,oldPositionID=@oldPositionID,oldPositionDetail=@oldPositionDetail,newPositionID=@newPositionID,newPositionDetail=@newPositionDetail,remark=@remark WHERE promotedID=@promotedID;";
         Dbcmd = db.GetSqlStringCommand(str);
         db.AddInParameter(Dbcmd, "@personalID", DbType.Int32, enPromoted.personalID);
         db.AddInParameter(Dbcmd, "@updateDate", DbType.DateTime, enPromoted.updateDate);
         db.AddInParameter(Dbcmd, "@oldSalary", DbType.Double, enPromoted.oldSalary);
         db.AddInParameter(Dbcmd, "@newSalary", DbType.Double, enPromoted.newSalary);
         db.AddInParameter(Dbcmd, "@oldPositionID", DbType.Int32, enPromoted.oldPositionID);
         db.AddInParameter(Dbcmd, "@oldPositionDetail", DbType.String, enPromoted.oldPositionDetail);
         db.AddInParameter(Dbcmd, "@newPositionID", DbType.Int32, enPromoted.newPositionID);
         db.AddInParameter(Dbcmd, "@newPositionDetail", DbType.String, enPromoted.newPositionDetail);
         db.AddInParameter(Dbcmd, "@remark", DbType.String, enPromoted.remark);
         db.AddInParameter(Dbcmd, "@promotedID", DbType.Int32, enPromoted.promotedID);
         db.ExecuteNonQuery(Dbcmd);
         return true;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }