private void btnDeletar_Click(object sender, EventArgs e) { if (cliente == null) { string msg = "Selecione um registro para removê-lo."; frmAlert alert = new frmAlert(); alert.LoadScreen(msg); alert.ShowDialog(); } else { string msgm = "Quer mesmo apagar o registro " + cliente.id + "?" + "\nObs: ao apagar este cliente, todos os outros registros nele vinculados serão perdidos."; frmQuestion tela = new frmQuestion(); tela.LoadScreen(msgm); tela.ShowDialog(); bool click = tela.BotaoYes; if (click == true) { ClienteBusiness buss = new ClienteBusiness(); buss.Remover(cliente.id); CarregarGrid(); } } }
private void btnDeletar_Click(object sender, EventArgs e) { if (animal == null) { string msg = "Selecione um registro para removê-lo"; frmAlert tela = new frmAlert(); tela.LoadScreen(msg); tela.ShowDialog(); } else { string msg = "Quer mesmo remover o registro " + animal.Id + "?"; frmQuestion tela = new frmQuestion(); tela.LoadScreen(msg); tela.ShowDialog(); bool click = tela.BotaoYes; if (click == true) { AnimalBusiness buss = new AnimalBusiness(); buss.Remover(animal.Id); CarregarGrid(); } } }
void btnAddQuestion_Click(object sender, EventArgs e) { QuestionData newQuestion = new QuestionData(0); frmQuestion questionForm = new frmQuestion(newQuestion); questionForm.ShowDialog(); //check to see the question is valid ie user didnt cancel if (newQuestion.Answers.Count > 0) { //add question to display QuestionBox questionBox = new QuestionBox(newQuestion, questionBoxes.Count + 1, myObjective); questionBox.Disposed += new EventHandler(questionBox_Disposed); questionBoxes.Add(questionBox); pnlMain.Controls.Add(questionBox); //add question to currentQuiz we are editing GlobalData.currentQuiz.addQuestion(newQuestion); //set locations via resize pnlMain_Resize(null, null); pnlMain.ScrollControlIntoView(questionBox); } }
private void ckbAdm_CheckedChanged(object sender, EventArgs e) { if (ckbAdm.Checked == true) { string msg = "Ao definir esse usuário com permissão ADM, ele terá acesso a todas as funções do sistema." + "\n Deseja mesmo torná-lo ADM?"; frmQuestion tela = new frmQuestion(); tela.LoadScreen(msg); tela.ShowDialog(); bool click = tela.BotaoYes; if (click == true) { ckbCaixa.Checked = true; ckbEstoque.Checked = true; ckbCadastros.Checked = true; ckbFinanceiro.Checked = true; ckbProdutos.Checked = true; } } else { ckbCaixa.Checked = true; ckbEstoque.Checked = true; ckbCadastros.Checked = true; ckbFinanceiro.Checked = true; ckbProdutos.Checked = true; } }
private void btnDeletar_Click_1(object sender, EventArgs e) { if (fornecedor == null) { string msg = "Selecione um fornecedor para deleta-lo."; frmAlert tela = new frmAlert(); tela.LoadScreen(msg); tela.ShowDialog(); } else { string mensagem = "Quer mesmo apagar o Fornecedor " + fornecedor.Id + " do sistema?" + "\n obs: ao apagar um fornecedor, todos os outros registros nele vinculados serão apagados."; frmQuestion tela = new frmQuestion(); tela.LoadScreen(mensagem); tela.ShowDialog(); bool click = tela.BotaoYes; if (click == true) { FornecedoresBusiness buss = new FornecedoresBusiness(); buss.Remover(fornecedor.Id); CarregarGrid(); } } }
/// <summary> /// Handles Edit Question Button Click event /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void btnEditQuestion_Click(object sender, EventArgs e) { //display form frmQuestion questionForm = new frmQuestion(myQuestion); questionForm.ShowDialog(); //update question box this.lblQuestion.Text = myQuestion.Text; for (int i = 0; i < myQuestion.Answers.Count; i++) { rbtnAnswers[i].Text = myQuestion.Answers[i].Text; rbtnAnswers[i].Checked = myQuestion.Answers[i].Correct; } }
private void frmAvisoPregunta_Load(object sender, EventArgs e) { if (tipo == "modal") { this.BackColor = Color.Black; this.ventanaModal.Owner = this; this.ventanaModal.Show(); return; } if (tipo == "") { p = new yesno(this, this.mensaje); p.enviando = recibiendo; p.Show(); } else if (tipo == "informacion") { informacion = new frmInformacion(this, this.mensaje, this.titulo); informacion.enviando = recibiendo; informacion.Show(); } else if (tipo == "error") { error = new frmError(this.mensaje, this.titulo, this); error.enviando = recibiendo; error.Show(); } else if (tipo == "exclamation") { exclamation = new frmExclamacion(this.mensaje, this.titulo, this); exclamation.enviando = recibiendo; exclamation.Show(); } else if (tipo == "question") { question = new frmQuestion(this.mensaje, this.titulo, this); question.enviando = recibiendo; question.Show(); } else { success = new frmSuccess(this.mensaje, this.titulo, this); success.enviando = recibiendo; success.Show(); } }
private void dgvDepto_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == 3) { CargoDTO dto = dgvDepto.Rows[e.RowIndex].DataBoundItem as CargoDTO; string msg = "Quer mesmo apagar o registro " + dto.Id + "?" + "\n" + "obs: Ao apagar um departamento, todos os funcionários nele vinculados serão deletados."; frmQuestion tela = new frmQuestion(); tela.LoadScreen(msg); tela.ShowDialog(); bool botaoYes = tela.BotaoYes; if (botaoYes == true) { CargoBusiness buss = new CargoBusiness(); int IdDepto = dto.Id; buss.Remover(IdDepto); string msgm = "Registo removido com sucesso!"; frmMessage message = new frmMessage(); message.LoadScreen(msgm); message.ShowDialog(); CarregarGrid(); } } } catch (Exception ex) { string msg = "Ocorreu um erro: " + ex.Message; frmException tela = new frmException(); tela.LoadScreen(msg); tela.ShowDialog(); } }
private void btnDeletar_Click(object sender, EventArgs e) { try { if (funcionario == null) { string msg = "Selecione um registro para remove-lo."; frmAlert tela = new frmAlert(); tela.LoadScreen(msg); tela.ShowDialog(); } else { string msg = "Quer mesmo deletar o funcionário " + funcionario.Id + " do sistema?"; frmQuestion tela = new frmQuestion(); tela.LoadScreen(msg); tela.ShowDialog(); bool botaoYes = tela.BotaoYes; if (botaoYes == true) { FuncionarioBusiness buss = new FuncionarioBusiness(); int Id = funcionario.Id; buss.Remover(Id); CarregarGrid(); } } } catch (Exception ex) { string msg = "Ocorreu um erro: " + ex.Message; frmException tela = new frmException(); tela.LoadScreen(msg); tela.ShowDialog(); } }