protected void Page_Load(object sender, EventArgs e) { var id = Request.QueryString[0]; System.Diagnostics.Debug.WriteLine("urlId = " + id); if (Int32.TryParse(id, out proposalId)) { using (var database = DbaseTools.CreateDbase()) { var proposal = DbProposals.Load(proposalId); //var items = DbItems.LoadAll(proposalId); if (proposal != null) { if (database.Opened) { database.Close(); } CreateExcel(proposal); } } } }
public static string LoadProposal(Int32 id) { var proposal = DbProposals.Load(id); var json = new JavaScriptSerializer(); return(json.Serialize(proposal)); }