Exemplo n.º 1
0
        protected void UpdateInfo(object sender, EventArgs e)
        {
            try
            {
                // Verificar que todos los campos tengan datos
                if (TituloPremioSeleccionado.Text != null && TituloPremioSeleccionado.Text != "" &&
                    DescripcionPremioSeleccionado.Text != null && DescripcionPremioSeleccionado.Text != "")
                {
                    string imgUrl = UploadImage();

                    if (imgUrl == null || imgUrl == "")
                    {
                        imgUrl = premioActual.NombreImagen;
                    }

                    if (imgUrl != "Error")
                    {
                        string user = Session[StringValues.CorreoSesion].ToString();
                        ConvocatoriaService.ActualizarPremio(premioActual.cvePremio, TituloPremioSeleccionado.Text, DescripcionPremioSeleccionado.Text, imgUrl, user);
                        Response.Redirect("AdministraConvocatorias.aspx?p=" + premioActual.cvePremio + "&s=" + "success", false);
                    }
                    else
                    {
                        Response.Redirect("AdministraConvocatorias.aspx?p=" + premioActual.cvePremio + "&s=" + "failed2", false);
                    }
                }
                else
                {
                    Response.Redirect("AdministraConvocatorias.aspx?p=" + premioActual.cvePremio + "&s=" + "failed3", false);
                }
            }
            catch (Exception Ex)
            {
                Console.WriteLine("Catched Exception: " + Ex.Message + Environment.NewLine);
                Response.Redirect("AdministraConvocatorias.aspx?p=" + premioActual.cvePremio + "&s=" + "failed", false);
            }
        }