Пример #1
0
        protected void GridView4_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int index = Convert.ToInt32(e.RowIndex);

            dt3 = (DataTable)ViewState["Detalles3"];
            dt3.Rows[index].Delete();
            GridView4.DataSource = dt3;
            GridView4.DataBind();
            Button6_ModalPopupExtender.Show();
        }
Пример #2
0
        protected void Btn_RubroAnios(object sender, EventArgs e)
        {
            if (DropDownList6.SelectedItem.ToString() != "")
            {
                dt3.Columns.Add("Marca");
                dt3.Columns.Add("Linea");
                dt3.Columns.Add("ID_Rubro");
                dt3.Columns.Add("Rubro");
                dt3.Columns.Add("Anio_Inicial");
                dt3.Columns.Add("Anio_Final");

                DataRow dr = null;
                if (ViewState["Detalles3"] != null)
                {
                    for (int i = 0; i < 1; i++)
                    {
                        dt3 = (DataTable)ViewState["Detalles3"];
                        if (dt3.Rows.Count > 0)
                        {
                            dr = dt3.NewRow();
                            //  dr["ID"] = Label1.Text;
                            dr["Marca"]        = DropDownList3.SelectedItem.ToString();
                            dr["Linea"]        = DropDownList5.SelectedItem.ToString();
                            dr["ID_Rubro"]     = DropDownList6.SelectedValue.ToString();
                            dr["Rubro"]        = DropDownList6.SelectedItem.ToString();
                            dr["Anio_Inicial"] = DropDownList4.SelectedItem.ToString();
                            dr["Anio_Final"]   = DropDownList9.SelectedItem.ToString();
                            dt3.Rows.Add(dr);
                            GridView4.DataSource = dt3;
                            GridView4.DataBind();
                        }
                    }
                }
                else
                {
                    dr = dt3.NewRow();
                    // dr["ID"] = Label1.Text;
                    dr["Marca"]        = DropDownList3.SelectedItem.ToString();
                    dr["Linea"]        = DropDownList5.SelectedItem.ToString();
                    dr["ID_Rubro"]     = DropDownList6.SelectedValue.ToString();
                    dr["Rubro"]        = DropDownList6.SelectedItem.ToString();
                    dr["Anio_Inicial"] = DropDownList4.SelectedItem.ToString();
                    dr["Anio_Final"]   = DropDownList9.SelectedItem.ToString();
                    dt3.Rows.Add(dr);
                    GridView4.DataSource = dt3;
                    GridView4.DataBind();
                }
                ViewState["Detalles3"] = dt3;
            }
            else
            {
                Response.Write("<script>alert('Ingrese un codigo')</script>");
            }
            Button6_ModalPopupExtender.Show();
        }
Пример #3
0
        protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable tablaProd = new DataTable();

            GridViewRow dt = GridView2.SelectedRow;

            ID_E     = dt.Cells[8].Text;
            anticipo = dt.Cells[5].Text;
            nit      = Convert.ToInt32(dt.Cells[0].Text);
            // CodProd = dt.Cells[2].Text;
            // tablaProd = Datos.BuscarProducto2(CodProd);
            // IdProd = dt.Cells[5].Text;
            Resto          = Convert.ToDecimal(dt.Cells[6].Text) - Convert.ToDecimal(anticipo);
            TextBox8.Text  = Resto.ToString();
            TextBox10.Text = nit.ToString() + " " + dt.Cells[1].Text;
            Button6_ModalPopupExtender.Show();
        }
Пример #4
0
        protected void GridView1_SelectedIndexChanged1(object sender, EventArgs e)
        {
            string      miValor, miValor2, miValor3;
            GridViewRow r = GridView1.SelectedRow;

            IDstock.Text  = r.Cells[1].Text;
            Cant.Text     = r.Cells[3].Text;
            Ubi.Text      = r.Cells[4].Text;
            PrecioP.Text  = r.Cells[5].Text;
            PrecioVe.Text = r.Cells[6].Text;
            miValor       = r.Cells[11].Text;
            miValor2      = r.Cells[13].Text;
            miValor3      = r.Cells[14].Text;
            DropDownList7.SelectedIndex  = DropDownList7.Items.IndexOf(DropDownList7.Items.FindByText(miValor));
            DropDownList9.SelectedIndex  = DropDownList9.Items.IndexOf(DropDownList9.Items.FindByText(miValor2));
            DropDownList10.SelectedIndex = DropDownList10.Items.IndexOf(DropDownList10.Items.FindByText(miValor3));
            Button6_ModalPopupExtender.Show();
        }
