public int Update(List <PayShiftsDC> objPayDesignations) { int updatedCount = 0; DBConnection objConnection = new DBConnection(); PayShiftsDA objPayShiftsDA = new PayShiftsDA(); try { objConnection.Open(true); updatedCount = objPayShiftsDA.Update(objConnection, objPayDesignations); IsDirty = objPayShiftsDA.IsDirty; if (IsDirty) { objConnection.Rollback(); } else { objConnection.Commit(); } } catch (Exception ex) { objConnection.Rollback(); throw ex; } finally { objConnection.Close(); } return(updatedCount); }
public PayShiftsDC LoadByPrimaryKey(string Code) { DBConnection objConnection = new DBConnection(); PayShiftsDA objPayShiftsDA = new PayShiftsDA(); PayShiftsDC objPayShiftsDC = null; try { objConnection.Open(false); objPayShiftsDC = objPayShiftsDA.LoadByPrimaryKey(objConnection, Code); } catch (Exception ex) { throw ex; } finally { objConnection.Close(); } return(objPayShiftsDC); }
public List <PayShiftsDC> LoadAll() { DBConnection objConnection = new DBConnection(); PayShiftsDA objPayShiftsDA = new PayShiftsDA(); List <PayShiftsDC> objPayShiftsDC = null; try { objConnection.Open(false); objPayShiftsDC = objPayShiftsDA.LoadAll(objConnection); } catch (Exception ex) { throw ex; } finally { objConnection.Close(); } return(objPayShiftsDC); }
public int Insert(List <PayShiftsDC> objPayDesignations) { int insertedCount = 0; DBConnection objConnection = new DBConnection(); PayShiftsDA objPayShiftsDA = new PayShiftsDA(); try { objConnection.Open(true); insertedCount = objPayShiftsDA.Insert(objConnection, objPayDesignations); objConnection.Commit(); } catch (Exception ex) { objConnection.Rollback(); throw ex; } finally { objConnection.Close(); } return(insertedCount); }