public override void Edit(enuEdit enuNew_Edit) { if (!lvDmDvCs.MoveDataSourceToCurrentRow()) { return; } if (bdsDmDvCs.Position < 0 && enuNew_Edit == enuEdit.Edit) { return; } //Copy hang hien tai if (bdsDmDvCs.Position >= 0) { Common.CopyDataRow(((DataRowView)bdsDmDvCs.Current).Row, ref drCurrent); } else { drCurrent = dtDmDvCs.NewRow(); } frmDmDvCs_Edit frmEdit = new frmDmDvCs_Edit(); frmEdit.Load(enuNew_Edit, drCurrent); if (frmEdit.isAccept) { if (enuNew_Edit == enuEdit.New && bdsDmDvCs.Position < 0) { if (bdsDmDvCs.Position >= 0) { dtDmDvCs.ImportRow(drCurrent); } else { dtDmDvCs.Rows.Add(drCurrent); } bdsDmDvCs.Position = bdsDmDvCs.Find("MA_DVCS", drCurrent["MA_DVCS"]); } else { Common.CopyDataRow(drCurrent, ((DataRowView)bdsDmDvCs.Current).Row); } dtDmDvCs.AcceptChanges(); //Cap nhat vao ListView lvDmDvCs.UpdateRowToListViewItem(enuNew_Edit, drCurrent); } else { dtDmDvCs.RejectChanges(); } }
private void EditPersonForm_Load(object sender, EventArgs e) { if (MainForm.IDocTypeTable == null) { MainForm.IDocTypeTable = IDocType.CreateTable(); } if (MainForm.CountryTable == null) { MainForm.CountryTable = Country.CreateTable(); } _doctypeTable = MainForm.IDocTypeTable; _citizenTable = MainForm.CountryTable; _doctypeBS = new BindingSource(); _doctypeBS.DataSource = _doctypeTable; _citizen1BS = new BindingSource(); _citizen1BS.DataSource = _citizenTable; _citizen2BS = new BindingSource(); _citizen2BS.DataSource = _citizenTable; if (_doctypeTable.Rows.Count <= 0) { SQLiteDataAdapter doctypeAdapter = new SQLiteDataAdapter(IDocType.GetSelectText(), _connection); doctypeAdapter.Fill(_doctypeTable); } if (_citizenTable.Rows.Count <= 0) { SQLiteDataAdapter countryAdapter = new SQLiteDataAdapter(Country.GetSelectText(), _connection); countryAdapter.Fill(_citizenTable); } doctypeBox.DataSource = _doctypeBS; doctypeBox.DisplayMember = IDocType.name; citizen1Box.DataSource = _citizen1BS; citizen1Box.DisplayMember = Country.name; citizen1Box.ValueMember = Country.id; citizen2Box.DataSource = _citizen2BS; citizen2Box.DisplayMember = Country.name; citizen2Box.ValueMember = Country.id; int pos = _citizen1BS.Find(Country.name, "ПМР"); if (pos != -1) { _citizen1BS.Position = pos; } else { _citizen1BS.MoveFirst(); } _citizen2BS.MoveFirst(); _doctypeBS.MoveFirst(); sexBox.SelectedIndex = sexBox.Items.Count > 0 ? 0 : -1; }
public override void Edit(enuEdit enuNew_Edit) { if (bdsBudgetCp.Position < 0 && enuNew_Edit == enuEdit.Edit) { return; } //Copy hang hien tai //if (bdsBudgetCp.Position >= 0) if (enuNew_Edit == enuEdit.Edit) { Common.CopyDataRow(((DataRowView)bdsBudgetCp.Current).Row, ref drCurrent); } else { drCurrent = dtBudgetCp.NewRow(); } if (enuNew_Edit == enuEdit.New) { drCurrent["Nam"] = Element.sysWorkingYear; drCurrent["Bold"] = false; //drCurrent["Tk"] = strTk; } frmBudgetCp_Edit frmEdit = new frmBudgetCp_Edit(); frmEdit.Load(enuNew_Edit, drCurrent); //Accept if (frmEdit.isAccept) { if (enuNew_Edit == enuEdit.New) { //if (bdsBudgetCp.Position >= 0) if (enuNew_Edit == enuEdit.Edit) { dtBudgetCp.ImportRow(drCurrent); } else { dtBudgetCp.Rows.Add(drCurrent); } bdsBudgetCp.Position = bdsBudgetCp.Find("Ident00", drCurrent["Ident00"]); } else { Common.CopyDataRow(drCurrent, ((DataRowView)bdsBudgetCp.Current).Row); } dtBudgetCp.AcceptChanges(); this.Update_TTien(); } }
void bareCodeReader1_OnRead(string CodeABarre) { try { DataTable dt = CLIENT_APP_PARAM.gcws.SELECT_BY_BARCODE(CodeABarre); if (dt.Rows.Count > 0) { DataRow dr = dt.Rows[0]; bool exist = false; foreach (DataRow item in dS_MOUV1.V_LG_CMD_FR.Rows) { if (item["CODE_ARTICLE"].ToString() == dr["CODE_ARTICLE"].ToString()) { exist = true; break; } } if (!exist) { bsDetails.AddNew(); DataRowView drv = (DataRowView)bsDetails.Current; drv["CODE_COMMANDE_FOURNISSEUR"] = -1; drv["CODE_ARTICLE"] = dr["CODE_ARTICLE"]; drv["QTE"] = 1; drv["DESIGNATION_ARTICLE"] = dr["DESIGNATION_ARTICLE"]; drv["DESCRIPTION_ARTICLE"] = dr["DESCRIPTION_ARTICLE"]; drv["REF_ARTICLE"] = dr["REF_ARTICLE"]; drv["TAUX_TVA"] = dr["TAUX_TVA_ACHAT"]; drv["UNITE"] = dr["LIB_UNITE"]; drv["CODE_ARTICLE"] = dr["CODE_ARTICLE"]; drv["PRIX_HT"] = dr["PRIX_HT_A_ARTICLE"]; drv["REMISE"] = 0; drv["FODEC"] = 0; bsDetails.EndEdit(); (bsDetails.DataSource as DataTable).AcceptChanges(); gridView1.UpdateCurrentRow(); } else { bsDetails.Position = bsDetails.Find("CODE_ARTICLE", dr["CODE_ARTICLE"]); DataRowView drv = (DataRowView)bsDetails.Current; drv["QTE"] = (decimal)drv["QTE"] + 1; bsDetails.EndEdit(); (bsDetails.DataSource as DataTable).AcceptChanges(); gridView1.UpdateCurrentRow(); } } calculMontantTotal(); } catch (Exception er) { MessageBox.Show(er.Message, this.Text); } }
private void BOT_BUSCAR_Click(object sender, EventArgs e) { SeleccionProveedores BrowseProviders = new SeleccionProveedores(); BrowseProviders.dtsupply = ds.Tables["dtsupply"]; BrowseProviders.ShowDialog(); int itemFound = bs.Find("Proveedor_ID", BrowseProviders.itemSelected); bs.Position = itemFound; }
private void BOT_BUSCAR_Click(object sender, EventArgs e) { SeleccionCustomers BrowseCustomers = new SeleccionCustomers(); BrowseCustomers.dtcustomer = ds.Tables["dtcustomer"]; BrowseCustomers.ShowDialog(); int itemFound = bs.Find("Customer_ID", BrowseCustomers.itemSelected); bs.Position = itemFound; }
private void FindByCompanyNameButton_Click(object sender, EventArgs e) { var companyName = "Around the Horn"; var index = _customersBindingSource.Find("CompanyName", "Blauer See Delikatessen"); if (index > -1) { _customersBindingSource.Position = index; } }
private void AddSummationRow_New1(BindingSource bs, DataGridView dgv) { DataRow sumdr = (((DataSet)bs.DataSource).Tables[bs.DataMember]).NewRow(); if (-1 != bs.Find("salesclient_code", "_合计")) { bs.RemoveAt(bs.Find("salesclient_code", "_合计")); } foreach (DataGridViewRow dgvRow in dgv.Rows) { foreach (DataGridViewCell dgvCell in dgvRow.Cells) { if (dgvCell.Value != null && !(dgvCell.Value is DBNull)) { //if (IsInteger(dgvCell.Value)) //{ // if ("年份" != dgvCell.OwningColumn.HeaderText && "月份" != dgvCell.OwningColumn.HeaderText && "税率" != dgvCell.OwningColumn.HeaderText) // { // if (sumdr[dgvCell.OwningColumn.DataPropertyName] == null || (sumdr[dgvCell.OwningColumn.DataPropertyName] is DBNull)) // sumdr[dgvCell.OwningColumn.DataPropertyName] = 0; // sumdr[dgvCell.OwningColumn.DataPropertyName] = Convert.ToInt64(sumdr[dgvCell.OwningColumn.DataPropertyName]) + Convert.ToInt64(dgvCell.Value); // } //} if (IsDecimal(dgvCell.Value)) { if (sumdr[dgvCell.OwningColumn.DataPropertyName] == null || (sumdr[dgvCell.OwningColumn.DataPropertyName] is DBNull)) { sumdr[dgvCell.OwningColumn.DataPropertyName] = 0; } sumdr[dgvCell.OwningColumn.DataPropertyName] = Convert.ToDecimal(sumdr[dgvCell.OwningColumn.DataPropertyName]) + Convert.ToDecimal(dgvCell.Value); } } } } sumdr["salesclient_code"] = "_合计"; ((DataSet)bs.DataSource).Tables[bs.DataMember].Rows.Add(sumdr); bs.ResetBindings(true); }
private void TxtIdVenda_Validated(object sender, EventArgs e) { if (TxtIdVenda.Text.Trim() == "") { return; } Vendas.LerDados(int.Parse(TxtIdVenda.Value.ToString())); if (Vendas.IdVenda == 0) { MessageBox.Show("Atenção Venda não Localizada", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtIdVenda.Text = ""; TxtIdVenda.Focus(); return; } else { /* if (Vendas.Status != 2 && Vendas.TpVenda!="OE") * { * MessageBox.Show("Atenção Venda não esta faturada", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information); * TxtIdVenda.Text = ""; * TxtIdVenda.Focus(); * return; * }*/ if (Vendas.TpVenda == "OE" && (Vendas.Status == 1 || Vendas.Status == 4)) { MessageBox.Show("Atenção Ordem de Entrega não esta Faturada ou Entregue", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtIdVenda.Text = ""; TxtIdVenda.Focus(); return; } if (GridDados.CurrentRow != null) { if (Source_Lanc.Find("Id_Venda", Vendas.IdVenda) > -1) { MessageBox.Show("Venda ja foi informada", "Atenção", MessageBoxButtons.OK, MessageBoxIcon.Information); TxtIdVenda.Text = ""; TxtIdVenda.Focus(); return; } } TxtPessoa.Text = Vendas.NmPessoa.Trim(); TabLancVenda.Rows.Add(Vendas.IdVenda, Vendas.NumDocumento, Vendas.NmPessoa); Source_Lanc.DataSource = TabLancVenda; Source_Lanc.DataMember = TabLancVenda.TableName; GridDados.DataSource = Source_Lanc; GridDados.Refresh(); TxtIdVenda.Text = ""; TxtIdVenda.Focus(); } }
public override void Edit(enuEdit enuNew_Edit) { if (dgvColumns.Focused) { Edit_Columns(enuNew_Edit); return; } if (bdsZone.Position < 0 && enuNew_Edit == enuEdit.Edit) { return; } //Copy hang hien tai if (bdsZone.Position >= 0) { Common.CopyDataRow(((DataRowView)bdsZone.Current).Row, ref drCurrent); } else { drCurrent = dtZone.NewRow(); } frmZones_Edit frmEdit = new frmZones_Edit(); frmEdit.Load(enuNew_Edit, drCurrent); //Accept if (frmEdit.isAccept) { if (enuNew_Edit == enuEdit.New) { if (bdsZone.Position >= 0) { dtZone.ImportRow(drCurrent); } else { dtZone.Rows.Add(drCurrent); } bdsZone.Position = bdsZone.Find("ZONE", drCurrent["ZONE"]); } else { Common.CopyDataRow(drCurrent, ((DataRowView)bdsZone.Current).Row); } dtZone.AcceptChanges(); } else { dtZone.RejectChanges(); } }
private void LocateSoftware(int id) { var position = _vSoftware.Find("ID Software", id); _isEditable = false; if (position > 0) { _vSoftware.Position = position; } _isEditable = true; }
void FOURNISSEUR_SelectedValueChanged(object sender, EventArgs e) { try { lb_ref_fournisseur.Text = (bs_fourn[bs_fourn.Find("CODE_FOURNISSEUR", (decimal)cbxFournisseur.SelectedValue)] as DataRowView)["REF_FOURNISSEUR"].ToString(); } catch (Exception er) { MessageBox.Show(er.Message, "Fournisseurs"); } }
//Eventos Proventos e Descontos Fixo private void PopularGridEventosFixo() { TabEventosFixo = Controle.ConsultaTabela("SELECT T1.ID_LANC,T1.ID_PROVDESC,T1.VALOR,T1.DESCRICAO FROM PROVDESCFUNC T1 WHERE T1.MESANO='00/0000' AND T1.ID_FUNC=" + Func.IdFunc.ToString()); Source_EventosFixo.DataSource = TabEventosFixo; Source_EventosFixo.DataMember = TabEventosFixo.Tables[0].TableName; GridEventoFixo.DataSource = Source_EventosFixo; NavEventoFixo.BindingSource = Source_EventosFixo; int item = Source_EventosFixo.Find("Id_Lanc", EventosFixo.IdLanc); Source_EventosFixo.Position = item; }
//Grade de produtos private void PopularGridItens() { TabItens = Controle.ConsultaTabela("SELECT ID_LANC,ID_GRUPO,TpPremio,VLRCOTA,VlrPremio,VLRCOTA2,VlrPremio2 FROM COTAGRUPOPRDVENDEDOR WHERE ID_VENDEDOR=" + Vendedor.IdVendedor.ToString()); Source_Itens.DataSource = TabItens; Source_Itens.DataMember = TabItens.Tables[0].TableName; GridItens.DataSource = Source_Itens; Navegador.BindingSource = Source_Itens; int item = Source_Itens.Find("ID_Lanc", CotaGrdPrd.IdLanc); Source_Itens.Position = item; }
private void PopularGridPrd() { TabPrd = Controle.ConsultaTabela("SELECT T1.ID_LANC,T2.REFERENCIA,T2.DESCRICAO FROM PRODUCAOPRODUTOS T1 LEFT JOIN PRODUTOS T2 ON (T2.ID_PRODUTO=T1.ID_PRODUTO) WHERE T1.ID_PRODUCAO=" + CadProducao.IdProducao.ToString()); Source_Prd.DataSource = TabPrd; Source_Prd.DataMember = TabPrd.Tables[0].TableName; GridPrd.DataSource = Source_Prd; NavegadorPrd.BindingSource = Source_Prd; int item = Source_Prd.Find("ID_Lanc", ProdPrd.IdLanc); Source_Prd.Position = item; }
public override void Edit(enuEdit enuNew_Edit) { if (enuNew_Edit == enuEdit.New) { return; } if (bdsListCustomerLics.Position < 0) { return; } //Copy hang hien tai if (bdsListCustomerLics.Position >= 0) { Common.CopyDataRow(((DataRowView)bdsListCustomerLics.Current).Row, ref drCurrent); } else { drCurrent = dtListCustomerLics.NewRow(); } frmViewLicense_Edit frm = new frmViewLicense_Edit(); frm.Load(enuNew_Edit, ref drCurrent); //Accept if (frm.isAccept) { if (enuNew_Edit == enuEdit.New) { if (bdsListCustomerLics.Position >= 0) { dtListCustomerLics.ImportRow(drCurrent); } else { dtListCustomerLics.Rows.Add(drCurrent); } bdsListCustomerLics.Position = bdsListCustomerLics.Find("MA_DVCS", drCurrent["MA_DVCS"]); } else { Common.CopyDataRow(drCurrent, ((DataRowView)bdsListCustomerLics.Current).Row); } dtListCustomerLics.AcceptChanges(); } else { dtListCustomerLics.RejectChanges(); } }
private void PopularGridProd() { TabProd = Controle.ConsultaTabela("SELECT T1.ID_LANC,T2.REFERENCIA,T2.DESCRICAO,T1.QTDE,T1.QTDEEXTRA FROM MAPAPRODUCAOPRODUTOS T1 LEFT JOIN PRODUTOS T2 ON (T2.ID_PRODUTO=T1.ID_PRODUTO) WHERE T1.ID_MAPA=" + Mapa.IdMapa.ToString()); Source_Prod.DataSource = TabProd; Source_Prod.DataMember = TabProd.Tables[0].TableName; GridPrd.DataSource = Source_Prod; NavegadorMat.BindingSource = Source_Prod; int Lanc = Source_Prod.Find("ID_Lanc", MapaProd.IdLanc); Source_Itens.Position = Lanc; }
private void PopularGridItens() { TabItens = Controle.ConsultaTabela("SELECT T1.ID_LANC,T2.REFERENCIA,T2.DESCRICAO,T1.QTDE FROM MAPAPRODUCAOITENS T1 LEFT JOIN PRODUTOS T2 ON (T2.ID_PRODUTO=T1.ID_PRODUTO) WHERE T1.ID_MAPA=" + Mapa.IdMapa.ToString()); Source_Itens.DataSource = TabItens; Source_Itens.DataMember = TabItens.Tables[0].TableName; GridItens.DataSource = Source_Itens; Navegador.BindingSource = Source_Itens; int Lanc = Source_Itens.Find("ID_Lanc", MapaItens.IdLanc); Source_Itens.Position = Lanc; }
public override void Edit(enuEdit enuNew_Edit) { if (bdsColumns.Position < 0 && enuNew_Edit == enuEdit.Edit) { return; } //Copy hang hien tai if (bdsColumns.Position >= 0) { Common.CopyDataRow(((DataRowView)bdsColumns.Current).Row, ref drCurrent); } else { drCurrent = dtColumns.NewRow(); } if (enuNew_Edit == enuEdit.New) { drCurrent["Stt"] = Convert.ToInt32(Common.MaxDCValue(dtColumns.Select("Zone = '" + strZone + "'"), "Stt")) + 1; } frmColumn_Edit frmEdit = new frmColumn_Edit(); frmEdit.Load(enuNew_Edit, drCurrent); //Accept if (frmEdit.isAccept) { if (enuNew_Edit == enuEdit.New) { if (bdsColumns.Position >= 0) { dtColumns.ImportRow(drCurrent); } else { dtColumns.Rows.Add(drCurrent); } bdsColumns.Position = bdsColumns.Find("IDENT00", drCurrent["IDENT00"]); } else { Common.CopyDataRow(drCurrent, ((DataRowView)bdsColumns.Current).Row); } dtColumns.AcceptChanges(); } else { dtColumns.RejectChanges(); } }
private void PopularGridItens() { TabItens = Controle.ConsultaTabela("SELECT T1.ID_LANC,T2.REFERENCIA,T2.DESCRICAO,T1.PRCATACADO,T1.PRCMINIMO,T1.PRCVAREJO,T1.PRCESPECIAL,T1.PRCSENSACIONAL,T1.ATIVO FROM PROMOCAOPRODUTOSITENS T1 LEFT JOIN PRODUTOS T2 ON (T2.ID_PRODUTO=T1.ID_PRODUTO) WHERE T1.ID_PROMOCAO=" + Promocao.IdPromocao.ToString()); Source_Itens.DataSource = TabItens; Source_Itens.DataMember = TabItens.Tables[0].TableName; GridItens.DataSource = Source_Itens; Navegador.BindingSource = Source_Itens; int Lanc = Source_Itens.Find("ID_Lanc", PromocaoItens.IdLanc); Source_Itens.Position = Lanc; }
//Composicao dos Produtos private void PopularGridItens() { TabItens = Controle.ConsultaTabela("SELECT T1.ID_LANC,T2.REFERENCIA,T2.DESCRICAO,T1.QTDE FROM PRODUCAOITENS T1 LEFT JOIN PRODUTOS T2 ON (T2.ID_PRODUTO=T1.ID_PRODUTO) WHERE T1.ID_PRODUCAO=" + CadProducao.IdProducao.ToString()); Source_Itens.DataSource = TabItens; Source_Itens.DataMember = TabItens.Tables[0].TableName; GridItens.DataSource = Source_Itens; NavegadorComp.BindingSource = Source_Itens; int item = Source_Itens.Find("ID_Lanc", ProdItens.IdLanc); Source_Itens.Position = item; }
private void PopularGrid() { string Filtro = ""; if (Rb_NaoConf.Checked) { Filtro = " WHERE T1.Status = 0"; } else if (Rb_EmEspera.Checked) { Filtro = " WHERE T1.Status = 1"; } else { Filtro = Filtro + " WHERE T1.Status = 2"; } if (Chk_Periodo.Checked) { Filtro = Filtro + " and T1.Data >= Convert(DateTime,'" + Dt1.Value.Date.ToString() + "',103) and T1.Data <= Convert(DateTime,'" + Dt2.Value.Date.ToString() + "',103)"; } if (TxtPesqFornecedor.Text.Trim() != "") { Filtro = Filtro + " and T2.RazaoSocial like '%" + TxtPesqFornecedor.Text.Trim() + "%'"; } if (TxtPesNumPedido.Text.Trim() != "") { Filtro = Filtro + " and T1.NumPedido like '%" + TxtPesNumPedido.Text.Trim() + "%'"; } if (TxtPesNumNfe.Text.Trim() != "") { Filtro = Filtro + " and T1.NumNFe like '%" + TxtPesNumNfe.Text.Trim() + "%'"; } try { DataSet Tabela = new DataSet(); Tabela = Controle.ConsultaTabela(string.Format("SELECT T1.Id_Documento,CASE T1.STATUS WHEN 0 THEN 'Não Confirmado' WHEN 1 THEN 'Em Espera' WHEN 2 THEN 'Recebido' END AS Status,T1.Data,T1.NumPedido,T1.NumNFe,T1.PrevEntrega,T2.RazaoSocial as Fornecedor,T3.FANTASIA AS FILIAL,T1.VlrTotal,T4.Usuario " + " FROM PedCompra T1 LEFT JOIN PESSOAS T2 ON (T2.ID_PESSOA=T1.ID_PESSOA) LEFT JOIN EMPRESA_FILIAL T3 ON (T3.ID_FILIAL=T1.ID_FILIAL) LEFT JOIN USUARIOS T4 ON (T4.ID_USUARIO=T1.ID_USUARIO) " + Filtro + " ORDER BY T2.RAZAOSOCIAL,T1.ID_DOCUMENTO DESC")); BindingSource Source = new BindingSource(); Source.DataSource = Tabela; Source.DataMember = Tabela.Tables[0].TableName; GridDados.DataSource = Source; int item = Source.Find("Id_Documento", MvPedCompra.IdDocumento); Source.Position = item; } catch { MessageBox.Show("Erro ao pesquisar verifique o conteúdo da pesquisa", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
//Produtos com Vinculo no Comodato private void PopularGridItensVinc() { TabComodVinc = Controle.ConsultaTabela("SELECT T1.ID_LANC,T2.REFERENCIA,T2.DESCRICAO FROM GRADECOMODATOVINC T1 LEFT JOIN PRODUTOS T2 ON (T2.ID_PRODUTO=T1.ID_PRODUTO) WHERE T1.ID_GRADE=" + Grade.IdGrade.ToString()); Source_ComodVinc.DataSource = TabComodVinc; Source_ComodVinc.DataMember = TabComodVinc.Tables[0].TableName; GridVinc.DataSource = Source_ComodVinc; NavegadorVinc.BindingSource = Source_ComodVinc; int item = Source_ComodVinc.Find("ID_Lanc", GradeVinc.IdLanc); Source_ComodVinc.Position = item; }
//Produtos Kit private void PopularGridItens() { TabItens = Controle.ConsultaTabela("SELECT T1.ID_ITEM,T2.REFERENCIA,T2.DESCRICAO,T1.QTDE,T1.VALOR FROM PRODUTOSKIT T1 LEFT JOIN PRODUTOS T2 ON (T2.ID_PRODUTO=T1.ID_PRODUTO) WHERE T1.ID_PRDMASTER=" + Produto.IdProduto.ToString()); Source_Itens.DataSource = TabItens; Source_Itens.DataMember = TabItens.Tables[0].TableName; GridItens.DataSource = Source_Itens; Navegador.BindingSource = Source_Itens; int item = Source_Itens.Find("ID_Item", Kits.IdItem); Source_Itens.Position = item; }
private void cbZnak_SelectedValueChanged(object sender, EventArgs e) // Комбобок cbZnak (Автомобиль) { ////Вытягивание из таблицы binding строку,затем преобразовываем в тип данных DataRowView, ////вытягивание из массива данных(Row) и затем вытягивание ячейки 1 (ItemArray[1]) var id = int.Parse(cbZnak.SelectedValue.ToString()); txtGaraz.Text = ((DataRowView)_bindingAuto[_bindingAuto.Find("ID", id)])["Гаражный номер"].ToString(); txtMarka.Text = ((DataRowView)_bindingAuto[_bindingAuto.Find("ID", id)])["Марка и модель"].ToString(); lblToplivo1.Text = ((DataRowView)_bindingAuto[_bindingAuto.Find("ID", id)])["Вид топлива"].ToString(); lblToplivo2.Text = ((DataRowView)_bindingAuto[_bindingAuto.Find("ID", id)])["Дополнительный вид топлива"].ToString(); txtPriViezdiTCM.Text = _queries.GetToplivoGruz(id, 1, dtpHapka.Value).ToString(); txtPriViezdiTCM2.Text = _queries.GetToplivoGruz(id, 2, dtpHapka.Value).ToString(); txtViezdSpidometr.Text = _queries.GetMileageGruz(id, dtpHapka.Value).ToString(); txtPriVozvracheniiTCM.Text = txtPriViezdiTCM.Text; txtPriVozvracheniiTCM2.Text = txtPriViezdiTCM2.Text; txtVozvrahenieSpidometr.Text = txtViezdSpidometr.Text; txtPriVozvracheniiTCM.Text = "0"; txtPriVozvracheniiTCM2.Text = "0"; txtVozvrahenieSpidometr.Text = "0"; }
private void PopularGrid() { TabItens = Controle.ConsultaTabela("SELECT ID_REDUCAO,CODRED,REFREDUCAO,PERC FROM REDUCAOFISCAL"); Source_Itens.DataSource = TabItens; Source_Itens.DataMember = TabItens.Tables[0].TableName; GridItens.DataSource = Source_Itens; Navegador.BindingSource = Source_Itens; int item = Source_Itens.Find("ID_Reducao", RedFiscal.IdReducao); Source_Itens.Position = item; }
private void bRechercher_Click(object sender, EventArgs e) { if (radioButton1.Checked) { int i = bsf.Find("CodeFournisseur", textBox6.Text); if (i == -1) { MessageBox.Show("n'existe pas"); } else { bsf.Position = i; dv = new DataView(dt); dv.RowFilter = string.Format("CodeFournisseur='{0}'", textBox6.Text); dataGridView1.DataSource = dv; } } else if (radioButton2.Checked) { int i = bsf.Find("NomFournisseur", textBox6.Text); if (i == -1) { MessageBox.Show("n'existe pas"); } else { bsf.Position = i; dv = new DataView(dt); dv.RowFilter = string.Format("NomFournisseur='{0}'", textBox6.Text); dataGridView1.DataSource = dv; } } else if (textBox6.Text == "") { MessageBox.Show("le Champ est Vide"); } else { MessageBox.Show("Veuillez choisir le type de recherche"); } }
private void PopularGrid() { Tabela = new DataSet(); Tabela = Controle.ConsultaTabela("SELECT Id_Agente,Agente FROM AgenteCobrador ORDER BY Agente"); Source = new BindingSource(); Source.DataSource = Tabela; Source.DataMember = Tabela.Tables[0].TableName; GridDados.DataSource = Source; int item = Source.Find("ID_Agente", AgCobrador.IdAgente); Source.Position = item; }
private void PopularGrid() { Tabela = new DataSet(); Tabela = Controle.ConsultaTabela("SELECT Id_Rota,Rota,Responsavel FROM Rotas ORDER BY Rota"); Source = new BindingSource(); Source.DataSource = Tabela; Source.DataMember = Tabela.Tables[0].TableName; GridDados.DataSource = Source; int item = Source.Find("ID_Rota", Rota.IdRota); Source.Position = item; }
private void workersBtn_Click(object sender, EventArgs e) { if ((bs.Count > 0) && (dgvBrigade.SelectedRows.Count > 0)) { int ID_SS = Convert.ToInt32(((DataRowView)this.bs.Current).Row["ID_Brigade"]); workWithWorkers www = new workWithWorkers(ID_SS); www.ShowDialog(); LoadDataFromTable(); bs.Position = bs.Find("ID_Brigade", ID_SS); } }