private void btnCancelar_Click(object sender, EventArgs e) { IDPaciente = 0; // Verify that Orcamento was already saved OdontoADMDll.BLL.Orcamento o = new OdontoADMDll.BLL.Orcamento(); int idO = int.Parse(lblDtOrcamento.Text); o.OrcamentoID = idO; o = o.GetOrcamento(); if (o.ValorTotal == 0) { oServico = new OdontoADMDll.BLL.Servico(); oServico.ExcluirServicosPorOrcamento(idO); this.Close(); } else { this.Close(); } }
private void Orcamento_Load(object sender, EventArgs e) { oPaciente = new Paciente(); oOrcamento = new OdontoADMDll.BLL.Orcamento(); oPaciente = oPaciente.GetPaciente(IDPaciente, false); lblNomePaciente.Text = oPaciente.Nome; lblDtData.Text = DateTime.Now.ToShortDateString(); if (IDOrcamento != 0) { oOrcamento.OrcamentoID = IDOrcamento; oOrcamento = oOrcamento.GetOrcamento(); carregarOrcamento(oOrcamento); } else { this.IDOrcamento = oOrcamento.GetNextOrcamentoID(); lblDtOrcamento.Text = IDOrcamento.ToString(); loadImage(); btnImprimir.Visible = false; } }