/// <summary>
    /// Click al boton guardar en el panel PopUp
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSave_Click(object sender, EventArgs e)
    {
        lblMessageSegm.Text = string.Empty;
        EmailMaintenance ExistEmail = new EmailMaintenance();

        if (Page.IsValid)
        {
            if (ddlCountries.SelectedValue != "-1")
            {
                if (tbEmail.Text.ToString().Length == 0)
                {
                    lblMessageSegm.Text = "Todos los datos son requeridos";
                    if (tbEmail.Text.ToString().Length == 0)
                    {
                        lblMessageSegm.Text = lblMessageSegm.Text + ", incluya email";
                    }
                    btnNewEmail_ModalPopupExtender.Enabled = true;
                    btnNewEmail_ModalPopupExtender.Show();
                }
                else if (ExistEmail.ExistEmailCountry(tbEmail.Text.Trim(), decimal.Parse(ddlCountries.SelectedValue)) > 0 && hdfEmail.Value != tbEmail.Text)
                {
                    lblMessageSegm.Text = "País y correo ya existen";
                    btnNewEmail_ModalPopupExtender.Enabled = true;
                    btnNewEmail_ModalPopupExtender.Show();
                }
                else
                {
                    ConfigurationTool.Command action = (ConfigurationTool.Command)Session["Action"];
                    if (action == ConfigurationTool.Command.Insert)
                    {
                        Insert();
                    }
                    else
                    {
                        Update();
                    }
                    ddlCountries.DataSourceID = odsCountries.ID;
                    odsCountries.DataBind();
                    ddlCountries.DataBind();
                }
            }
            else
            {
                lblMessageSegm.Text = "Seleccione un país";
                btnNewEmail_ModalPopupExtender.Enabled = true;
                btnNewEmail_ModalPopupExtender.Show();
            }
        }
    }
示例#2
0
 /// <summary>
 /// Click al Boton guardar
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         ConfigurationTool.Command action = (ConfigurationTool.Command)Session["Action"];
         if (action == ConfigurationTool.Command.Insert)
         {
             Insert();
         }
         else
         {
             Update();
         }
     }
 }
 /// <summary>
 /// Click al boton guardar en el panel PopUp
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnSave_Click(object sender, EventArgs e)
 {
     lblMessageSegm.Text = string.Empty;
     if (Page.IsValid)
     {
         if (ddlCountries.SelectedValue != "-1")
         {
             if (tbName.Text.ToString().Length == 0 || tbEmail.Text.ToString().Length == 0 || tbArea.Text.ToString().Length == 0)
             {
                 lblMessageSegm.Text = "Todos los datos son requeridos";
                 if (tbEmail.Text.ToString().Length == 0)
                 {
                     lblMessageSegm.Text = lblMessageSegm.Text + ", incluya email";
                 }
                 btnNewResponsible_ModalPopupExtender.Enabled = true;
                 btnNewResponsible_ModalPopupExtender.Show();
             }
             else
             {
                 ConfigurationTool.Command action = (ConfigurationTool.Command)Session["Action"];
                 if (action == ConfigurationTool.Command.Insert)
                 {
                     Insert();
                 }
                 else
                 {
                     Update();
                 }
                 ddlCountries.DataSourceID = odsCountries.ID;
                 odsCountries.DataBind();
                 ddlCountries.DataBind();
             }
         }
         else
         {
             lblMessageSegm.Text = "Seleccione un país";
             btnNewResponsible_ModalPopupExtender.Enabled = true;
             btnNewResponsible_ModalPopupExtender.Show();
         }
     }
 }