Esempio n. 1
0
        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);
                    }
                }
            }
        }
Esempio n. 2
0
        public static string LoadProposal(Int32 id)
        {
            var proposal = DbProposals.Load(id);
            var json     = new JavaScriptSerializer();

            return(json.Serialize(proposal));
        }