// 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)); }
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")); }
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")); }
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")); }
// 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)); } }
// 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)); }
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")); }
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()); } }