public ActionResult Edit(int id, MVCConsumeWebAPI.Models.reclamation recla)
        {
            reclamation p     = reclamationservice.GetById(id);
            DateTime    date2 = DateTime.Now;
            DateTime    date1 = (DateTime)p.date_creation;

            date1 = date1.AddDays(+1);
            DateTime res;

            res = date1;
            if (p.date_traitement == null && date2 < res)
            {
                p.objet       = recla.objet;
                p.description = recla.description;
                p.image       = recla.image;
                reclamationservice.Update(p);
                reclamationservice.Commit();
                return(RedirectToAction("Index"));
            }

            else
            {
                RedirectToAction("Index");
            }
            return(RedirectToAction("Index"));
        }
Пример #2
0
        //status accceptée
        public ActionResult accepter(int id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Reclamation r = rs.GetById(id);


            r.status = "acceptée";


            if (r == null)
            {
                return(HttpNotFound());
            }

            rs.Update(r);
            rs.Commit();
            // Service.Dispose();

            return(RedirectToAction("Index"));
            // TODO: Add delete logic her
        }
Пример #3
0
        public ActionResult archiveReclamation(int id)
        {
            reclamation r1 = reclamationService.GetById(id);

            r1.archivable = true;
            reclamationService.Update(r1);
            reclamationService.Commit();


            return(RedirectToAction("boxReclamation"));
        }
Пример #4
0
        public ActionResult Mail()
        {
            MailMessage mail = new MailMessage();

            mail.From    = new MailAddress("[email protected] ");
            mail.Subject = "Reply to your reclamation";
            mail.Body    = Request["message"];

            mail.To.Add(Request["email"]);
            mail.IsBodyHtml = true;
            SmtpClient smtp = new SmtpClient("smtp.gmail.com");

            smtp.Credentials = new System.Net.NetworkCredential("[email protected] ", "esprit2013");
            smtp.EnableSsl   = true;
            smtp.Send(mail);
            int         recId = int.Parse(Request["rec"]);
            Reclamation c     = reclamationService.GetById(recId);

            c.état = "lu";
            reclamationService.Update(c);
            reclamationService.Commit();
            ViewBag.success = "email sent";
            return(RedirectToAction("Index"));
        }