public PayLeavesDC LoadByPrimaryKey(string Code) { DBConnection objConnection = new DBConnection(); PayLeavesDA objPayLeavesDA = new PayLeavesDA(); PayLeavesDC objPayLeavesDC = null; try { objConnection.Open(false); objPayLeavesDC = objPayLeavesDA.LoadByPrimaryKey(objConnection, Code); } catch (Exception ex) { throw ex; } finally { objConnection.Close(); } return(objPayLeavesDC); }