コード例 #1
0
        protected void Button_Crear_Click(object sender, EventArgs e)
        {
            if (!TextBox_NombreActividad.Text.Equals(""))
            {
                try
                {
                    ServicioRef_WebService_BD.WS_Base_DatosSoapClient WS = new ServicioRef_WebService_BD.WS_Base_DatosSoapClient();
                    DataSet ds = WS.CrearActividad(TextBox_NombreActividad.Text, Int32.Parse(DropDownList_TipoActividad.SelectedItem.Value), TextBox_DescripcionActividad.Text);

                    if (!ds.Tables[0].Rows[0].ToString().Equals("error"))
                    {
                        MessageBox_2("Se ha creado la Actividad correctamente", "Actividades.aspx");
                    }
                    else
                    {
                        MessageBox("Error al crear la actividad");
                    }
                }
                catch
                {
                    MessageBox("Error");
                }
            }
            else
            {
                MessageBox("Ingrese un nombre para la actividad.");
            }
        }