Пример #5
0
        protected void Button5_Click(object sender, EventArgs e)
        {
            try
            {
                string msj;
                int    idTtienda = 0;

                idTtienda = Convert.ToInt32(Session["IDtienda"]);
                Stream imgStream     = FileUpload2.PostedFile.InputStream;
                int    imgLen        = FileUpload2.PostedFile.ContentLength;
                byte[] imgBinaryData = new byte[imgLen];
                int    n             = imgStream.Read(imgBinaryData, 0, imgLen);


                msj = DatosP.InsertarProducto(producto2.Text, descripcion2.Text, imgBinaryData, Convert.ToInt32(DropDownList14.SelectedValue));


                foreach (GridViewRow row in GridView3.Rows)
                {
                    DatosP.insertarOEM(row.Cells[1].Text, Convert.ToInt32(msj), Convert.ToInt32(row.Cells[3].Text));
                }

                foreach (GridViewRow row in GridView2.Rows)
                {
                    DatosP.insertarCodigoMarcaPrd(row.Cells[1].Text, Convert.ToInt32(msj), Convert.ToInt32(row.Cells[3].Text));
                }

                foreach (GridViewRow row in GridView4.Rows)
                {
                    DatosP.insertarAnioProducto(Convert.ToInt32(msj), Convert.ToInt32(row.Cells[3].Text), row.Cells[5].Text, row.Cells[6].Text);
                }
                Response.Write("<script>alert('Datos guardado correctamente!')</script>");
                limpirar();
            }
            catch
            {
                Response.Write("<script>alert('Llene los campos correctamente')</script>");
                Button6_ModalPopupExtender.Show();
            }
        }
Пример #6
0
 protected void PrecioVe_TextChanged(object sender, EventArgs e)
 {
     try
     {
         if (Convert.ToDecimal(PrecioVe.Text) == 0)
         {
             //double precioGan = ;
             double precioVentaP = Convert.ToDouble(PrecioP.Text) * 2;
             PrecioVe.Text = precioVentaP.ToString();
         }
         else
         {
             double precioGan    = Convert.ToDouble(PrecioVe.Text) * 0.5385;
             double precioVentaP = precioGan + Convert.ToDouble(PrecioVe.Text);
             PrecioVe.Text = precioVentaP.ToString();
         }
     }
     catch
     {
         Response.Write("<script>alert('Error, solamente numeros')</script>");
     }
     Button6_ModalPopupExtender.Show();
 }
Пример #7
0
 protected void DropDownList13_SelectedIndexChanged(object sender, EventArgs e)
 {
     Button6_ModalPopupExtender.Show();
 }
Пример #8
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     //limpirar();
     Button6_ModalPopupExtender.Show();
 }
Пример #9
0
        protected void Btn_AgergarCodigo(object sender, EventArgs e)
        {
            if (Equival.Text != "")
            {
                SqlDataSource23.SelectParameters["Codigo"].DefaultValue = Equival.Text;
                SqlDataSource23.DataSourceMode = SqlDataSourceMode.DataReader;
                SqlDataReader total;
                total = (SqlDataReader)SqlDataSource23.Select(DataSourceSelectArguments.Empty);
                if (total.Read())
                {
                    if (Convert.ToInt32(total["Total"]) == 0)
                    {
                        dt2.Columns.Add("Codigo");
                        dt2.Columns.Add("Marca_Prod");
                        dt2.Columns.Add("ID_Marca_P");

                        DataRow dr = null;
                        if (ViewState["Detalles"] != null)
                        {
                            for (int i = 0; i < 1; i++)
                            {
                                dt2 = (DataTable)ViewState["Detalles"];
                                if (dt2.Rows.Count > 0)
                                {
                                    dr = dt2.NewRow();
                                    //  dr["ID"] = Label1.Text;
                                    dr["Codigo"]     = Equival.Text;
                                    dr["Marca_Prod"] = DropDownList12.SelectedItem.ToString();
                                    dr["ID_Marca_P"] = DropDownList12.SelectedValue.ToString();
                                    dt2.Rows.Add(dr);
                                    GridView2.DataSource = dt2;
                                    GridView2.DataBind();
                                }
                            }
                        }
                        else
                        {
                            dr = dt2.NewRow();
                            // dr["ID"] = Label1.Text;
                            dr["Codigo"]     = Equival.Text;
                            dr["Marca_Prod"] = DropDownList12.SelectedItem.ToString();
                            dr["ID_Marca_P"] = DropDownList12.SelectedValue.ToString();
                            dt2.Rows.Add(dr);
                            GridView2.DataSource = dt2;
                            GridView2.DataBind();
                        }
                        ViewState["Detalles"] = dt2;
                        Equival.Text          = "";
                    }
                    else
                    {
                        Response.Write("<script>alert('El codigo aparece en la base de datos, revise si ya esta registrado!')</script>");
                    }
                }
                //////////////////
            }
            else
            {
                Response.Write("<script>alert('Ingrese un codigo')</script>");
            }
            Button6_ModalPopupExtender.Show();
        }