public static BusinessObject.OrderItem ToBusinessObject(Entities.OrderItem entity)
        {
            if (entity == null)
                return null;

            BusinessObject.OrderItem businessObject = new BusinessObject.OrderItem
            {
                CatalogItem = new BusinessObject.CatalogItem(entity.CatalogItemId),
                ItemInscription = entity.ItemInscription,
                OrderId = entity.OrderId,
                OrderItemId = entity.OrderItemId,
                QuantityOrdered = entity.QuantityOrdered
            };

            return businessObject;
        }
        public static BusinessObject.OrderItem ToBusinessObject(Entities.OrderItem entity)
        {
            if (entity == null)
            {
                return(null);
            }

            BusinessObject.OrderItem businessObject = new BusinessObject.OrderItem
            {
                CatalogItem     = new BusinessObject.CatalogItem(entity.CatalogItemId),
                ItemInscription = entity.ItemInscription,
                OrderId         = entity.OrderId,
                OrderItemId     = entity.OrderItemId,
                QuantityOrdered = entity.QuantityOrdered
            };

            return(businessObject);
        }
        public static Entities.OrderItem ToEntity(BusinessObject.OrderItem businessObject)
        {
            if (businessObject == null)
            {
                return(null);
            }

            Entities.OrderItem entity = new Entities.OrderItem
            {
                CatalogItemId   = businessObject.CatalogItem.CatalogItemId,
                ItemInscription = businessObject.ItemInscription,
                OrderId         = businessObject.OrderId,
                OrderItemId     = businessObject.OrderItemId,
                QuantityOrdered = businessObject.QuantityOrdered
            };

            return(entity);
        }
 private void btn_CreateNewOrder_Click(object sender, EventArgs e)
 {
     if (catalogItemCollection.Count > 0)
     {
         Order newOrder = new Order();
         OrderItem newItem = new OrderItem();
         newItem.CatalogItem = catalogItemCollection[cbx_CatalogResultsList.SelectedIndex];
         newOrder.ItemList.Add(newItem);
         _loginForm.ShowOrderForm(userAccount, newOrder, _loginForm);
     }
     else
     {
         _loginForm.ShowOrderForm(userAccount, _loginForm);
     }
     this.Close();
 }