Beispiel #1
0
        private void GenDataSet()
        {
            WebDataSet aWebDataSet = new WebDataSet();

            if (aWebDataSet != null)
            {
                aWebDataSet.SetWizardDesignMode(true);
                aWebDataSet.RemoteName = FClientData.ProviderName;
                aWebDataSet.PacketRecords = 100;
                aWebDataSet.Active = true;

                String s;
                s = FClientData.WebSiteName;

                string filePath = System.IO.Path.Combine(s, FClientData.FolderName);
                bool CreateFileSucess = true;
                string fileName = "";
                try
                {
                    fileName = System.IO.Path.Combine(filePath, FClientData.FormTitle + ".xsd");
                    aWebDataSet.RealDataSet.DataSetName = FClientData.FormTitle;
                    aWebDataSet.RealDataSet.WriteXmlSchema(fileName);
                }
                catch
                {
                    CreateFileSucess = false;
                    MessageBox.Show("Failed to create xsd file!");
                }
                finally
                {
                    if (CreateFileSucess && File.Exists(fileName))
                    {
                        FPIFolder.ProjectItems.AddFromFile(fileName);
                    }
                    if (aWebDataSet != null)
                    {
                        aWebDataSet.Dispose();
                    }
                }
            }
        }
Beispiel #2
0
        public static void WebCreateXSD(IDesignerHost FDesignerHost, ClientParam cParam, WebClientParam wecParam, Project proj)
        {
            WebDataSet aWebDataSet = new WebDataSet();

            ProjectItem webformDir = ReportCreator.FindProjectItem(proj, wecParam.FolderName);

            if (aWebDataSet != null)
            {
                aWebDataSet.SetWizardDesignMode(true);
                aWebDataSet.RemoteName = cParam.ProviderName;
                aWebDataSet.PacketRecords = 100;
                aWebDataSet.Active = true;

                String s;
                s = EEPRegistry.WebClient;

                string filePath = s + "\\" + wecParam.FolderName + "\\";
                bool CreateFileSucess = true;
                string fileName = "";
                try
                {
                    fileName = filePath + cParam.FormName + ".xsd";
                    aWebDataSet.RealDataSet.WriteXmlSchema(fileName);
                }
                catch
                {
                    CreateFileSucess = false;
                    MessageBox.Show("Failed to create xsd file!");
                }
                finally
                {
                    if (CreateFileSucess && File.Exists(fileName))
                    {
                        webformDir.ProjectItems.AddFromFile(fileName);
                    }
                    if (aWebDataSet != null)
                    {
                        aWebDataSet.Dispose();
                    }
                }
            }
        }