public void IgnorSuggestion(int SuggId) { ISuggestionService suggestionService = new SuggestionService(); suggestion suggestions = suggestionService.GetSuggestionById(SuggId); suggestionService.AccesptIgnoreSuggestion(SuggId, false); //return View(suggestions); }
public ActionResult AcceptSuggestion(int SuggId) { try { ISuggestionService suggestionService = new SuggestionService(); suggestion suggestions = suggestionService.GetSuggestionById(SuggId); suggestionService.AccesptIgnoreSuggestion(SuggId, true); return RedirectToAction("DownloadPDF", "Suggestion", new { SuggId = SuggId }); } catch (Exception) { throw; } }
public ActionResult DownloadPDF(int SuggId) { try { ISuggestionService suggestionService = new SuggestionService(); suggestion suggestions = suggestionService.GetSuggestionById(SuggId); var model = new GeneratePDFModel(); //get the information to display in pdf from database //for the time //Hard coding values are here, these are the content to display in pdf var logoFile = @"/Images/logo.png"; model.PDFLogo = Server.MapPath(logoFile); QRCodeEncoder en = new QRCodeEncoder(); Image a = en.Encode("WLEED FLY 2015" + suggestions.offre.id + " " + suggestions.offre1.id); a.Save(Server.MapPath(@"~/Content/qr.bmp"), ImageFormat.Bmp); var content = "<div><table style='float: left' cellspacing='3'><tr><td><h1>trader 1 Username :"******"session"] + "<h1></td><td> </td><tr><td><h1>Offer Name:" + Session["cuser"].ToString() + "<h1></td><td> </td></tr></table></div>" + "<div><table style='float: left' cellspacing='3'><tr><td><h1>trader 2 Username :<h1></td><td> </td><tr><td><h1>Offer Name:" + suggestions.offre1.name + "<h1></td><td> </td></tr></table></div>" + "<img src=" + char.ConvertFromUtf32(34) + Server.MapPath(@"~/Content/qr.bmp") + char.ConvertFromUtf32(34) + ";>"; // @"~/Content/qr.bmp" //Use ViewAsPdf Class to generate pdf using GeneratePDF.cshtml view model.PDFContent = content; return new Rotativa.ViewAsPdf("GeneratePDF", model) { FileName = "firstPdf.pdf" }; } catch (Exception) { throw; } }