Example #1
0
        public ActionResult Recuperar(MdlRecuperaUsr Mdl)
        {
            if (!ModelState.IsValid)
            {
                return(View(Mdl));
            }
            string res = "";

            var eRCAU = ValidaCorreoExistente(Mdl.Email);

            if (eRCAU != null)
            {
                if (eRCAU.Count() == 1)
                {
                    var nRMAILX = new RMAILX()
                    {
                        LMOD      = "PEDIDOS",
                        LREF      = "Envio Correo",
                        LASUNTO   = "Recuperar ContraseƱa",
                        LENVIA    = "Pedidos SAP",
                        LPARA     = Mdl.Email,
                        LBCC      = "*****@*****.**",
                        LCATALOGO = "USE SRG",
                        LCRTDAT   = DateTime.Now,
                        LUPDDAT   = DateTime.Now,
                        LCUERPO   = "http://" + ConfigurationManager.AppSettings["local"] + "/PanelAsistentes/Account/CorreoPass?tk=" + eRCAU[0].UTOKEN
                    };
                    try
                    {
                        dbIN.RMAILX.Add(nRMAILX);
                        dbIN.SaveChanges();
                    }
                    catch (Exception ex)
                    {
                        //res = "ERROR: " + ex.Message;
                    }
                }
                else if (eRCAU.Count() > 1)
                {
                    res = "Existe mas de un usuario con el mismo correo</br>Comuniquese con tecnologia para solucionar el problema";
                }
                else
                {
                    res = "El correo no existe";
                }
            }


            return(Json(new { result = res }));
        }
Example #2
0
        public ActionResult Recuperar(MdlRecuperaUsr Mdl)
        {
            if (!ModelState.IsValid)
            {
                return(View(Mdl));
            }
            var res = new Respuesta();

            var eRCAU = ValidaCorreoExistente(Mdl.Email);

            if (eRCAU != null)
            {
                if (eRCAU.Count() == 1)
                {
                    var nRMAILX = new RMAILX()
                    {
                        LMOD    = "PEDIDOS",
                        LREF    = "Envio Correo",
                        LASUNTO = "Recuperar ContraseƱa",
                        LENVIA  = "Pedidos SAP",
                        LPARA   = Mdl.Email,
                        LBCC    = "*****@*****.**",
                        //LBCC = "*****@*****.**",
                        LCATALOGO = "USE SRG",
                        LCRTDAT   = DateTime.Now,
                        LUPDDAT   = DateTime.Now,
                        LCUERPO   = "http://" + ConfigurationManager.AppSettings["local"] + "/PanelAsistentes/Account/CorreoPass?tk=" + eRCAU[0].UTOKEN
                                    //LCUERPO = "http://201.234.71.92/CorreoPass?tk=" + eRCAU[0].UTOKEN
                    };
                    try
                    {
                        dbIN.RMAILX.Add(nRMAILX);
                        dbIN.SaveChanges();
                        //res = "OK";

                        //var data = "{ 'ACCION': 'CREAR', 'Data': " + Newtonsoft.Json.JsonConvert.SerializeObject(nRMAILX) + " }";
                        //var resu = fc.LlamadoApi(data, Baseurl + "RMAILX/CRUD");

                        //if (!resu.Contains("ERROR"))
                        //{
                        //    res = Newtonsoft.Json.JsonConvert.DeserializeObject<Respuesta>(resu);
                        //}
                    }
                    catch (Exception ex)
                    {
                        //res = "ERROR: " + ex.Message;
                    }
                }
                else if (eRCAU.Count() > 1)
                {
                    res.Resultado = "Existe mas de un usuario con el mismo correo</br>Comuniquese con tecnologia para solucionar el problema";
                }
                else
                {
                    res.Resultado = "El correo no existe";
                }
            }


            return(Json(new { result = res.Resultado }));
        }