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