コード例 #1
0
        private void btCADASTRAR_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtDATACONSULTA.Text) && string.IsNullOrEmpty(txtDATAINICIO.Text) && string.IsNullOrEmpty(txtHORAFIM.Text))
            {
                MessageBox.Show(" Verifique campos em Branco !", "Falha ao Inserir !", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                int resultado = 0;

                resultado = ConsultaDAL.Cadastrar(Convert.ToInt16(comboMEDICO.SelectedValue), Convert.ToInt16(comboPACIENTE.SelectedValue), Convert.ToDateTime(txtDATACONSULTA.Text), Convert.ToDateTime(txtDATAINICIO.Text), Convert.ToDateTime(txtHORAFIM.Text), txtOBSERVACAO.Text, chkATIVO.Checked);

                if (resultado == 1)
                {
                    MessageBox.Show("Registro inserido com sucesso ! ! !");
                }
                else
                {
                    MessageBox.Show("Falha ao inserir o registro  ! ! !");
                }
            }
            this.tabela_load();
        }