Exemplo n.º 1
0
        protected void dgListaVehiculos_Command(Object sender, DataGridCommandEventArgs e)
        {
            string codVehiculo = ((DataBoundLiteralControl)e.Item.Cells[0].Controls[0]).Text.Replace("\n", "").Replace("\r", "").Replace("\t", "");
            string placaVeh    = ((DataBoundLiteralControl)e.Item.Cells[2].Controls[0]).Text.Replace("\n", "").Replace("\r", "").Replace("\t", "");

            if (e.CommandName == "editar")
            {
                string redirect = null;

                if (esOferente)
                {
                    redirect = String.Format("{0}?process=Asousados.IngresoVehiculo&id={1}&modifica=S&oferente=S",
                                             indexPage, codVehiculo);
                }
                else
                {
                    redirect = String.Format("{0}?process=Asousados.IngresoVehiculo&id={1}&modifica=S",
                                             indexPage, codVehiculo);
                }

                Response.Redirect(redirect);
            }
            else if (e.CommandName == "remover")
            {
                Hashtable deletePk = new Hashtable();
                string    tabla    = "MVEHICULOUSADO";

                //deletePk.Add("MVEH_SECUENCIA", codVehiculo);
                deletePk.Add("MCAT_PLACA", placaVeh);
                DBFunctions.DeleteHashtable(tabla, deletePk);

                prepararTablaVehiculos();
            }
        }
Exemplo n.º 2
0
        public static void eliminarVendedor(string codigoVend)
        {
            Hashtable deletePk = new Hashtable();
            string    tabla    = "PVENDEDOR";

            DBFunctions.NonQuery("update mvehiculousado set pven_asignado=null where pven_asignado=" + codigoVend);

            deletePk.Add("PVEN_SECUENCIA", codigoVend);
            DBFunctions.DeleteHashtable(tabla, deletePk);
        }