示例#1
0
        // version 0
        public string GenerateDashboard_V0()
        {
            if (Poll.Equals(null))
            {
                throw new Exception("Poll = null ");
            }
            var utils = new DashboardUtils();

            var aspxFileName          = Dashbord_name + ".aspx";
            var aspxcsFileName        = Dashbord_name + ".aspx.cs";
            var aspxdesinercsFileName = Dashbord_name + ".aspx.designer.cs";

            String aspxCode = GetHeader(aspxcsFileName) +
                              $@"<body class='jumbotron'>
                                <div id = 'dashboard-container' class='dashboard-container'>
                                    {GetNavHeader(Poll.Name)} 
                                    {GetDashbordContener_V0(Poll.Id)} 
                                </div>
                                 {AddJScript_V0(Poll.Id)}
                              </body></html>";

            String aspxdesignercsCode = GetDesignerCSCode(aspxcsFileName);
            String aspxcsCode         = GetCSCode(aspxcsFileName);

            //write file
            System.IO.File.WriteAllText(Directory + aspxcsFileName, aspxcsCode, Encoding.UTF8);
            System.IO.File.WriteAllText(Directory + aspxdesinercsFileName, aspxdesignercsCode, Encoding.UTF8);
            System.IO.File.WriteAllText(Directory + aspxFileName, aspxCode.ToString(), Encoding.UTF8);
            //GenerateProcedureStocke();
            return(aspxFileName);;
        }