public acoes() { InitializeComponent(); DAOacao da = new DAOacao(); res = da.getCod() + 1; txtcodigo.Text = res + ""; }
public Frm_Inicial() { InitializeComponent(); Slidepanel.Height = button1.Height; Slidepanel.Top = button1.Top; DAOacao acao = new DAOacao(); //dataGridView2.DataSource = acao.Lista_Data(dateTimePicker2.CustomFormat('aaaa/mm/dd')); }
private void Frm_Inicial_Load(object sender, EventArgs e) { DAOacao ac = new DAOacao(); dtg_tarefas.DataSource = ac.Lista_Data(Convert.ToDateTime(txt_data.Text)); //timer1.Enabled = true; //this.reportViewer1.RefreshReport(); }
private void cadac() { DAOacao ac = new DAOacao(); ac.CadastarAcao(getAcaoPlantar()); ac.CadastarAcao(getAcaoColheita()); limpar(); }
private void txtplantacao_TextChanged(object sender, EventArgs e) { TextBox txt = (TextBox)sender; if ((txt.Name == txtplantacao.Name) && (txt.Text != "")) { objplantacao p = new DAOacao().ProcuraPlantacao(Int32.Parse(txtplantacao.Text)); if (p != null) { setPlantacao(p); } } }
private void txtfunc_TextChanged(object sender, EventArgs e) { TextBox txt = (TextBox)sender; if ((txt.Name == txtfunc.Name) && (txt.Text != "")) { funcionario f = new DAOacao().ProcuraFuncionario(Int32.Parse(txtfunc.Text)); if (f != null) { setFuncionario(f); } } }
private void btngravar_Click(object sender, EventArgs e) { try { DAOacao da = new DAOacao(); da.CadastarAcao(getAcao()); MessageBox.Show("Ação cadastrada com sucesso !", "Cadastro realizado", MessageBoxButtons.OK, MessageBoxIcon.Information); limpar(); Atualizar(); res = da.getCod() + 1; txtcodigo.Text = res + ""; } catch (Exception) { MessageBox.Show("Não foi possível realizar o cadastro da ação, tente novamente", "Verifique se os dados estão corretos", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btneditar_Click(object sender, EventArgs e) { try { DAOacao da = new DAOacao(); da.EditarAcao(getAcao()); MessageBox.Show("Dados alterados", "Edição concluida", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); limpar(); btngravar.Enabled = true; btneditar.Enabled = false; btnexcluir.Enabled = false; Atualizar(); res = da.getCod() + 1; txtcodigo.Text = res + ""; } catch (Exception) { MessageBox.Show("Não foi possível realizar a edição, tente novamente", "Verifique se os dados estão corretos", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnexcluir_Click(object sender, EventArgs e) { try { if (MessageBox.Show("Deseja excluir esta ação ?", "Excluir", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { DAOacao da = new DAOacao(); da.ExcluirAcao(Convert.ToInt32(txtcodigo.Text)); limpar(); btngravar.Enabled = true; btneditar.Enabled = false; btnexcluir.Enabled = false; Atualizar(); res = da.getCod() + 1; txtcodigo.Text = res + ""; } } catch (Exception) { MessageBox.Show("Não foi possível realizar a exclusão, tente novamente", "Erro ao excluir", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void timer2_Tick(object sender, EventArgs e) { label3.Text = DateTime.Now.ToString("HH:mm:ss"); if (label3.Text == "00:00:01") { this.txt_data.Value = DateTime.Now.Date; } if (label3.Text == "23:07:00") { string send, teste; DAOacao ac = new DAOacao(); if (dtg_tarefas.Rows[0].Cells[0].Value == null) { send = "Hoje você não tem tarefas a executar!"; } else { try { send = "Hoje você tem as seguintes tarefas "; for (int i = 0; i < dtg_tarefas.RowCount; i++) { for (int j = 0; j < dtg_tarefas.ColumnCount; j++) { if (j == 0) { send += " Plantação " + dtg_tarefas.Rows[i].Cells[j].Value.ToString() + " "; } if (j == 1) { send += " Planta " + dtg_tarefas.Rows[i].Cells[j].Value.ToString() + " "; } if (j == 2) { send += " Utilizar o produto " + dtg_tarefas.Rows[i].Cells[j].Value.ToString() + " "; } if (j == 8) { send += " Quantidade de Produto a utilizar " + dtg_tarefas.Rows[i].Cells[j].Value.ToString() + " "; } if (j == 3) { send += " Funcionario responsavel " + dtg_tarefas.Rows[i].Cells[j].Value.ToString() + " "; } if (j == 4) { send += " Data " + dtg_tarefas.Rows[i].Cells[j].Value.ToString() + " "; } if (j == 5) { send += " a tarefa " + dtg_tarefas.Rows[i].Cells[j].Value.ToString() + " "; } if (j == 6) { send += " que tem o status " + dtg_tarefas.Rows[i].Cells[j].Value.ToString() + " "; } if (j == 7) { send += " no horario " + dtg_tarefas.Rows[i].Cells[j].Value.ToString() + " "; } } send += "; "; } } catch { send = "Hoje você não tem tarefas a executar!"; } } // Find your Account Sid and Token at twilio.com/console // DANGER! This is insecure. See http://twil.io/secure const string accountSid = "ACcac9d2c8905ff49a25a5482fac9ab034"; const string authToken = "e5a17ae9c84acf5d33141409afbac23f"; TwilioClient.Init(accountSid, authToken); var message = MessageResource.Create( body: send, from: new Twilio.Types.PhoneNumber("+19285698227"), to: new Twilio.Types.PhoneNumber("+5514988162072") ); } }
private void txt_data_ValueChanged(object sender, EventArgs e) { DAOacao ac = new DAOacao(); dtg_tarefas.DataSource = ac.Lista_Data(Convert.ToDateTime(txt_data.Text)); }
private void Atualizar() { DAOacao da = new DAOacao(); dgvacoes.DataSource = da.ListaAcoes(); }