/// <summary> /// Gets the PdfSampleModel form model for view Display /// </summary> /// <param name="id">The identifier as if for DB ID.</param> public Kan7Model GetPdfSampleModel(int? id) { Kan7Model k7 = new Kan7Model() { Description = "This is Desc for KAN_7", Title = "KAN_7 mega pdf form", // TypeOfApplication = "Type of apppp", StateList = this.StateList, Applicationid = 87 }; SpouseModel spmodel = new SpouseModel() { Header = "This is Default Spouse model header", BirthPlace = "Liibija", DateOfBirth = new DateTime(1655, 11, 11), FirstNames = "Pirmais vards", LastName = "Uzvardsss", IdNumber = "ID-2345675432", SpouseStateOfBirth = "US and A" }; spmodel.FormerCitiz.Add(new GroupSpouseFormerCitiz() { Citiz = "Citizer1", CitizHowGotten = "Nezinu How", CitizWhenGotten = new DateTime(2012, 12, 12) }); spmodel.FormerCitiz.Add(new GroupSpouseFormerCitiz() { Citiz = "Citizer123424", CitizHowGotten = "Nezinu Howeeeeeeeeee", CitizWhenGotten = new DateTime(2011, 3, 11) }); spmodel.FormerCitiz.Add(new GroupSpouseFormerCitiz() { Citiz = "Citizer1234234", CitizHowGotten = "Nezinu Howiiiiiiiii", CitizWhenGotten = new DateTime(2010, 2, 22) }); spmodel.FormerNames.Add(new GroupSpouseFormerNames() { FirstNames = "F_name", LastName = "L_Name", IsHot = true }); spmodel.FormerNames.Add(new GroupSpouseFormerNames() { FirstNames = "F_namesssss", LastName = "L_Namennnnn" }); spmodel.FormerNames.Add(new GroupSpouseFormerNames() { FirstNames = "F_nameuuuuuuu", LastName = "L_NameBBBBBBBB", IsHot = true }); k7.SpouseModel = spmodel; return k7; }
public virtual ActionResult PdfCreationTests(Kan7Model model) { if (model == null) { return this.RedirectToAction(MVC.Sandbox.PdfCreationTests(this.businessLogic.SavePdfSampleModel(new Kan7Model()))); } // PdfView pview = new PdfView(); // pview.SetValue(model, "PdfReports/Kan7PdfReport", this.ControllerContext); // var res = pview.GetHtmlViewAsync(); // Generate from HTML raxor fiew // PdfGenerator pdf = new PdfGenerator(res.Result); // pdf.PdfFileLocationPath = @"C:\pdf"; // pdf.GeneratePdf(); // // Generate pdf from Model // PdfGenerator pdf2 = new PdfGenerator(model.ToHtmlString()); // pdf2.PdfFileLocationPath = @"C:\pdf"; // pdf2.GeneratePdf(); this.WebMessages.AddInfoMessage("Back From PDf", "__________________"); return this.RedirectToAction(MVC.Sandbox.PdfCreationTests(this.businessLogic.SavePdfSampleModel(model))); }
/// <summary> /// Saves the KAN7Model layout model to DB or sends to Service /// Note: This is fake for DEMO purposes /// </summary> /// <param name="toggleSwichModel">The model from View.</param> /// <returns>Saved object ID (also fake)</returns> public int SavePdfSampleModel(Kan7Model toggleSwichModel) { return 69; }