internal void validaTipoIgvDetalle() { string xcodigo = ""; sw_novaluechange = true; if (GridExaminar.Rows[GridExaminar.CurrentRow.Index].Cells["afectoigvid"].Value == DBNull.Value) { GridExaminar.Rows[GridExaminar.CurrentRow.Index].Cells["afectoigvid"].Value = ""; } xcodigo = GridExaminar.Rows[GridExaminar.CurrentRow.Index].Cells["afectoigvid"].Value.ToString(); if (xcodigo.Trim().Length > 0) { tb_co_tributoafectoventasBL BL = new tb_co_tributoafectoventasBL(); tb_co_tributoafectoventas BE = new tb_co_tributoafectoventas(); BE.destinoid = xcodigo; tmptabla = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; if (tmptabla.Rows.Count > 0) { GridExaminar.Rows[GridExaminar.CurrentRow.Index].Cells["afectoigvid"].Value = tmptabla.Rows[0]["destinoid"]; // GridExaminar.Rows[ GridExaminar.CurrentRow.Index].Cells["ddestino"].Value = tmptabla.Rows[0]["DESCRIP"]; txtDescripcampo.Text = tmptabla.Rows[0]["destinoname"].ToString(); } else { GridExaminar.Rows[GridExaminar.CurrentRow.Index].Cells["afectoigvid"].Value = j_Destino; } } else { GridExaminar.Rows[GridExaminar.CurrentRow.Index].Cells["afectoigvid"].Value = j_Destino; } sw_novaluechange = false; totalizarItem(); }
private BindingSource NewMethodDestino() { tb_co_tributoafectoventasBL BL = new tb_co_tributoafectoventasBL(); tb_co_tributoafectoventas BE = new tb_co_tributoafectoventas(); DataTable table = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; DataRowCollection rows = table.Rows; object[] cell; Dictionary<string, string> dic = new Dictionary<string, string>(); BindingSource binding = new BindingSource(); foreach (DataRow item in rows) { cell = item.ItemArray; dic.Add(cell[0].ToString(), cell[0].ToString() + " - " + cell[1].ToString()); cell = null; } binding.DataSource = dic; return binding; }
public void validaTipoIgv() { string xcodigo = ""; xcodigo = Equivalencias.Left(cboDestinoigv.Text, 1); tb_co_tributoafectoventasBL BL = new tb_co_tributoafectoventasBL(); tb_co_tributoafectoventas BE = new tb_co_tributoafectoventas(); BE.destinoid = xcodigo; tmptabla = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; if (tmptabla.Rows.Count > 0) { xcodigo = tmptabla.Rows[0]["destinoid"].ToString(); if (!(Equivalencias.Left(cboDestinoigv.Text, 1) == "3")) { sw_novaluechange = true; if ((DetFacturacion != null)) { if (DetFacturacion.Rows.Count > 0) { DetFacturacion.Rows[lc_contador]["afectoigvid"] = Equivalencias.Left(cboDestinoigv.Text, 1); } } sw_novaluechange = false; } } else { cboDestinoigv.ValueMember = j_String; } GridExaminar.Refresh(); refrescacontroles(); }
private void POnerDatos() { var sorted = default(SortOrder); var xnomcolumna = string.Empty; var BL = new tb_co_tributoafectoventasBL(); var BE = new tb_co_tributoafectoventas(); var Tipoigv = BL.GetAll(VariablesPublicas.EmpresaID.ToString(), BE).Tables[0]; dgAyuda.AutoGenerateColumns = false; dgAyuda.DataSource = Tipoigv; if (xnomcolumna.Trim().Length > 0) { if (sorted == SortOrder.Ascending) { dgAyuda.Sort(dgAyuda.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Ascending); } else { dgAyuda.Sort(dgAyuda.Columns[xnomcolumna], System.ComponentModel.ListSortDirection.Descending); } } else { dgAyuda.Sort(dgAyuda.Columns["destinoid"], System.ComponentModel.ListSortDirection.Ascending); } }