Example #1
0
        protected void Button_Eliminar_Click(object sender, EventArgs e)
        {
            //var text = (listBox1.SelectedItem as DataRowView)["columnName"].ToString();
            // string actividadAEliminar = String.Join(", ",ListBox_Actividades.Items.Cast<ListItem>().Where(i=>i.Selected).Select(i => i.Value).ToString());

            if (itemSeleccionado == null)
            {
                MessageBox("Seleccione una actividad para poder eliminarla.");
            }
            else
            {
                ServicioRef_WebService_BD.WS_Base_DatosSoapClient WS = new ServicioRef_WebService_BD.WS_Base_DatosSoapClient();
                DataSet ds = WS.EliminarActividad(itemSeleccionado.Value.ToString());

                if (!ds.Tables[0].Rows[0].Equals("error"))
                {
                    MessageBox_2("Se ha eliminado la actividad correctamente.", "Actividades.aspx");
                }
                else
                {
                    MessageBox("Error al eliminar");
                }
            }
        }