Ejemplo n.º 1
0
        public void LlenarDropDownMaterial()
        {
            DataTable  dt   = new DataTable();
            Materiales mate = new Materiales();

            dt = mate.Listado("*", "--", "--");
            for (int i = 0; i <= dt.Rows.Count - 1; i++)
            {
                MaterialesDropDownList.Items.Add(Convert.ToString(mate.Listado("*", "--", "--").Rows[i]["Detalle"]));
            }
        }
        private void LlenarDropDownList()
        {
            MaterialDropDownList.DataSource     = material.Listado(" * ", " 1=1 ", " ");
            MaterialDropDownList.DataTextField  = "Descripcion";
            MaterialDropDownList.DataValueField = "IdMaterial";
            MaterialDropDownList.DataBind();

            PrecioDropDownList.DataSource     = material.Listado(" * ", " 1=1 ", " ");
            PrecioDropDownList.DataTextField  = "Precio";
            PrecioDropDownList.DataValueField = "IdMaterial";
            PrecioDropDownList.DataBind();
        }
Ejemplo n.º 3
0
        private void CargarDropDList()
        {
            Materiales material = new Materiales();

            materialDropDownList.DataSource     = material.Listado("Descripcion", "1=1", "");
            materialDropDownList.DataTextField  = "Descripcion";
            materialDropDownList.DataValueField = "Descripcion";
            materialDropDownList.DataBind();
        }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Materiales m  = new Materiales();
            DataTable  dt = new DataTable();

            ca.Total += ca.Total;
            if (!IsPostBack)
            {
                MaterialDropDownList.DataSource     = m.Listado("*", "1=1", "");
                MaterialDropDownList.DataTextField  = "Descripcion";
                MaterialDropDownList.DataValueField = "IdMaterial";
                MaterialDropDownList.DataBind();

                dt.Columns.AddRange(new DataColumn[3] {
                    new DataColumn("Material"), new DataColumn("Cantidad"), new DataColumn("Precio")
                });
                ViewState["Detalle"] = dt;
                ViewState["Total"]   = ca.Total;//Tal vez halla una mejor forma de hacerlo pero cree esta session o viewstate que es lo mismo, para poder ir guardando el total sin que me sufra ningun cambio cuando la pag haga load...
            }//habia borrado absolutamente como se hacia esto, mi confuncion fue mas al nunca haberlo intentado antes con textbox unicamente, siempre lo habia practicado con Dropdawnlist
        }
Ejemplo n.º 5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string Text  = Request.QueryString["Text"];
                string Orden = Request.QueryString["Orden"];

                Materiales mate = new Materiales();

                MaterialesReportViewer.LocalReport.DataSources.Clear();
                MaterialesReportViewer.ProcessingMode = ProcessingMode.Local;


                MaterialesReportViewer.LocalReport.ReportPath = @"Reportes\MaterialesReport.rdlc";

                ReportDataSource source = new ReportDataSource("MaterialesDataSet", mate.Listado("*", Text, Orden));

                MaterialesReportViewer.LocalReport.DataSources.Add(source);
                MaterialesReportViewer.LocalReport.Refresh();
            }
        }
Ejemplo n.º 6
0
        protected void BuscarButton_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(BuscarTextBox.Text) && MaterialesDropDownList.Text != "Todos Los Materiales")
            {
                Utilitarios.ShowToastr(this, "Campo Buscar Vacio", "Mensaje", "error");
            }
            else
            {
                Ordenes();
                MaterialesGridView.DataSource = mate.Listado("*", this.Text, this.Orden);
                MaterialesGridView.DataBind();
            }

            if (MaterialesGridView.Rows.Count > 0)
            {
                ImprimirButton.Visible = true;
            }
            else
            {
                ImprimirButton.Visible = false;
            }
        }
Ejemplo n.º 7
0
 protected void BuscarButton_Click(object sender, EventArgs e)
 {
     MaterialesGridView.DataSource = mate.Listado("*", " where IdMaterial=" + BuscarTextBox.Text, " --");
     MaterialesGridView.DataBind();
 }