Пример #1
0
        /// <summary>
        /// Abre a tela para buscar uma Peça
        /// </summary>
        private void AbreTelaBuscaPeca()
        {
            frmBuscaPeca telaPeca = null;

            try
            {
                this._modelPeca = new mPeca();
                telaPeca        = new frmBuscaPeca(this._modelPeca);
                DialogResult resultado = telaPeca.ShowDialog();
                if (resultado == DialogResult.Cancel)
                {
                    this._modelPeca = null;
                }
                else
                {
                    this.txtBuscaFiltro.Text = this._modelPeca.IdPecaReal + " - " + this._modelPeca.Nom;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                telaPeca = null;
            }
        }
 private void btnBuscaPeca_Click(object sender, EventArgs e)
 {
     this._modelPeca = new mPeca();
     frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca);
     try
     {
         DialogResult resultado = objForm.ShowDialog();
         if (resultado == DialogResult.Cancel)
         {
             this._modelPeca = null;
             this.txtNomePeca.Text = string.Empty;
         }
         else
         {
             this.txtNomePeca.Text = this._modelPeca.Nom;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         objForm = null;
     }
 }
Пример #3
0
        private void btnBuscaPeca_Click(object sender, EventArgs e)
        {
            this.btnLimpa_Click(null, null);
            this._modelPeca = new mPeca();
            frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca);

            try
            {
                DialogResult resultado = objForm.ShowDialog();
                if (resultado == DialogResult.Cancel)
                {
                    this._modelPeca = null;
                }
                else
                {
                    this.txtPeca.Text = this._modelPeca.Nom;
                    this.MarcaPecaEstoque();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objForm = null;
            }
        }
Пример #4
0
        private void btnBuscaPeca_Click(object sender, EventArgs e)
        {
            this._modelPeca = new List <mPeca>();
            frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca, true, false);

            try
            {
                DialogResult resultado = objForm.ShowDialog();
                if (resultado == DialogResult.Cancel)
                {
                    this._modelPeca = null;
                }
                else
                {
                    for (int contador = 0; contador < this._modelPeca.Count; contador++)
                    {
                        if (contador == 0)
                        {
                            this.txtCdPeca.Text = this._modelPeca[contador].Nom;
                        }
                        else
                        {
                            this.txtCdPeca.Text += this._modelPeca[contador].Nom;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #5
0
        private void btnBuscaPeca_Click(object sender, EventArgs e)
        {
            this._modelPeca = new mPeca();
            frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca);

            try
            {
                DialogResult resultado = objForm.ShowDialog();
                if (resultado == DialogResult.Cancel)
                {
                    this._modelPeca       = null;
                    this.txtNomePeca.Text = string.Empty;
                }
                else
                {
                    this.txtNomePeca.Text = this._modelPeca.Nom;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objForm = null;
            }
        }
Пример #6
0
        private void btnBuscaPeca_Click(object sender, EventArgs e)
        {
            this._modelPeca = new List <mPeca>();
            frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca, true, false);

            try
            {
                DialogResult resultado = objForm.ShowDialog();
                if (resultado == DialogResult.Cancel)
                {
                    this._modelPeca = null;
                }
                else
                {
                    this.txtPeca.Text = this._modelPeca[0].Nom;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objForm = null;
            }
        }
 private void btnBuscaPeca_Click(object sender, EventArgs e)
 {
     this._modelPeca = new List<mPeca>();
     frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca, true, false);
     try
     {
         DialogResult resultado = objForm.ShowDialog();
         if (resultado == DialogResult.Cancel)
         {
             this._modelPeca = null;
         }
         else
         {
             for (int contador = 0; contador < this._modelPeca.Count; contador++)
             {
                 if (contador == 0)
                 {
                     this.txtCdPeca.Text = this._modelPeca[contador].Nom;
                 }
                 else
                 {
                     this.txtCdPeca.Text += this._modelPeca[contador].Nom;
                 }
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void btnBuscaPeca_Click(object sender, EventArgs e)
 {
     this._modelPeca = new List<mPeca>();
     frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca, true, false);
     try
     {
         DialogResult resultado = objForm.ShowDialog();
         if (resultado == DialogResult.Cancel)
         {
             this._modelPeca = null;
         }
         else
         {
             this.txtPeca.Text = this._modelPeca[0].Nom;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         objForm = null;
     }
 }
Пример #9
0
        private void btnCdPeca_Click(object sender, EventArgs e)
        {
            mUsinagem modelUsinagem = new mUsinagem();
            rUsinagem regraUsinagem = new rUsinagem();

            this._modelPeca = new List <mPeca>();
            frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca, true, false);

            try
            {
                DialogResult resultado = objForm.ShowDialog();
                if (resultado == DialogResult.Cancel)
                {
                    this._modelPeca = null;
                }
                else
                {
                    this.txtCdPeca.Text = this._modelPeca[0].Nom;
                }

                this.ValidaDadosNulos();
                modelUsinagem = this.PegaDadosTela();
                regraUsinagem.ValidarInsere(modelUsinagem);
            }
            catch (BUSINESS.Exceptions.CodigoPecaVazioExeception)
            {
                MessageBox.Show("É Necessário Buscar o código da Peça", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
            }

            catch (BUSINESS.Exceptions.Validacoes.MaskedInvalidaException)
            {
                MessageBox.Show("É Necessário Selecionar o check de Peça OK", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
                //throw ex;
            }
            finally
            {
                objForm = null;
            }
        }
        private void btnCdPeca_Click(object sender, EventArgs e)
        {
            mUsinagem modelUsinagem = new mUsinagem();
            rUsinagem regraUsinagem = new rUsinagem();

            this._modelPeca = new List<mPeca>();
            frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca, true, false);
            try
            {
                DialogResult resultado = objForm.ShowDialog();
                if (resultado == DialogResult.Cancel)
                {
                    this._modelPeca = null;
                }
                else
                {
                    this.txtCdPeca.Text = this._modelPeca[0].Nom;
                }

                this.ValidaDadosNulos();
                modelUsinagem = this.PegaDadosTela();
                regraUsinagem.ValidarInsere(modelUsinagem);

            }
            catch (BUSINESS.Exceptions.CodigoPecaVazioExeception)
            {
                MessageBox.Show("É Necessário Buscar o código da Peça", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
            }

            catch (BUSINESS.Exceptions.Validacoes.MaskedInvalidaException)
            {
                MessageBox.Show("É Necessário Selecionar o check de Peça OK", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
            }

            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
                //throw ex;
            }
            finally
            {
                objForm = null;
            }
        }
 private void btnBuscaPeca_Click(object sender, EventArgs e)
 {
     this.btnLimpa_Click(null, null);
     this._modelPeca = new mPeca();
     frmBuscaPeca objForm = new frmBuscaPeca(this._modelPeca);
     try
     {
         DialogResult resultado = objForm.ShowDialog();
         if (resultado == DialogResult.Cancel)
         {
             this._modelPeca = null;
         }
         else
         {
             this.txtPeca.Text = this._modelPeca.Nom;
             this.MarcaPecaEstoque();
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         objForm = null;
     }
 }
 /// <summary>
 /// Abre a tela para buscar uma Peça
 /// </summary>
 private void AbreTelaBuscaPeca()
 {
     frmBuscaPeca telaPeca = null;
     try
     {
         this._modelPeca = new mPeca();
         telaPeca = new frmBuscaPeca(this._modelPeca);
         DialogResult resultado = telaPeca.ShowDialog();
         if (resultado == DialogResult.Cancel)
         {
             this._modelPeca = null;
         }
         else
         {
             this.txtBuscaFiltro.Text = this._modelPeca.IdPecaReal + " - " + this._modelPeca.Nom;
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
     finally
     {
         telaPeca = null;
     }
 }