Пример #1
0
 private void lvwSalesman_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (lvwSalesman.Items.Count > 0)
     {
         if (formMode == FormMode.Add || formMode == FormMode.Edit)
         {
         }
         else
         {
             Salesman salesman = salesmanRepository.GetById(new Guid(lvwSalesman.FocusedItem.Text));
             ViewSalesmanDetail(salesman);
         }
     }
 }
        public IOrder CreateOrder(List <string> productsIds, decimal unitPrice, string salesmanId)
        {
            IOrder order = _salesFactory.CreateOrder(unitPrice);

            foreach (var id in productsIds)
            {
                order.AddProduct(id);
            }

            ISalesman salesman = _salesmanRepository.GetById(salesmanId);

            salesman.AddToYearQuota(order.GetTotalPrice());

            _orderRepository.Add(order);
            return(order);
        }