Пример #1
0
        public void ConsultaDatosInsumos()

        {
            Clases.clsUtilidades ut = new Clases.clsUtilidades();
            ds = pd.ConsultasCombos("paConsultas", "1");

            if (TipoConsulta_ == "Insumos")
            {
                dgvMaestros.DataSource = ds.Tables[0];

                ut.FormatearGrid(dgvMaestros, "Precio", "C");
            }
            else if (TipoConsulta_ == "Clientes")
            {
                gbppal.Text                       = "Clientes";
                dgvMaestros.DataSource            = ds.Tables[1];
                dgvMaestros.Columns["Id"].Visible = false;
            }
            else if (TipoConsulta_ == "Compañias")
            {
                gbppal.Text            = "Compañias";
                dgvMaestros.DataSource = ds.Tables[2];
                dgvMaestros.Columns["IdCompañia"].Visible = false;
                dgvMaestros.Columns["Logo"].Visible       = false;
            }
            ut.AlinearContenidoColumna(dgvMaestros);
            dgvMaestros.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
        }
Пример #2
0
        private void Refresh()
        {
            ds = pd.ConsultasCombos("paConsultas", "0");
            //string[] s = ds.Tables[1].Rows.OfType<DataRow>().Select(k => k[2].ToString()).ToArray();

            cbbResolucion.DataSource  = ds.Tables[0];
            cbbResolucion.ValueMember = "NumeroResolucion";
            this.cbbResolucion.AutoCompleteCustomSource.AddRange(ds.Tables[0].Rows.OfType <DataRow>().Select(k => k[0].ToString()).ToArray());
            this.cbbResolucion.AutoCompleteMode   = AutoCompleteMode.Suggest;
            this.cbbResolucion.AutoCompleteSource = AutoCompleteSource.CustomSource;

            //this.cbbCliente.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
            //this.cbbCliente.AutoCompleteSource = AutoCompleteSource.ListItems;
            // dtv = new DataView(ds.Tables[1]);
            //dtv.Sort = "RazonSocial ASC";
            //DataTable dt = dtv.ToTable();
            cbbCliente.DataSource    = ds.Tables[1];
            cbbCliente.DisplayMember = "RazonSocial";
            cbbCliente.ValueMember   = "IdCliente";
            cbbCliente.Text          = "Seleccione un cliente";

            txtNumFac.Text                 = ds.Tables[2].Rows[0]["NumFac"].ToString();
            dgvInsumos.DataSource          = ds.Tables[3];
            dgvInsumos.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells;
            //dgvInsumos.Columns["Precio"].DefaultCellStyle.FormatProvider= System.Globalization.CultureInfo.GetCultureInfo("en-us");
            //dgvInsumos.Columns["Precio"].DefaultCellStyle.Format =string.Format( "C");
            Utilidades.FormatearGrid(dgvInsumos, "Precio", "C");

            cbbCompania.DataSource    = ds.Tables[5];
            cbbCompania.DisplayMember = "RazonSocial";
            cbbCompania.ValueMember   = "IdCompañia";

            cbbSede.Text = "";
            this.dtpFechaFactura.Value    = DateTime.Now;
            this.dtpFechavencimento.Value = DateTime.Now;
            textBox1.Text = "";
            errorProvider1.Clear();
        }