public void EditarUmServico() { string _CPFCliente = bd.BuscarCPFCliente(Convert.ToInt32(table_OrdensServicos.SelectedCells[1].Value.ToString())); string _TELCliente = bd.BuscarTelefoneCliente(Convert.ToInt32(table_OrdensServicos.SelectedCells[1].Value.ToString())); float lucro = float.Parse(table_OrdensServicos.SelectedCells[10].Value.ToString()); form_OrdensServ_Edit editarServicos = new form_OrdensServ_Edit(this, corGeral); editarServicos.lblIDservico.Text = table_OrdensServicos.SelectedCells[0].Value.ToString(); editarServicos.lblIDcliente.Text = table_OrdensServicos.SelectedCells[1].Value.ToString(); editarServicos.dtpDataEdit.Value = Convert.ToDateTime(table_OrdensServicos.SelectedCells[2].Value.ToString()); editarServicos.lblClienteNome.Text = table_OrdensServicos.SelectedCells[3].Value.ToString(); editarServicos.txtClienteNome.Text = table_OrdensServicos.SelectedCells[3].Value.ToString(); editarServicos.txtCPFCliente.Text = _CPFCliente; editarServicos.txtTelefoneCliente.Text = _TELCliente; editarServicos.txtAparelhoEdit.Text = table_OrdensServicos.SelectedCells[4].Value.ToString(); editarServicos.txtDefeitoEdit.Text = table_OrdensServicos.SelectedCells[5].Value.ToString(); editarServicos.txtSenhaEdit.Text = table_OrdensServicos.SelectedCells[7].Value.ToString(); editarServicos.txtSituacaoEdit.Text = table_OrdensServicos.SelectedCells[6].Value.ToString(); editarServicos.txtServicoValorEdit.Text = table_OrdensServicos.SelectedCells[8].Value.ToString(); editarServicos.txtPecaValorEdit.Text = table_OrdensServicos.SelectedCells[9].Value.ToString(); editarServicos.txtLucroValorEdit.Text = table_OrdensServicos.SelectedCells[10].Value.ToString(); editarServicos.txtServicoEdit.Text = table_OrdensServicos.SelectedCells[11].Value.ToString(); if (table_OrdensServicos.SelectedCells[12].Value == DBNull.Value) { //MessageBox.Show("Sem data"); editarServicos.dtpDataEditPrevisao.FormatCustom = " "; editarServicos.dtpDataEditPrevisao.Format = DateTimePickerFormat.Custom; editarServicos.chkSemData.Checked = true; //editarServicos.dtpDataEditPrevisao.Value = DateTime.Parse("00/00/0000"); } else { editarServicos.dtpDataEditPrevisao.Value = Convert.ToDateTime(table_OrdensServicos.SelectedCells[12].Value.ToString()); editarServicos.chkSemData.Checked = false; } if (lucro > 0) { editarServicos.txtLucroValorEdit.LineIdleColor = Color.LimeGreen; } else if (lucro == 0) { editarServicos.txtLucroValorEdit.LineIdleColor = Color.White; } else { editarServicos.txtLucroValorEdit.LineIdleColor = Color.Red; } editarServicos.LabelResize(); editarServicos.ShowDialog(); //table_OrdensServicos.Refresh(); //refreshTable(); }
public form_WordNota(form_OrdensServ_Edit _ordensServ, int[] _corRgb) { InitializeComponent(); tFilename.Text = diretorioArquivoPadrao; DirectoryInfo directoryInfo = new DirectoryInfo(diretorioArquivoPadrao); ordensServ = _ordensServ; corGeral = _corRgb; switchGarantia.Checked = true; CentralizarLabels(); MudarCores(); }
private void editarToolStripMenuItem1_Click(object sender, EventArgs e) { form_OrdensServ_Edit editarServicos = new form_OrdensServ_Edit(this, corGeral); editarServicos.lblIDservico.Text = table_ServicosConcluidos.SelectedCells[0].Value.ToString(); editarServicos.dtpDataEdit.Value = Convert.ToDateTime(table_ServicosConcluidos.SelectedCells[2].Value.ToString()); editarServicos.txtClienteNome.Text = table_ServicosConcluidos.SelectedCells[3].Value.ToString(); editarServicos.txtAparelhoEdit.Text = table_ServicosConcluidos.SelectedCells[4].Value.ToString(); editarServicos.txtDefeitoEdit.Text = table_ServicosConcluidos.SelectedCells[5].Value.ToString(); editarServicos.txtSituacaoEdit.Text = table_ServicosConcluidos.SelectedCells[6].Value.ToString(); editarServicos.txtServicoValorEdit.Text = table_ServicosConcluidos.SelectedCells[8].Value.ToString(); editarServicos.txtPecaValorEdit.Text = table_ServicosConcluidos.SelectedCells[9].Value.ToString(); editarServicos.txtLucroValorEdit.Text = table_ServicosConcluidos.SelectedCells[10].Value.ToString(); editarServicos.btnConcluirServico.Visible = false; editarServicos.ShowDialog(); }
public void ExibirLucrosTela() { form_OrdensServ_Edit editarServicos = new form_OrdensServ_Edit(this, corGeral); editarServicos.lblIDservico.Text = tabelaLucros.SelectedCells[0].Value.ToString(); editarServicos.dtpDataEdit.Value = Convert.ToDateTime(tabelaLucros.SelectedCells[1].Value.ToString()); editarServicos.txtClienteNome.Text = tabelaLucros.SelectedCells[2].Value.ToString(); editarServicos.txtAparelhoEdit.Text = tabelaLucros.SelectedCells[3].Value.ToString(); editarServicos.txtDefeitoEdit.Text = tabelaLucros.SelectedCells[4].Value.ToString(); editarServicos.txtSituacaoEdit.Text = tabelaLucros.SelectedCells[5].Value.ToString(); editarServicos.txtServicoValorEdit.Text = tabelaLucros.SelectedCells[6].Value.ToString(); editarServicos.txtPecaValorEdit.Text = tabelaLucros.SelectedCells[7].Value.ToString(); editarServicos.txtLucroValorEdit.Text = tabelaLucros.SelectedCells[8].Value.ToString(); editarServicos.btnConcluirServico.Visible = false; editarServicos.ShowDialog(); LucroUltimos30Dias(); }