Пример #1
0
 public void Create(Shift shift)
 {
     Uow.Shifts.Add(shift);
     Uow.Commit();
 }
Пример #2
0
        private void FrmAddStock_Load(object sender, EventArgs e)
        {
            using (var depositService = _serviceFactory.Create<IDepositService>())
            {
                var deposits = depositService.GetAll().OrderBy(x => x.Name).ToList();
                ucDepositSelection.Deposits = deposits;
            }

            using (var productService = _serviceFactory.Create<IProductService>())
            {
                var products = productService.GetAll().OrderBy(x => x.Name).ToList();
                ddlProducts.ValueMember = "Id";
                ddlProducts.DisplayMember = "Name";

                var product = new Product();
                product.Id = Guid.Empty;
                product.Name = "Seleccione un producto..";
                products.Insert(0, product);

                ddlProducts.DataSource = products;
            }

            using (var providerService = _serviceFactory.Create<IProviderService>())
            {
                var providers = providerService.GetAll().OrderBy(x => x.Name).ToList();
                ddlProviders.ValueMember = "Id";
                ddlProviders.DisplayMember = "Name";

                var provider = new Provider();
                provider.Id = Guid.Empty;
                provider.Name = "Seleccione un proveedor..";
                providers.Insert(0, provider);

                ddlProviders.DataSource = providers;
            }

            using (var shiftService = _serviceFactory.Create<IShiftService>())
            {
                var shifts = shiftService.GetAll().OrderBy(x => x.Name).ToList();
                ddlShifts.ValueMember = "Id";
                ddlShifts.DisplayMember = "Name";

                var shift = new Shift();
                shift.Id = Guid.Empty;
                shift.Name = "Seleccione un turno..";
                shifts.Insert(0, shift);

                ddlShifts.DataSource = shifts;
            }
        }