Esempio n. 1
0
 public ActionResult EditApproveReclaims(Reclamaciones model)
 {
     getCookies();
     if (ModelState.IsValid)
     {
         try
         {
             model.CourierId    = userIdLogged;
             model.EmailCourier = userEmail;
             ReclamacionesManager pk = new ReclamacionesManager();
             model.StatusId = 2;
             pk.Update(model);
             ViewBag.SavedOk = "1";
             string body = "", subject = model.Subject;
             body = System.IO.File.ReadAllText(RootUrl + "/" + ConfigurationManager.AppSettings["FileReclaimsToAdmin"].ToString());
             body = string.Format(body, model.EmailCust, model.Subject, model.AnswerInfo);
             SendEmail(subject, model.EmailCust, body, true);
             body = System.IO.File.ReadAllText(RootUrl + "/" + ConfigurationManager.AppSettings["FileReclaimsToAdmin"].ToString());
             body = string.Format(body, model.EmailCourier, model.Subject, model.AnswerInfo);
             SendEmail(subject, model.EmailCourier, body, true);
             body = System.IO.File.ReadAllText(RootUrl + "/" + ConfigurationManager.AppSettings["FileReclaimsToAdmin"].ToString());
             body = string.Format(body, ConfigurationManager.AppSettings["AdminEmail"].ToString(), model.Subject, model.AnswerInfo);
             SendEmail(subject, ConfigurationManager.AppSettings["AdminEmail"].ToString(), body, true);
             return(RedirectToAction("Manage"));
         }
         catch
         {
             ViewBag.ErrorMessage = "Ha Ocurrido un Error: Intente en unos momentos.";
         }
     }
     return(RedirectToAction("Manage"));
 }
Esempio n. 2
0
        public ActionResult Concludas()
        {
            ViewBag.PackageTitles = "Reclamaciones Concluidas";
            getCookies();
            ReclamacionesManager pk = new ReclamacionesManager();
            var result = pk.GetReclamaciones(userIdLogged, 0);

            ViewBag.NotPackage = "1";
            return(View("Manage", result));
        }
Esempio n. 3
0
        public ActionResult Manage()
        {
            ViewBag.PackageTitles = "Reclamaciones";
            getCookies();
            ReclamacionesManager pk = new ReclamacionesManager();
            var result = pk.GetReclamaciones(userIdLogged, 1);

            if (result == null || result.Count == 0)
            {
                ViewBag.NotPackage = "1";
                return(View(result));
            }
            else
            {
                return(View(result));
            }
        }
Esempio n. 4
0
 public ActionResult AddReclaims(Reclamaciones model)
 {
     getCookies();
     if (ModelState.IsValid)
     {
         try
         {
             UsersManager um   = new UsersManager();
             var          user = um.GetUsersByCedula(model.ID);
             if (user != null && user.usersId != 0)
             {
                 model.UsersId      = user.usersId;
                 model.EmailCust    = user.email;
                 model.CourierId    = userIdLogged;
                 model.EmailCourier = userEmail;
                 ReclamacionesManager pk = new ReclamacionesManager();
                 pk.Insert(model);
                 ViewBag.SavedOk = "1";
                 string body = "", subject = model.Subject;
                 body = System.IO.File.ReadAllText(RootUrl + "/" + ConfigurationManager.AppSettings["FileReclaimsToUser"].ToString());
                 body = string.Format(body, model.EmailCust, model.Subject, model.Description);
                 SendEmail(subject, model.EmailCust, body, true);
                 body = System.IO.File.ReadAllText(RootUrl + "/" + ConfigurationManager.AppSettings["FileReclaimsToUser"].ToString());
                 body = string.Format(body, model.EmailCourier, model.Subject, model.Description);
                 SendEmail(subject, model.EmailCourier, body, true);
                 body = System.IO.File.ReadAllText(RootUrl + "/" + ConfigurationManager.AppSettings["FileReclaimsToUser"].ToString());
                 body = string.Format(body, ConfigurationManager.AppSettings["AdminEmail"].ToString(), model.Subject, model.Description);
                 SendEmail(subject, ConfigurationManager.AppSettings["AdminEmail"].ToString(), body, true);
                 return(RedirectToAction("Manage"));
             }
             else
             {
                 ViewBag.ErrorMessage = "Los datos no se han completado correctamente";
             }
         }
         catch
         {
             ViewBag.ErrorMessage = "Ha Ocurrido un Error: Intente en unos momentos.";
         }
     }
     return(View(model));
 }
Esempio n. 5
0
 public ActionResult EditPreavisos(Reclamaciones model)
 {
     getCookies();
     if (ModelState.IsValid)
     {
         try
         {
             model.CourierId    = userIdLogged;
             model.EmailCourier = userEmail;
             ReclamacionesManager pk = new ReclamacionesManager();
             pk.Update(model);
             ViewBag.SavedOk = "1";
             return(RedirectToAction("Manage"));
         }
         catch
         {
             ViewBag.ErrorMessage = "Ha Ocurrido un Error: Intente en unos momentos.";
         }
     }
     return(RedirectToAction("Manage"));
 }
Esempio n. 6
0
 public ActionResult Deleteclaims(int recl_id)
 {
     try
     {
         getCookies();
         ReclamacionesManager pk = new ReclamacionesManager();
         var model = pk.GetReclamacionById(userIdLogged, recl_id);
         if (model != null)
         {
             return(View(model));
         }
         else
         {
             ViewBag.ErrorMessage = "Ha Ocurrido un Error: No Se Encuentran Resultados.";
         }
         return(RedirectToAction("Manage"));
     }
     catch
     {
         ViewBag.ErrorMessage = "Ha Ocurrido un Error: Intente en unos momentos.";
     }
     return(RedirectToAction("Manage"));
 }