Ejemplo n.º 1
0
        // GET: Evaluation360/Edit/5
        public ActionResult Edit(int id)
        {
            IUnitOfWork Uok = new UnitOfWork(Factory);
            IService <evaluation360> jbService = new Service <evaluation360>(Uok);
            evaluation360            app       = jbService.GetById(id);

            return(View(app));
        }
Ejemplo n.º 2
0
        public ActionResult Create(evaluation360 e)
        {
            IUnitOfWork Uok = new UnitOfWork(Factory);
            IService <evaluation360> iser             = new Service <evaluation360>(Uok);
            IService <evaluation360> jbServiceEmploye = new Service <evaluation360>(Uok);

            iser.Add(e);
            iser.Commit();


            //envoyer mail

            var verifyurl = "/Signup/VerifiyAccount/";
            var link      = Request.Url.AbsolutePath.Replace(Request.Url.PathAndQuery, verifyurl);

            var fromEmail = new MailAddress("*****@*****.**", "Khemissi Maher");
            var toEmail   = new MailAddress("*****@*****.**");

            var FromEmailPassword = "******";

            string subject = "Ajout d'une evaluation";

            string body = "Nous vous informons qu'une evaluation 360 a été lancée sur vous ";

            var smtp = new SmtpClient
            {
                Host                  = "smtp.gmail.com",
                Port                  = 587,
                EnableSsl             = true,
                DeliveryMethod        = SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                Credentials           = new NetworkCredential(fromEmail.Address, FromEmailPassword),
                Timeout               = 20000
            };

            using (var message = new MailMessage(fromEmail, toEmail)
            {
                Subject = subject,
                Body = body,
                IsBodyHtml = true
            })
                smtp.Send(message);


            //envoyer mail



            return(RedirectToAction("Index"));
        }
Ejemplo n.º 3
0
        public ActionResult Delete(int id, FormCollection collection)
        {
            IUnitOfWork Uok = new UnitOfWork(Factory);

            IService <evaluation360> iser  = new Service <evaluation360>(Uok);
            evaluation360            conge = iser.GetById(id);

            iser.Delete(conge);
            iser.Commit();

            /*db.conge.Remove(conge);
             * db.SaveChanges();*/
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            IUnitOfWork Uok = new UnitOfWork(Factory);
            IService <evaluation360> jbService = new Service <evaluation360>(Uok);
            evaluation360            app       = jbService.GetById(id);

            app.nameEvaluation = Request.Form["nameEvaluation"];
            app.etat           = bool.Parse(Request.Form["etat"]);
            app.noteEvaluation = int.Parse(Request.Form["noteEvaluation"]);
            app.avisEvaluation = Request.Form["avisEvaluation"];
            jbService.Commit();

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 5
0
        // GET: Evaluation360/Delete/5
        public ActionResult Delete(int id)
        {
            IUnitOfWork Uok = new UnitOfWork(Factory);
            IService <evaluation360> jbService = new Service <evaluation360>(Uok);
            evaluation360            app       = jbService.GetById(id);

            if (app == null)
            {
                return(View("NotFound"));
            }
            else
            {
                return(View(app));
            }
        }
Ejemplo n.º 6
0
        // GET: Eval/Delete/5
        public ActionResult Delete(int id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            IUnitOfWork Uok = new UnitOfWork(Factory);
            IService <evaluation360> jbService = new Service <evaluation360>(Uok);
            evaluation360            conge     = jbService.GetById(id);

            if (conge == null)
            {
                return(HttpNotFound());
            }
            return(View(conge));
        }
Ejemplo n.º 7
0
        public ActionResult Create(evaluation360 e)
        {
            IUnitOfWork Uok = new UnitOfWork(Factory);
            IService <evaluation360> jbService = new Service <evaluation360>(Uok);
            IService <employe>       x         = new Service <employe>(Uok);

            employe emp = x.GetById((long)e.evaluationEmploye360_id);

            // TODO: Add insert logic here
            jbService.Add(e);
            jbService.Commit();

            var verifyurl = "/Signup/VerifiyAccount/";
            var link      = Request.Url.AbsolutePath.Replace(Request.Url.PathAndQuery, verifyurl);

            var fromEmail = new MailAddress("*****@*****.**", "nesria guinouvi");
            var toEmail   = new MailAddress(emp.email);

            // var toEmail = new MailAddress("*****@*****.**");
            var FromEmailPassword = "******";

            string subject = "Information sur le lancement d'une évaluation";

            string body = "votre manager a lancer une évaluation le " + e.datedebut + "pour vous évaluer .Monsieur/madame ." + emp.nom + " " + emp.prenom;

            var smtp = new SmtpClient
            {
                Host                  = "smtp.gmail.com",
                Port                  = 587,
                EnableSsl             = true,
                DeliveryMethod        = SmtpDeliveryMethod.Network,
                UseDefaultCredentials = false,
                Credentials           = new NetworkCredential(fromEmail.Address, FromEmailPassword),
                Timeout               = 20000
            };

            using (var message = new MailMessage(fromEmail, toEmail)
            {
                Subject = subject,
                Body = body,
                IsBodyHtml = true
            }) smtp.Send(message);

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 8
0
        public ActionResult Edit(int id, FormCollection collection)
        {
            try
            {
                IUnitOfWork Uok = new UnitOfWork(Factory);
                IService <evaluation360> jbService = new Service <evaluation360>(Uok);
                evaluation360            app       = jbService.GetById(id);
                // TODO: Add update logic here
                app.datedebut = DateTime.Parse(Request.Form["datedebut"]);

                jbService.Commit();
                return(RedirectToAction("Index", new { id = app.id }));
            }
            catch
            {
                return(View());
            }
        }