Ejemplo n.º 1
0
 private WebClientParam GetWebClientParams()
 {
     WebClientParam wecParam = new WebClientParam();
     wecParam.WebSiteName = (string)cbWebSite.SelectedItem;
     wecParam.AddNewFolder = rbAddToNewFolder.Checked;
     if (!wecParam.AddNewFolder)
     {
         wecParam.FolderName = (string)cbAddToExistFolder.SelectedItem;
     }
     else
     {
         wecParam.FolderName = tbAddToNewFolder.Text;
     }
     return wecParam;
 }
Ejemplo n.º 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();
                    }
                }
            }
        }