public void Validate()
 {
     GenieLamp.Examples.QuickStart.Services.Interfaces.QuickStart.PurchaseOrderRequest request = new GenieLamp.Examples.QuickStart.Services.Interfaces.QuickStart.PurchaseOrderRequest();
     request.ValidateParams   = new GenieLamp.Examples.QuickStart.Services.Interfaces.QuickStart.PurchaseOrderValidateParams();
     request.PurchaseOrderDTO = this.DTO;
     GenieLamp.Examples.QuickStart.Services.Interfaces.QuickStart.PurchaseOrderResponse response = WebClientFactory.GetJsonClient()
                                                                                                   .Post <GenieLamp.Examples.QuickStart.Services.Interfaces.QuickStart.PurchaseOrderResponse>("/PurchaseOrderService/Validate", request);
     if (response.ResponseStatus.ErrorCode == "400")
     {
         throw new Exception(response.ResponseStatus.Message);
     }
     this.DTO = response.PurchaseOrderDTO;
 }
 public static PurchaseOrder GetByNumber(string number)
 {
     GenieLamp.Examples.QuickStart.Services.Interfaces.QuickStart.PurchaseOrderDTO dto = WebClientFactory.GetJsonClient()
                                                                                         .Get <GenieLamp.Examples.QuickStart.Services.Interfaces.QuickStart.PurchaseOrderResponse>(String.Format("/PurchaseOrderService/Number/{0}", number))
                                                                                         .PurchaseOrderDTO;
     return(dto == null ? null : new PurchaseOrder(dto));
 }
            public virtual void Refresh()
            {
                PurchaseOrder o = PurchaseOrder.GetById(this.Id);

                this.DTO = o != null && o.DTO != null ? o.DTO : new GenieLamp.Examples.QuickStart.Services.Interfaces.QuickStart.PurchaseOrderDTO();
            }
 public PurchaseOrder(GenieLamp.Examples.QuickStart.Services.Interfaces.QuickStart.PurchaseOrderDTO dto) : base(dto)
 {
 }