Beispiel #1
0
        //Crea y envía el correo de información de la firma creada
        private void SendEMail(string cc)
        {
            string body = string.Empty;

            body = string.Concat(body, "MyCTS le da la bienvenida, a continuación se anexan los datos de su firma:\n", "\n",
                                 "Status: ALTA \n", "\n",
                                 "Firma:  ", txtNumberFirm.Text, "\n",
                                 "Agent:  ", txtCodeAgent.Text, "\n",
                                 "Queue:  ", txtQueue.Text, "\n",
                                 "PCC:    ", txtPCC.Text, "\n",
                                 "TA:     ", txtTA.Text, "\n",
                                 "Contraseña:    tmp1234 (Al ingresar por primera vez, se te solicitara asignar una nueva contraseña)\n",
                                 "Nombre Sabre: ", txtInitial.Text, " ", txtLastName.Text, "\n",
                                 "Usuario:      ", txtName.Text.ToLower(), "\n",
                                 "Correo:       ", txtEmail.Text.ToLower(), "\n", "\n",
                                 "   **La contraseña debe contener un mínimo de 7 caracteres y un máximo 8.", "\n",
                                 "   Debe contener por lo menos 1 carácter alfabético y 1 numérico.", "\n",
                                 "   No se permiten las letras Q ni Z.", "\n",
                                 "   No se permiten usar las últimas 4 contraseñas de esta firma.", "\n",
                                 "   No se permite repetir más de 3 caracteres Ej. AAAA", "\n",
                                 "   No se permite usar nombres de ciudades Ej. DALLAS", "\n",
                                 "   La contraseña se debe cambiar cada 90 días", "\n",
                                 "   Después de 6 intentos la contraseña se bloqueará por 30 minutos.", "\n",
                                 "Para cualquier problema con la firma llamar el área de Mesa de Servicio", "\n", "\n",
                                 "Mesa de Servicio", "\n",
                                 "Corporate Travel Services", "\n",
                                 "Tel. 85252222 Ext. 9999");
            MailProvider ws = new MailProvider();

            ws.SendEmail2("*****@*****.**", "not", null,
                          txtEmail.Text.ToLower(), cc, "MyCTS Informa - Creación de Firma", body);
        }
 /// <summary>
 /// Método que envía correo electrónico
 /// </summary>
 /// <param name="mailToSend">Direccion email de quien envía el correo</param>
 /// <param name="psw">Password de quien envía el correo</param>
 /// <param name="diplayName">Nombre de quien envia el correo</param>
 /// <param name="mailToValidate">Direcciones de email a quienes se les envia el correo</param>
 /// <param name="mailCC">Direcciones de email a quienes se les envia el correo con copia</param>
 /// <param name="subject">Asunto del correo</param>
 /// <param name="body">Texto que se envia el correo</param>
 private void SendMail2(string mailToSend, string psw, string diplayName, string mailToValidate,
                        string mailCC, string subject, string body)
 {
     try
     {
         MailProvider ws = new MailProvider();
         ws.SendEmail2(mailToSend, psw, diplayName, mailToValidate, mailCC, subject, body);
     }
     catch { }
 }
        private void btnActivation_Click(object sender, EventArgs e)
        {
            DialogResult yesNo = MessageBox.Show("¿SEGURO QUE DESEA ACTIVAR LA REGLA " + txtRuleNumber.Text + " PARA EL CORPORATIVO " + attribute1 + "?", Resources.Constants.MYCTS, MessageBoxButtons.YesNo, MessageBoxIcon.Information);

            if (yesNo.Equals(DialogResult.Yes))
            {
                ActivationFeeRuleBL.ActivationFeeRule(Convert.ToInt32(txtRuleNumber.Text));
                try
                {
                    List <GetMailByUser> mailAndUserList = GetMailByUserBL.GetMailAndUser(agent);
                    string info = string.Concat("Hola ",
                                                mailAndUserList[0].FamilyName, "\n\n",
                                                "MyCTS te informa que la regla de cargo por servicio número ",
                                                txtRuleNumber.Text, " ya se encuentra activa para el corporativo ",
                                                corp, "\n\n",
                                                "Te recordamos que los criterios para su aplicación son los siguientes:", "\n\n");
                    info = string.Concat(info, "  -", "PORCENTAJE DE LA TARIFA BASE: ".ToUpper().PadRight(35, ' '), listInformationRule[0].DefaultFee, "\n\n");
                    info = string.Concat(info, "  -", "Cantidad Fija:".ToUpper().PadRight(35, ' '), "$", listInformationRule[0].DefaultMount.ToString("0.00"), "\n\n");
                    info = string.Concat(info, "  -", "Monto: ".ToUpper().PadRight(35, ' '), (listInformationRule[0].Mandatory) ? "No Negociable" : "Negociable", "\n\n");
                    if (listInfoFeeRule[aux].StartDate != Types.DateNullValue)
                    {
                        info = string.Concat(info, "  -", "Inicio de regla: ".ToUpper().PadRight(35, ' '), listInfoFeeRule[aux].StartDate.ToString("dd-MM-yyyy"), "\n\n");
                    }
                    if (listInfoFeeRule[aux].ExpirationDate != Types.DateNullValue)
                    {
                        info = string.Concat(info, "  -", "Fin de regla: ".ToUpper().PadRight(35, ' '), listInfoFeeRule[aux].ExpirationDate.ToString("dd-MM-yyyy"), "\n\n");
                    }
                    if (!string.IsNullOrEmpty(listInformationRule[0].Value2) && !string.IsNullOrEmpty(listInformationRule[0].Target))
                    {
                        for (int i = 0; i < listInformationRule.Count; i++)
                        {
                            info = string.Concat(info, "  -", string.Concat(
                                                     listInformationRule[i].Target,
                                                     ": ").ToUpper().PadRight(35, ' '),
                                                 listInformationRule[i].Value2,
                                                 "\n\n");
                        }
                    }
                    if (listLocationDK.Count > 0)
                    {
                        string locationDKNotAccepted = string.Empty;
                        for (int j = 0; j < listLocationDK.Count; j++)
                        {
                            locationDKNotAccepted = string.Concat(locationDKNotAccepted, listLocationDK[j].LocationDK, ", ");
                        }
                        locationDKNotAccepted = locationDKNotAccepted.Trim().TrimEnd(new char[] { ',' });
                        info = string.Concat(info, "  -", "Location(DK) Excluyente:".ToUpper().PadRight(35, ' '), locationDKNotAccepted, "\n");
                    }
                    info = string.Concat(info, "\n\n", "Gracias por haber creado esta regla");
                    Parameter    mailToSend   = ParameterBL.GetParameterValue("MailThatSendFeeRule");
                    Parameter    mailPassword = ParameterBL.GetParameterValue("PasswordThatMailToSend");
                    Parameter    displyName   = ParameterBL.GetParameterValue("NameSendEmail");
                    MailProvider ws           = new MailProvider();
                    ws.SendEmail2(mailToSend.Values, mailPassword.Values, displyName.Values,
                                  mailAndUserList[0].UserMail, null, "Activación de Regla Cargo por Servicio", info);
                }
                catch { }
                MessageBox.Show("LA REGLA " + txtRuleNumber.Text + " QUEDO ACTIVA PARA EL CORPORATIVO " + attribute1, Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
                Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
            }
            else
            {
                btnClear.Focus();
            }
        }