示例#1
0
        protected void OnClick_LinkButton1(object sender, EventArgs e)
        {
            GridViewRow tabla = (GridViewRow)(((LinkButton)sender).Parent.Parent);

            //IdProducto = ((Label)tabla.FindControl("Label1")).Text.ToString();
            SqlDataSource10.SelectParameters["ID_Existencia"].DefaultValue = ((Label)tabla.FindControl("Label7")).Text.ToString();
            SqlDataSource10.DataSourceMode = SqlDataSourceMode.DataReader;
            SqlDataReader PRECIOPROD;

            PRECIOPROD = (SqlDataReader)SqlDataSource10.Select(DataSourceSelectArguments.Empty);
            if (PRECIOPROD.Read())
            {
                precioProducto = PRECIOPROD["PrecioUnitario"].ToString();
            }

            SqlDataSource10.InsertParameters["Cantidad"].DefaultValue      = ((Label)tabla.FindControl("Label4")).Text.ToString();
            SqlDataSource10.InsertParameters["Precio"].DefaultValue        = precioProducto;
            SqlDataSource10.InsertParameters["Total"].DefaultValue         = (Convert.ToDecimal(precioProducto) * Convert.ToDecimal(((Label)tabla.FindControl("Label4")).Text.ToString())).ToString();
            SqlDataSource10.InsertParameters["ID_Existencia"].DefaultValue = ((Label)tabla.FindControl("Label7")).Text.ToString();
            SqlDataSource10.InsertParameters["ID_Compra"].DefaultValue     = ((Label)tabla.FindControl("Label10")).Text.ToString();
            SqlDataSource10.Insert();

            SqlDataSource10.UpdateParameters["ID_DevPro"].DefaultValue     = ((Label)tabla.FindControl("Label1")).Text.ToString();
            SqlDataSource10.UpdateParameters["Cantidad"].DefaultValue      = ((Label)tabla.FindControl("Label4")).Text.ToString();
            SqlDataSource10.UpdateParameters["ID_Existencia"].DefaultValue = ((Label)tabla.FindControl("Label7")).Text.ToString();
            SqlDataSource10.Update();

            Response.Redirect("DevolucionEntrega.aspx");
        }
        protected void OnClick_LinkButton3(object sender, EventArgs e)
        {
            GridViewRow tabla = (GridViewRow)(((LinkButton)sender).Parent.Parent);

            SqlDataSource10.UpdateParameters["ID_DevProPro"].DefaultValue = ((Label)tabla.FindControl("Label1")).Text.ToString();
            SqlDataSource10.Update();

            Response.Redirect("DevProPro.aspx");
        }
        //protected void DropDownList6_SelectedIndexChanged(object sender, EventArgs e)
        //{
        //    int idTtienda = 0;
        //    idTtienda = Convert.ToInt32(Session["IDtienda"]);
        //    SqlDataSource2.SelectCommand = "SELECT Producto.Codigo, Producto.Codigo2, Producto.Descripcion AS Producto, MarcaProd.MarcaP, Rubro.Rubro, Modelo.Modelo, Marca.Marca, Anio.Anio, Stock.Cantidad, Stock.Ubicacion, Stock.PrecioUnitario, Stock.PrecioVenta, Stock.ID_Existencia, Medida.Medida FROM Anio INNER JOIN Stock INNER JOIN Producto ON Stock.Codigo = Producto.Codigo ON Anio.ID_Anio = Stock.ID_Anio INNER JOIN Rubro ON Producto.ID_Rubro = Rubro.ID_Rubro INNER JOIN Marca INNER JOIN Modelo ON Marca.ID_Marca = Modelo.ID_Marca ON Rubro.ID_Modelo = Modelo.ID_Modelo INNER JOIN MarcaProd ON Producto.ID_MaraProd = MarcaProd.ID_MaraProd INNER JOIN Medida on Stock.ID_Medida = Medida.ID_Medida Where (Producto.Estado = 1) AND Rubro.ID_Rubro = " + DropDownList6.SelectedValue + "AND Stock.ID_Tienda = " + idTtienda;
        //    SqlDataSource2.DataBind();
        //}

        protected void  OnClick_LinkButton1(object sender, EventArgs e)
        {
            GridViewRow tabla = (GridViewRow)(((LinkButton)sender).Parent.Parent);

            SqlDataSource4.InsertParameters["ID_Existencia"].DefaultValue = ((Label)tabla.FindControl("Label8")).Text.ToString();
            SqlDataSource4.InsertParameters["ID_Proveedor"].DefaultValue  = ((Label)tabla.FindControl("Label9")).Text.ToString();
            SqlDataSource4.InsertParameters["Factura"].DefaultValue       = ((Label)tabla.FindControl("Label2")).Text.ToString();
            SqlDataSource4.InsertParameters["Motivo"].DefaultValue        = ((Label)tabla.FindControl("Label3")).Text.ToString();
            SqlDataSource4.InsertParameters["Cantidad"].DefaultValue      = ((Label)tabla.FindControl("Label4")).Text.ToString();
            SqlDataSource4.InsertParameters["ID_Compra"].DefaultValue     = ((Label)tabla.FindControl("Label10")).Text.ToString();
            SqlDataSource4.Insert();
            SqlDataSource10.UpdateParameters["ID_DevProPro"].DefaultValue = ((Label)tabla.FindControl("Label1")).Text.ToString();
            //SqlDataSource4.UpdateParameters["Cantidad"].DefaultValue = ((Label)tabla.FindControl("Label4")).Text.ToString();
            //SqlDataSource4.UpdateParameters["idStock"].DefaultValue = ((Label)tabla.FindControl("Label8")).Text.ToString();
            SqlDataSource10.Update();

            Response.Redirect("DevProPro.aspx");
        }
        protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
        {
            string name         = ((TextBox)(DetailsView1.Rows[1].Cells[1].FindControl("TextBox1"))).Text;
            string batch        = ((DropDownList)(DetailsView1.Rows[2].Cells[1].FindControl("DropDownList5"))).SelectedValue.ToString();
            string universityID = ((DropDownList)(DetailsView1.Rows[3].Cells[1].FindControl("DropDownList6"))).SelectedValue.ToString();
            string facID        = ((DropDownList)(DetailsView1.Rows[4].Cells[1].FindControl("DropDownList7"))).SelectedValue.ToString();
            string deptID       = ((DropDownList)(DetailsView1.Rows[5].Cells[1].FindControl("DropDownList8"))).SelectedValue.ToString();

            //     AdminLogic.spEditBasicCourseInfo(Session["courseID"].ToString(), name, batch, Convert.ToInt32(universityID), Convert.ToInt32(facID), Convert.ToInt32(deptID));
            SqlDataSource10.UpdateParameters["name"].DefaultValue         = name;
            SqlDataSource10.UpdateParameters["batch"].DefaultValue        = batch;
            SqlDataSource10.UpdateParameters["universityID"].DefaultValue = universityID;
            SqlDataSource10.UpdateParameters["facultyID"].DefaultValue    = facID;
            SqlDataSource10.UpdateParameters["departmentID"].DefaultValue = deptID;
            SqlDataSource10.UpdateParameters["courseID"].DefaultValue     = Session["courseID"].ToString();

            SqlDataSource10.Update();
            DetailsView1.DataSource = SqlDataSource10;
            DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
            DetailsView1.DataBind();
        }
示例#5
0
 protected void Button14_Click(object sender, EventArgs e)
 {
     SqlDataSource10.Update();
 }