//Método Atualizar Quantidade Estoque private void Atualizar() { Estoque dto = new Estoque(); BllEstoque bll = new BllEstoque(); dto.Operacao = "Atualizar"; dto.EstoqueId = Convert.ToInt32(txtCodigo.Text); dto.FuncionarioId = Convert.ToInt32(_IdGlobal); dto.Quantidade = Convert.ToInt32(txtEstoq.Text); try { string retorno = bll.Atualizar(dto); MessageBox.Show(retorno, "Informação", MessageBoxButtons.OK, MessageBoxIcon.Information); this.DialogResult = DialogResult.Yes; LimparCampos(); } catch (Exception ex) { MessageBox.Show(ex.Message); this.DialogResult = DialogResult.No; } }
// Metodo ReserverPedido private void ReservarEstoque() { if (Convert.ToInt32(txtEstok.Text) < 1) { errorP.SetError(txtEstok, "Estoque Insuficiente"); } else { if ((txtQtd.Text != string.Empty) && Convert.ToInt32(txtEstok.Text) < 1) { errorP.SetError(txtEstok, "Estoque Insuficiente"); } else { BllEstoque bll = new BllEstoque(); Estoque dto = new Estoque(); dto.Operacao = "ReservarEstoque"; dto.Quantidade = Convert.ToInt32(txtQtd.Text); dto.EstoqueId = Convert.ToInt32(txtCod.Text); dto.FuncionarioId = Convert.ToInt32(_IdGlobal); //ID do funcionário string retorno = bll.Atualizar(dto); try { int id = Convert.ToInt32(retorno); if ((id > 0) && (dto.FuncionarioId > 0)) { AddCarrinho(); MEstoque f = new MEstoque(null, null, null, AcaoNaTela.Pesquisar); MEstoqueOpera m = new MEstoqueOpera(); // m.Lis(); } } catch { FNotificao.AlerForm(" Erro Ao Adicionar o Fármaco Nº: " + retorno.ToString(), TipoNotificacao.erro); } } } }
// Metodo Cancelar Pedido private void RetornoEstoque() { BllEstoque bll = new BllEstoque(); Estoque dto = new Estoque(); dto.Operacao = "RetornoEstoque"; dto.Quantidade = Convert.ToInt32(dgv.CurrentRow.Cells[4].Value); dto.EstoqueId = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value); dto.FuncionarioId = Convert.ToInt32(_IdGlobal); //Código do Funcionario string retorno = bll.Atualizar(dto); try { int id = Convert.ToInt32(retorno); if ((id > 0) && (dto.FuncionarioId > 0)) { RemoverIten(); } } catch { FNotificao.AlerForm(retorno.ToString(), TipoNotificacao.erro); } }