Esempio n. 1
0
 public InvoiceOperationResponse ProcessRequest(InvoiceOperationRequest request)
 {
     var result = new InvoiceOperationResponse();
     switch (request.Action){
         case DataAction.Create:
             SaveEntity(request.Invoice.ToEntity());
             break;
         case DataAction.Read:
             result.Invoices = ReadInvoices(request.InvoiceId,request.CustomerId);
             return result;
         case DataAction.Update:
             result.Invoices = UpdateEntity<Invoice,InvoiceContract>(request.Invoice);
             break;
         case DataAction.Delete:
             DeleteEntity<Customer>(request.InvoiceId);
             break;
     }
     try
     {
         Singletone.Instance.Context.SaveChanges();
     }
     catch (Exception e)
     {
         throw e;
     }
     return result;
 }
Esempio n. 2
0
 public InvoiceOperationResponse InvoiceOperation(InvoiceOperationRequest message)
 {
     return new InvoiceDao().ProcessRequest(message);
 }