public void Edit(SiloEmptying siloEmptying)
        {
            var currentSiloEmptying = this.GetById(siloEmptying.Id);

            currentSiloEmptying.Date = siloEmptying.Date;

            Uow.SiloEmptyings.Edit(currentSiloEmptying);
            Uow.Commit();
        }
 private void OnSiloEmptyingCreated(SiloEmptying siloEmptying)
 {
     if (SiloEmptyingCreated != null)
     {
         SiloEmptyingCreated(this, siloEmptying);
     }
 }
        private SiloEmptying GetSiloEmptyingCreate()
        {
            var siloEmptying = new SiloEmptying()
            {
                Id = Guid.NewGuid(),
                CreatedDate = DateTime.Now,
                Date = dtpDate.Value.ToZeroTime(),
                IsDeleted = false,
                BatchId = _stateController.CurrentSelectedBatch.Id
            };

            return siloEmptying;
        }
        private void FrmCreateEditSiloEmptying_Load(object sender, EventArgs e)
        {
            var formTitle = "";

            using (var batchService = _serviceFactory.Create<IBatchService>())
            {
                _batch = batchService.GetById(_stateController.CurrentSelectedBatch.Id);
                dtpDate.Value = DateTime.Now;
                formTitle = "Registrar Vaciamiento de Silo";
            }

            if (_emptyingId != Guid.Empty)
            {
                using (var service = _serviceFactory.Create<ISiloEmptyingService>())
                {
                    _siloEmptying = service.GetById(_emptyingId);
                    dtpDate.Value = _siloEmptying.Date;
                    formTitle = "Editar Vaciamiento de Silo";
                }
            }

            this.Text = formTitle;
            txtBatchName.Text = String.Format("Lote {0}", _stateController.CurrentSelectedBatch.Number);
        }
 public void Create(SiloEmptying siloEmptying)
 {
     Uow.SiloEmptyings.Add(siloEmptying);
     Uow.Commit();
 }