Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void editMail(object sender, EventArgs e)
        {
            {
                if (this.IsPostBack)
                {
                    this.Validate();
                    if (this.IsValid)
                    {
                        try
                        {
                            ServicioGestionClient proxy = new ServicioGestionClient();

                            int id = Convert.ToInt32(Request.QueryString["id"]);

                            if (id != 0)
                            {
                                // Obtengo el objeto empresa
                                var email = proxy.getEmailId(id);

                                if (email != null)
                                {
                                    bool res = proxy.editEmail(id, this.mail.Text);

                                    if (res != false)
                                    {
                                        Response.Redirect("Default.aspx");
                                    }
                                }
                                else
                                {
                                    /*this.lblError.Visible = true;
                                    this.lblError.Text = "No se puede añadir este registro. El email ya existe en la base de datos.";*/
                                }
                            }
                        }
                        catch (Exception err)
                        {
                            // this.lblError.Text = err.Message;
                            // this.alert.Visible = true;
                        }
                    } // Fin del if (this.IsValid)
                }// Fin del if (this.IsPostBack)
            }// Fin del addMail
        }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                // El label visible a false
                // this.lblError.Visible = false;

                ServicioGestionClient proxy = new ServicioGestionClient();

                // Obtemos el id del email
                int id = Convert.ToInt32(Request.QueryString["id"]);

                var emailComun = proxy.getEmailId(id);

                this.labelmail.Text = emailComun.Correo;

                this.mail.Text = emailComun.Correo;
            }
        }