public int Update(List <PayLeavesDC> objPayDesignations) { int updatedCount = 0; DBConnection objConnection = new DBConnection(); PayLeavesDA objPayLeavesDA = new PayLeavesDA(); try { objConnection.Open(true); updatedCount = objPayLeavesDA.Update(objConnection, objPayDesignations); IsDirty = objPayLeavesDA.IsDirty; if (IsDirty) { objConnection.Rollback(); } else { objConnection.Commit(); } } catch (Exception ex) { objConnection.Rollback(); throw ex; } finally { objConnection.Close(); } return(updatedCount); }