示例#1
0
    public static string WEnviarCorreoSolicitud(string sIdSolicitud, string sNumero, string sFecha, string sIdCamion, string sNombreChoferes, string sCorreos,
                                                string sHora, string sValorRetiro)
    {
        JavaScriptSerializer scriptSerializer = new JavaScriptSerializer();
        List <string>        Lista            = new List <string>();
        Usuario usr = new Usuario();

        if (!UtilWeb.CheckSession(Lista, ref usr, HttpContext.Current))
        {
            return(scriptSerializer.Serialize(Lista.ToArray()));
        }

        try
        {
            double IdNew = 0;
            usr.ReadMunic();
            string sIdClienteMunicipio = UtilWeb.GetDatoSingular("Id", usr.oClienteMunicipio.Datos);

            double    IdOT      = 0;
            double    IdSoltemp = 0;
            Solicitud solic     = new Solicitud(usr);
            if (solic.Read(sIdSolicitud))
            {
                Ot ot = new Ot(usr);
                if (double.TryParse(sIdSolicitud, out IdSoltemp))
                {
                    IdOT = ot.ReadByIdSolicitud(sIdSolicitud);
                }
                VehRecolector camion = new VehRecolector(usr);
                camion.Read(sIdCamion);

                //Viene leida la OT
                string CorreoString = File.ReadAllText(HttpContext.Current.Server.MapPath("~/templates") + "/correoavisoaciudadano.txt");
                CorreoString = CorreoString.Replace("[FECHA_RETIRO]", sFecha);
                CorreoString = CorreoString.Replace("[HORA_RETIRO]", sHora);
                CorreoString = CorreoString.Replace("[PATENTE_CAMION_RETIRO]", camion.Datos.Rows[0]["NombreTagPatente"].ToString());
                CorreoString = CorreoString.Replace("[CHOFER_CAMION_RETIRO]", sNombreChoferes);
                CorreoString = CorreoString.Replace("[NUMERO_FONO_PARA_LLAMAR_CIUDADANO]",
                                                    ConfigurationManager.AppSettings["NUMERO_FONO_PARA_LLAMAR_CIUDADANO"].ToString());

                string CorreoDestino = sCorreos;
                UtilWeb.SendMail(CorreoString, CorreoDestino, "ASIGNACIÓN DE RETIRO", false);
            }

            Lista.Add("Exito");
        }
        catch (Exception ex)
        {
            Lista.Add("Exception");
            Lista.Add(ex.Message);
            Lista.Add("Hubo un error no controlado en la aplicación, por favor inténtelo nuevamente, si el problema persiste contactarse con el administrador sistemas para revisar el log de eventos del servidor.");
        }
        return(scriptSerializer.Serialize(Lista.ToArray()));
    }
示例#2
0
    public static string WGrabarSolicitud(string sNombre, string sRut, string sDireccion, string sCorreo, string sTelefono,
                                          string sTipo_residuo, string sComentarios, string sIdMunic)
    {
        JavaScriptSerializer scriptSerializer = new JavaScriptSerializer();
        List <string>        Lista            = new List <string>();

        //Usuario usr = new Usuario();
        //if (!UtilWeb.CheckSession(Lista, ref usr, HttpContext.Current))
        //    return scriptSerializer.Serialize(Lista.ToArray());

        try
        {
            double    IdNew     = 0;
            Solicitud solicitud = new Solicitud();
            IdNew = solicitud.Create(sNombre, sRut, sDireccion, sCorreo, sTelefono, sTipo_residuo, sComentarios, sIdMunic);

            //WLeerUsuarioConectadoAndMunicipios_Internal(usr, ref html);

            string CorreoString = File.ReadAllText(HttpContext.Current.Server.MapPath("~/templates") + "/correorecepcionsolicitud.txt");
            CorreoString = CorreoString.Replace("[FECHA_RETIRO]", UtilWeb.GetDateNow().ToShortDateString());
            CorreoString = CorreoString.Replace("[NUMERO_FONO_PARA_LLAMAR_CIUDADANO]",
                                                ConfigurationManager.AppSettings["NUMERO_FONO_PARA_LLAMAR_CIUDADANO"].ToString());

            string CorreoDestino = sCorreo;
            UtilWeb.SendMail(CorreoString, CorreoDestino, "AViSO DE RECEPCIÓN DE SOLICITUD", false);

            Lista.Add("Exito");
            Lista.Add(string.Format("La Solicitud fue grabada con éxito. Folio de Solicitud: {0}", IdNew.ToString()));
        }
        catch (Exception ex)
        {
            Lista.Add("Exception");
            Lista.Add(ex.Message);
            Lista.Add("Hubo un error no controlado en la aplicación, por favor inténtelo nuevamente, si el problema persiste contactarse con el administrador sistemas para revisar el log de eventos del servidor.");
        }
        return(scriptSerializer.Serialize(Lista.ToArray()));
    }