コード例 #1
0
 private bool ValidaCampos()
 {
     using (var oDB = new CFornecimentoMaterial.CFornecimentoMaterialClient())
     {
         if (oDB.FornecimentoExiste(Convert.ToInt32(txtFornecimento.Text)) == false)
         {
             MessageBox.Show("O Fornecimento não existe", "Aviso",
                             MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                             MessageBoxDefaultButton.Button1);
             return(false);
         }
     }
     if (txtFornecimento.Text == "")
     {
         MessageBox.Show("O campo Fornecimento é de preenchimento obrigatório", "Aviso",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                         MessageBoxDefaultButton.Button1);
         return(false);
     }
     else if (txtValor.Text == "")
     {
         MessageBox.Show("O campo Valor é de preenchimento obrigatório", "Aviso",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                         MessageBoxDefaultButton.Button1);
         return(false);
     }
     return(true);
 }
コード例 #2
0
 private bool ValidaCampos()
 {
     using (var oDB = new CFornecimentoMaterial.CFornecimentoMaterialClient())
     {
         if (oDB.FornecimentoExiste(Convert.ToInt32(txtFornecimento.Text)) == false)
         {
             MessageBox.Show("O Fornecimento não existe", "Aviso",
                             MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                             MessageBoxDefaultButton.Button1);
             return false;
         }
     }
     if (txtFornecimento.Text == "")
     {
         MessageBox.Show("O campo Fornecimento é de preenchimento obrigatório", "Aviso",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                         MessageBoxDefaultButton.Button1);
         return false;
     }
     else if (txtValor.Text == "")
     {
         MessageBox.Show("O campo Valor é de preenchimento obrigatório", "Aviso",
                         MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                         MessageBoxDefaultButton.Button1);
         return false;
     }
     return true;
 }
コード例 #3
0
 private void fornecimentoMaterialBindingNavigatorSaveItem_Click(object sender, EventArgs e)
 {
     using (var oDB = new CFornecimentoMaterial.CFornecimentoMaterialClient())
     {
         if (txtID.Text != "")
         {
             if (oDB.FornecimentoExiste(Convert.ToInt32(txtID.Text)) == false)
             {
                 MessageBox.Show("O Fornecimento não existe", "Aviso",
                                 MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                                 MessageBoxDefaultButton.Button1);
             }
             else
             {
                 var result = MensagemErro.Erro(oDB.CancelarFornecimento(Convert.ToInt32(txtID.Text), chkCancelar.Checked));
                 if (result)
                     MensagemAviso.MensagemUsuario(1, "Cancelamento");
             }
         }
         AtualizaDataSource();
     }
 }
コード例 #4
0
 private void fornecimentoMaterialBindingNavigatorSaveItem_Click(object sender, EventArgs e)
 {
     using (var oDB = new CFornecimentoMaterial.CFornecimentoMaterialClient())
     {
         if (txtID.Text != "")
         {
             if (oDB.FornecimentoExiste(Convert.ToInt32(txtID.Text)) == false)
             {
                 MessageBox.Show("O Fornecimento não existe", "Aviso",
                                 MessageBoxButtons.OK, MessageBoxIcon.Exclamation,
                                 MessageBoxDefaultButton.Button1);
             }
             else
             {
                 var result = MensagemErro.Erro(oDB.CancelarFornecimento(Convert.ToInt32(txtID.Text), chkCancelar.Checked));
                 if (result)
                 {
                     MensagemAviso.MensagemUsuario(1, "Cancelamento");
                 }
             }
         }
         AtualizaDataSource();
     }
 }