コード例 #1
0
        private void btnNovo_Click(object sender, EventArgs e)
        {
            FrmCadastroServico cadastroServico = new FrmCadastroServico();

            cadastroServico.NovoCadastro = true;
            cadastroServico.ShowDialog();
        }
コード例 #2
0
        public void CriarServicoPeloOrcamento(int orc)
        {
            FrmCadastroServico cadastroServico = new FrmCadastroServico()
            {
                Orcamento = orc, NovoCadastro = true
            };

            cadastroServico.ShowDialog();
        }
コード例 #3
0
 private void btnAlterar_Click(object sender, EventArgs e)
 {
     if (usar.Equals("1"))
     {
         string input = Interaction.InputBox("Informe a senha:", "Alterar", "*", 100, 200);
         if (input != "")
         {
             if (input == Senha)
             {
                 var servico = (tcc_ServicoBindingSource.Current as DataRowView).Row as Banco.tcc_ServicoRow;
                 FrmCadastroServico cadastroServico = new FrmCadastroServico()
                 {
                     Orcamento    = servico.IDOrcamento,
                     mecanico     = servico.IDMecanico,
                     NovoCadastro = false
                 };
                 cadastroServico.Alterar(servico.razaoSocial, servico.dataInicio);
                 cadastroServico.ShowDialog();
             }
             else
             {
                 MessageBox.Show("Senha incorreta", "Erro ao alterar",
                                 MessageBoxButtons.OK, MessageBoxIcon.Error);
             }
         }
     }
     else
     {
         var servico = (tcc_ServicoBindingSource.Current as DataRowView).Row as Banco.tcc_ServicoRow;
         FrmCadastroServico cadastroServico = new FrmCadastroServico()
         {
             Orcamento    = servico.IDOrcamento,
             mecanico     = servico.IDMecanico,
             NovoCadastro = false
         };
         cadastroServico.Alterar(servico.razaoSocial, servico.dataInicio);
         cadastroServico.ShowDialog();
     }
 }