Пример #1
0
    public static void updatearEvaluador(VALORACIONESPROGRESS.formulario_id2 form2)
    {
        VALORACIONESPROGRESS.formulario_id2  evaluacion    = null;
        IB.Progress.BLL.VALORACIONESPROGRESS evaluacionBLL = null;
        try
        {
            string        responsable = String.Empty;
            StringBuilder sb          = new StringBuilder();

            int idficepiConectado = int.Parse(((IB.Progress.Models.Profesional)HttpContext.Current.Session["PROFESIONAL"]).t001_idficepi.ToString());

            IB.Progress.BLL.VALORACIONESPROGRESS valpro = new IB.Progress.BLL.VALORACIONESPROGRESS();
            valpro.UpdateEvaluador(form2);
            valpro.Dispose();

            evaluacionBLL = new IB.Progress.BLL.VALORACIONESPROGRESS();
            evaluacion    = evaluacionBLL.Select2(idficepiConectado, form2.t930_idvaloracion);
            evaluacionBLL.Dispose();

            //Envío de correos
            if (form2.t930_fecfirmaevaluador != null)
            {
                if (((IB.Progress.Models.Profesional)HttpContext.Current.Session["PROFESIONAL"]).Sexo.ToString() == "V")
                {
                    responsable = "evaluador";
                }
                else
                {
                    responsable = "evaluadora";
                }

                sb.Append(evaluacion.Nombreevaluado + ", tu " + responsable + " " + ((IB.Progress.Models.Profesional)HttpContext.Current.Session["PROFESIONAL"]).nombrecorto.ToString() + ", ha cumplimentado y firmado tu evaluación.");
                sb.Append(" A partir de este momento, dispones de 15 días para hacer las anotaciones oportunas y firmarla. Transcurrido este plazo, si no la has firmado, la evaluación se cerrará automáticamente.</br></br>");
                sb.Append("</br></br>Si te encuentras en las oficinas de IBERMÁTICA, puedes acceder directamente pulsando <a href=" + ConfigurationManager.AppSettings["urlInterna"] + "/Default.aspx?FEVADO=true>aquí</a>");
                sb.Append("</br>Si estás fuera, puedes acceder pulsando <a href=" + ConfigurationManager.AppSettings["UrlExterna"] + "/Default.aspx?FEVADO=true>aquí</a>");

                Correo.Enviar("PROGRESS: Firma de tu " + responsable + "", sb.ToString(), evaluacion.Correoevaluado);
            }
        }
        catch (Exception ex)
        {
            if (evaluacionBLL != null)
            {
                evaluacionBLL.Dispose();
            }
            IB.Progress.Shared.Smtp.SendSMTP("Error al actualizar el evaluador del colectivo TAU", ex.ToString());
            throw ex;
        }
    }