Пример #1
0
 public static Order GetOrderDetails(decimal orderId, int incidentId, int contactId)
 {
     Order result;
     try
     {
         result =  new Order(LookupOrder(orderId, incidentId, contactId));
     }
     catch
     {
         result = new Order();
     }
     return result;
 }
Пример #2
0
 internal int SaveParent(SalesOrderViewModel view)
 {
     Order order = new Order();
     order.ATTRIBUTE15 = Convert.ToString(_Model.RntIncidentId);
     order.ContactId = _Model.RntContactId;
     order.IncidentId = _Model.RntIncidentId; 
     foreach (var i in view.Items)
     {
         var item = new OrderItem();
         item.INVENTORY_ITEM_ID = i.InventoryItemId;
         item.ORDERED_QUANTITY = i.Quantity;
         item.UNIT_SELLING_PRICE = i.UnitSellingPrice;
         order.Items.Add(item);
     }
     try
     {
         order.Save();
     }
     catch (Exception e)
     {
         NoticeLog("There was a problem while saving the order. " + e.Message, null);
     }
     view.DateCreated = order.CREATION_DATE;
     view.DateUpdated = order.LAST_UPDATE_DATE;
     view.OrderStatus = order.FLOW_STATUS_CODE;
     return null == order.HEADER_ID ? 0 : (int) order.HEADER_ID;
 }