An aggregator undertakes multiple tasks in smart distribution network such as energy trading, grouping and providing market access to demand response (DR) resources, coordinating distributed generations (DG), efficiently controlling smart appliances of consumers and communicating with the distribution system operator (DSO). In this project, a bi-Ievel model is proposed for a load aggregator of day-ahead energy procurement in a smart distribution system with DR and DG into consideration. The upper level simulates the decision-making process of a load aggregator to maximize its profit through optimal energy purchase and flexible energy management strategy with DG power outputs uncertainties. The decision-maker of the lower level is DSO, who takes the responsibility for the economic dispatch of the distribution system and determines load shedding in a comprehensive way. A single level mixed-integer linear programming (MILP) model is developed for considering two level problems with the idea of mathematical programming problem with equilibrium constraints (MPEC) and Karush-Kuhn-Tucker (KKT) condition. A highly efficient commercial solver CPLEX is utilized to solve the developed model. Finally, a modified IEEE 33-bus distribution system is employed to demonstrate the essential features of the developed model and method.