Beispiel #1
0
        public int Insert(DBConnection Connection, VEHICLEDC objVEHICLE_VALU)
        {
            int insertCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_VEHICLE_VALUEInsert");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddOutParameter("p_VEHICLE_VALUE_ID", DbType.Int32, objVEHICLE_VALU.VEHICLE_VALUE_ID);
            dbCommandWrapper.AddInParameter("p_VEHICLE_ID", DbType.Int32, objVEHICLE_VALU.VEHICLE_ID);
            dbCommandWrapper.AddInParameter("p_DAILY_ID", DbType.Int32, objVEHICLE_VALU.DAILY_ID);
            dbCommandWrapper.AddInParameter("p_NOTES", DbType.String, objVEHICLE_VALU.NOTES);
            dbCommandWrapper.AddInParameter("p_HOURS", DbType.Decimal, objVEHICLE_VALU.HOURS);
            dbCommandWrapper.AddInParameter("p_CREATED_ON", DbType.DateTime, objVEHICLE_VALU.CREATED_ON);
            dbCommandWrapper.AddInParameter("p_CREATED_BY", DbType.Int32, objVEHICLE_VALU.CREATED_BY);
            dbCommandWrapper.AddInParameter("p_MODIFIED_ON", DbType.DateTime, objVEHICLE_VALU.MODIFIED_ON);
            dbCommandWrapper.AddInParameter("p_MODIFIED_BY", DbType.Int32, objVEHICLE_VALU.MODIFIED_BY);
            dbCommandWrapper.AddInParameter("p_LOCK_COUNTER", DbType.Int32, objVEHICLE_VALU.LOCK_COUNTER);


            if (Connection.Transaction != null)
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                insertCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
            }

            return(insertCount);
        }
Beispiel #2
0
        public int Insert(DBConnection objConnection, VEHICLEDC vehicleDC)
        {
            int       insertedCount     = 0;
            VEHICLEDA objVEHICLE_VALUDA = new VEHICLEDA();

            insertedCount = objVEHICLE_VALUDA.Insert(objConnection, vehicleDC);
            return(insertedCount);
        }
Beispiel #3
0
        public int Update(DBConnection objConnection, VEHICLEDC vehicleDC)
        {
            int       updatedCount      = 0;
            VEHICLEDA objVEHICLE_VALUDA = new VEHICLEDA();

            updatedCount = objVEHICLE_VALUDA.Update(objConnection, vehicleDC);
            return(updatedCount);
        }
Beispiel #4
0
        private VEHICLEDC FillObject(DataRow row)
        {
            VEHICLEDC objVEHICLE_VALU = null;

            objVEHICLE_VALU = new VEHICLEDC();
            objVEHICLE_VALU.VEHICLE_VALUE_ID = (int)row["VEHICLE_VALUE_ID"];
            objVEHICLE_VALU.VEHICLE_ID       = (int)row["VEHICLE_ID"];
            objVEHICLE_VALU.DAILY_ID         = (int)row["DAILY_ID"];
            objVEHICLE_VALU.NOTES            = row["NOTES"] == DBNull.Value ? null : (String)row["NOTES"];
            objVEHICLE_VALU.HOURS            = (Decimal)row["HOURS"];
            objVEHICLE_VALU.CREATED_ON       = (DateTime)row["CREATED_ON"];
            objVEHICLE_VALU.CREATED_BY       = (int)row["CREATED_BY"];
            objVEHICLE_VALU.MODIFIED_ON      = (DateTime)row["MODIFIED_ON"];
            objVEHICLE_VALU.MODIFIED_BY      = (int)row["MODIFIED_BY"];
            objVEHICLE_VALU.LOCK_COUNTER     = (int)row["LOCK_COUNTER"];

            return(objVEHICLE_VALU);
        }
Beispiel #5
0
        private VEHICLEDC FillObject(IDataReader reader)
        {
            VEHICLEDC objVEHICLE_VALU = null;

            if (reader != null && reader.Read())
            {
                objVEHICLE_VALU = new VEHICLEDC();
                objVEHICLE_VALU.VEHICLE_VALUE_ID = (int)reader["VEHICLE_VALUE_ID"];
                objVEHICLE_VALU.VEHICLE_ID       = (int)reader["VEHICLE_ID"];
                objVEHICLE_VALU.DAILY_ID         = (int)reader["DAILY_ID"];
                objVEHICLE_VALU.NOTES            = reader["NOTES"] == DBNull.Value ? null : (String)reader["NOTES"];
                objVEHICLE_VALU.HOURS            = (Decimal)reader["HOURS"];
                objVEHICLE_VALU.CREATED_ON       = (DateTime)reader["CREATED_ON"];
                objVEHICLE_VALU.CREATED_BY       = (int)reader["CREATED_BY"];
                objVEHICLE_VALU.MODIFIED_ON      = (DateTime)reader["MODIFIED_ON"];
                objVEHICLE_VALU.MODIFIED_BY      = (int)reader["MODIFIED_BY"];
                objVEHICLE_VALU.LOCK_COUNTER     = (int)reader["LOCK_COUNTER"];

                reader.Close();
                reader.Dispose();
            }
            return(objVEHICLE_VALU);
        }
Beispiel #6
0
        private int Delete(DBConnection Connection, VEHICLEDC objVEHICLE_VALU)
        {
            int deleteCount = 0;

            StringBuilder sql = new StringBuilder();

            sql.Append("proc_VEHICLE_VALUEDelete");

            DBCommandWarpper dbCommandWrapper = new DBCommandWarpper(Connection.dataBase.GetStoredProcCommand(sql.ToString()), Connection);

            dbCommandWrapper.AddInParameter("p_VEHICLE_VALUE_ID", DbType.Int32, objVEHICLE_VALU.VEHICLE_VALUE_ID);

            if (Connection.Transaction != null)
            {
                deleteCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand, Connection.Transaction);
            }
            else
            {
                deleteCount = Connection.dataBase.ExecuteNonQuery(dbCommandWrapper.DBCommand);
            }

            return(deleteCount);
        }