Пример #1
0
        //Eliminar
        private void backgroundWorker3_DoWork(object sender, DoWorkEventArgs e)
        {
            sqlDateBaseManager sql = new sqlDateBaseManager();
            int    id        = (int)datagridviewNE1.CurrentRow.Cells[0].Value;
            string clave     = datagridviewNE1.CurrentRow.Cells[1].Value.ToString();
            string categoria = datagridviewNE1.CurrentRow.Cells[3].Value.ToString();

            sql.deletePaquete(id);
            if (categoria == "Cristal")
            {
                sql.deleteSQLValue("costo_corte_precio", "clave", clave);
                e.Result = true;
            }
            else if (categoria == "Herraje")
            {
                sql.deleteSQLValue("herrajes", "id", sql.getIDFromClave(clave, "herrajes").ToString());
                e.Result = true;
            }
            else if (categoria == "Otros Materiales")
            {
                sql.deleteSQLValue("otros", "id", sql.getIDFromClave(clave, "otros").ToString());
                e.Result = true;
            }
        }