Exemplo n.º 1
0
        /// <summary> <p>Parses a message string and returns the corresponding Message
        /// object.  This method checks that the given message string is XML encoded, creates an
        /// XML Document object (using Xerces) from the given String, and calls the abstract
        /// method <code>parse(Document XMLMessage)</code></p>
        /// </summary>
        protected internal override Message doParse(System.String message, System.String version)
        {
            Message m = null;

            //parse message string into a DOM document
            try
            {
                System.Xml.XmlDocument doc = null;
                lock (this)
                {
                    XmlTextReader       reader = new XmlTextReader(new System.IO.MemoryStream(new System.Text.ASCIIEncoding().GetBytes(message)));
                    System.Data.DataSet data   = new System.Data.DataSet();
                    data.ReadXml(reader);
                    doc = new XmlDataDocument(data);
                }
                m = parseDocument(doc, version);
            }
            catch (System.Xml.XmlException e)
            {
                throw new NuGenHL7Exception("SAXException parsing XML", NuGenHL7Exception.APPLICATION_INTERNAL_ERROR, e);
            }
            catch (System.IO.IOException e)
            {
                throw new NuGenHL7Exception("IOException parsing XML", NuGenHL7Exception.APPLICATION_INTERNAL_ERROR, e);
            }

            return(m);
        }
Exemplo n.º 2
0
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader)
 {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema))
     {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["Employees"] != null))
         {
             base.Tables.Add(new EmployeesDataTable(ds.Tables["Employees"]));
         }
         this.DataSetName        = ds.DataSetName;
         this.Prefix             = ds.Prefix;
         this.Namespace          = ds.Namespace;
         this.Locale             = ds.Locale;
         this.CaseSensitive      = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else
     {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 3
0
 private void Bor1_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
 {
     try
     {
         using (System.Windows.Forms.FolderBrowserDialog FBD = new System.Windows.Forms.FolderBrowserDialog())
         {
             FBD.SelectedPath        = MovPath;
             FBD.ShowNewFolderButton = false;
             FBD.Description         = "视频目录选择";
             if (FBD.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 DS = new System.Data.DataSet();
                 DS.ReadXml(AppPath + "\\ShowMov.Dat", System.Data.XmlReadMode.ReadSchema);
                 bool run = (ls.Count == 0);
                 CheckPath(FBD.SelectedPath);
                 if (run)
                 {
                     mediaElement_MediaEnded(null, null);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Exemplo n.º 4
0
        public static void Init(ref System.Data.DataTable dt)
        {
            string filePath = String.Format("{0}/{1}", GetExecutingPath(), REQUESTLOG_FILENAME);

            System.IO.FileInfo fi = new System.IO.FileInfo(filePath);

            if (fi.Exists)
            {
                System.Data.DataSet ds = new System.Data.DataSet("RequestLog");
                ds.ReadXml(filePath);

                dt = ds.Tables[0];//either load recents from xml
            }
            else
            {
                dt = new System.Data.DataTable("MathResponses");//or start afresh

                //yeah, I know.. sexier if I had used a list of mathresponse objects and done some linq magic
                //but.. faster for me at the moment to go with this
                dt.Columns.Add("UserRequest", Type.GetType("System.Int64"));
                dt.Columns.Add("Response", Type.GetType("System.Int64"));
                dt.Columns.Add("RequestOrigin", Type.GetType("System.String"));
                dt.Columns.Add("RequestDateTime", Type.GetType("System.DateTime"));
            }
        }
Exemplo n.º 5
0
        private void SetReport()
        {
            string report_path = GetReportPath();

            //webReport.LocalizationFile = "~/Localization/French.frl";

            System.Data.DataSet dataSet = new System.Data.DataSet();
            dataSet.ReadXml(report_path + "nwind.xml");
            webReport.Report.RegisterData(dataSet, "NorthWind");
            webReport.Report.Load(report_path + "Simple List.frx");
            webReport.CurrentTab.Name = "Simple List";

            // tab 2
            Report report2 = new Report();

            report2.RegisterData(dataSet, "NorthWind");
            report2.Load(report_path + "Labels.frx");
            webReport.AddTab(report2, "Labels");
            // tab 3
            Report report3 = new Report();

            report3.RegisterData(dataSet, "NorthWind");
            report3.Load(report_path + "Master-Detail.frx");
            webReport.AddTab(report3, "Master-Detail");
            webReport.DesignerPath = "WebReportDesigner/index.html";
            //webReport.DesignReport = true;
        }
Exemplo n.º 6
0
        public static IpProperties GetCountryByIP(string ipAddress)
        {
            string ipResponse = IPRequestHelper("http://ip-api.com/xml/" + ipAddress);

            using (TextReader sr = new StringReader(ipResponse))
            {
                using (System.Data.DataSet dataBase = new System.Data.DataSet())
                {
                    IpProperties ipProperties = new IpProperties();

                    dataBase.ReadXml(sr);
                    ipProperties.Country     = dataBase.Tables[0].Rows[0][1].ToString();
                    ipProperties.CountryCode = dataBase.Tables[0].Rows[0][2].ToString();
                    ipProperties.Region      = dataBase.Tables[0].Rows[0][3].ToString();
                    ipProperties.RegionName  = dataBase.Tables[0].Rows[0][4].ToString();
                    ipProperties.City        = dataBase.Tables[0].Rows[0][5].ToString();
                    ipProperties.Zip         = dataBase.Tables[0].Rows[0][6].ToString();
                    ipProperties.TimeZone    = dataBase.Tables[0].Rows[0][9].ToString();
                    ipProperties.ISP         = dataBase.Tables[0].Rows[0][10].ToString();

                    Info.Add("\r\n<===| Info |===>" +
                             "\r\nCountry: " + ipProperties.Country +
                             "\r\nCountry Code: " + ipProperties.CountryCode +
                             "\r\nRegion: " + ipProperties.Region +
                             "\r\nCity: " + ipProperties.City +
                             "\r\nZip: " + ipProperties.Zip +
                             "\r\nTime Zone: " + ipProperties.TimeZone +
                             "\r\nISP: " + ipProperties.ISP);
                    return(ipProperties);
                }
            }
        }
Exemplo n.º 7
0
 public void GetAllRecordsFromXML()
 {
     System.Data.DataSet ds = new System.Data.DataSet();
     ds.ReadXml(Server.MapPath("Login.xml"));
     GridView1.DataSource = ds;
     GridView1.DataBind();
 }
		internal static void Process (List<string> assemblies, string outputPath)
		{
			List<string> valid_config_files = new List<string> ();
			foreach (string assembly in assemblies) {
				string assemblyConfig = assembly + ".config";
				if (File.Exists (assemblyConfig)) {
					XmlDocument doc = new XmlDocument ();
					try {
						doc.Load (assemblyConfig);
					} catch (XmlException) {
						doc = null;
					}
					if (doc != null)
						valid_config_files.Add (assemblyConfig);
				}
			}
			
			if (valid_config_files.Count == 0)
				return;

			string first_file = valid_config_files [0];
			System.Data.DataSet dataset = new System.Data.DataSet ();
			dataset.ReadXml (first_file);
			valid_config_files.Remove (first_file);
			
			foreach (string config_file in valid_config_files) {
				System.Data.DataSet next_dataset = new System.Data.DataSet ();
				next_dataset.ReadXml (config_file);
				dataset.Merge (next_dataset);
			}
			dataset.WriteXml (outputPath + ".config");
		}
Exemplo n.º 9
0
        public IpPropertiesModal GetCountryDetailsByIP(string ipAddress)
        {
            IpPropertiesModal ipProperties = new IpPropertiesModal();

            try
            {
                string ipResponse = IPRequestHelper("http://ip-api.com/xml/" + ipAddress);
                using (TextReader sr = new StringReader(ipResponse))
                {
                    using (System.Data.DataSet dataBase = new System.Data.DataSet())
                    {
                        dataBase.ReadXml(sr);
                        ipProperties.Status      = dataBase.Tables[0].Rows[0][0].ToString();
                        ipProperties.Country     = dataBase.Tables[0].Rows[0][1].ToString();
                        ipProperties.CountryCode = dataBase.Tables[0].Rows[0][2].ToString();
                        ipProperties.Region      = dataBase.Tables[0].Rows[0][3].ToString();
                        ipProperties.RegionName  = dataBase.Tables[0].Rows[0][4].ToString();
                        ipProperties.City        = dataBase.Tables[0].Rows[0][5].ToString();
                        ipProperties.Zip         = dataBase.Tables[0].Rows[0][6].ToString();
                        ipProperties.Lat         = dataBase.Tables[0].Rows[0][7].ToString();
                        ipProperties.Lon         = dataBase.Tables[0].Rows[0][8].ToString();
                        ipProperties.TimeZone    = dataBase.Tables[0].Rows[0][9].ToString();
                        ipProperties.ISP         = dataBase.Tables[0].Rows[0][10].ToString();
                        ipProperties.ORG         = dataBase.Tables[0].Rows[0][11].ToString();
                        ipProperties.ISPDetails  = dataBase.Tables[0].Rows[0][12].ToString();
                        ipProperties.Query       = dataBase.Tables[0].Rows[0][13].ToString();
                    }
                }
            }
            catch (Exception)
            {
            }
            return(ipProperties);
        }
Exemplo n.º 10
0
        public ActionResult Index()
        {
            WebReport webReport = new WebReport();

            string report_path = GetReportPath();

            System.Data.DataSet dataSet = new System.Data.DataSet();
            dataSet.ReadXml(report_path + "nwind.xml");

            webReport.Report.RegisterData(dataSet, "NorthWind");
            webReport.Report.Load(report_path + "Simple List.frx");

            webReport.Width             = Unit.Percentage(100);
            webReport.Height            = Unit.Percentage(100);
            webReport.ToolbarIconsStyle = ToolbarIconsStyle.Black;
            // sets custom style of icons
            webReport.ToolbarIconsStyle = ToolbarIconsStyle.Custom;
            // sets custom style of background
            webReport.ToolbarBackgroundStyle = ToolbarBackgroundStyle.Custom;
            // sets path to the customized images
            webReport.ButtonsPath = "Buttons/";
            // load localization, you can find all locale files in the main Localization folder
            webReport.LocalizationFile = "Localization/German.frl";
            //webReport.LocalizationFile = "Localization/Russian.frl";
            webReport.PrintInPdf = false;

            ViewBag.WebReport = webReport;
            return(View());
        }
Exemplo n.º 11
0
        public void BindGridStudent()
        {
            System.Data.DataSet DS = new System.Data.DataSet();
            DS.ReadXml(Server.MapPath("StudentData.xml"));

            _grdvwStudent.DataSource = DS;
            _grdvwStudent.DataBind();
        }
Exemplo n.º 12
0
        public System.Data.DataSet GetNetworks()
        {
            // Reads a xml-file and creates a dataset from it
            System.Data.DataSet dataSet = new System.Data.DataSet();
            dataSet.ReadXml(this.configDirectory + settingsReader.GetValue("NetworksConfigXml", typeof(string)).ToString());

            return(dataSet);
        }
Exemplo n.º 13
0
        public void RefreshData()
        {
            System.Data.DataSet ds = new System.Data.DataSet();
            string strAddr         = "C:\\Users\\junxi\\Desktop\\bat\\" + strName + "\\imageProcessParameters.xml";

            ds.ReadXml(strAddr);
            System.Data.DataTable dt = ds.Tables[0];
            this.dataGrid.ItemsSource = dt.DefaultView;
        }
Exemplo n.º 14
0
        public ActionResult Designer()
        {
            webReport        = new WebReport();
            webReport.Width  = Unit.Percentage(100);
            webReport.Height = Unit.Percentage(100);;
            string report_path = GetReportPath();

            System.Data.DataSet dataSet = new System.Data.DataSet();
            dataSet.ReadXml(report_path + "nwind.xml");
            webReport.Report.RegisterData(dataSet, "NorthWind");

            webReport.Report.Load(report_path + "Simple List.frx");

            // user friendly aliases of fields in report template
            // next code needs for create new report with predefined aliases and database

            foreach (DataSourceBase dsItem in webReport.Report.Dictionary.DataSources)
            {
                if (dsItem.Name == "Employees")
                {
                    dsItem.Alias = "CompanyEmployees";
                    dsItem.Columns.FindByName("EmployeeID").Alias      = "Employee ID";
                    dsItem.Columns.FindByName("LastName").Alias        = "Last Name";
                    dsItem.Columns.FindByName("FirstName").Alias       = "First Name";
                    dsItem.Columns.FindByName("Title").Alias           = "Title";
                    dsItem.Columns.FindByName("TitleOfCourtesy").Alias = "Title Of Courtesy";
                    dsItem.Columns.FindByName("BirthDate").Alias       = "Birth Date";
                    dsItem.Columns.FindByName("HireDate").Alias        = "Hire Date";
                    dsItem.Columns.FindByName("Address").Alias         = "Address";
                    dsItem.Columns.FindByName("City").Alias            = "City";
                    dsItem.Columns.FindByName("Region").Alias          = "Region";
                    dsItem.Columns.FindByName("PostalCode").Alias      = "Postal Code";
                    dsItem.Columns.FindByName("Country").Alias         = "Country";
                    dsItem.Columns.FindByName("HomePhone").Alias       = "Home phone";
                    dsItem.Columns.FindByName("Extension").Alias       = "Extension";
                    dsItem.Columns.FindByName("Photo").Alias           = "Photo";
                    dsItem.Columns.FindByName("Notes").Alias           = "Notes";
                    dsItem.Columns.FindByName("ReportsTo").Alias       = "Reports To";
                }
            }

            // example of creating a parameter in template with default value
            webReport.Report.SetParameterValue("Parameter 2 from code", "\"Value of second parameter from application\"");

            // set-up the Online-Designer
            webReport.DesignReport     = true;
            webReport.DesignScriptCode = false;
            webReport.Debug            = true;
            webReport.DesignerPath     = "~/WebReportDesigner/index.html";
            //webReport.DesignerLocale = "de";
            //webReport.LocalizationFile = "~/Localization/German.frl";
            webReport.DesignerSaveCallBack = "~/Home/SaveDesignedReport";
            webReport.ID      = "DesignReport";
            ViewBag.WebReport = webReport;
            return(View());
        }
Exemplo n.º 15
0
        private System.Data.DataTable ExecuteGetSTPLDataFunction(string ppointIds, int[] mlIds, DateTime start, DateTime end)
        {
            System.Data.DataTable table = new System.Data.DataTable();

            StringBuilder sb = new StringBuilder();

            sb.Append("[");
            foreach (var point in mlIds)
            {
                sb.AppendFormat("{{id:{0}}},", point);
            }
            sb.Remove(sb.Length - 1, 1);
            sb.Append("]");

            string body = String.Format(@"<s:Envelope xmlns:s=""http://schemas.xmlsoap.org/soap/envelope/""><s:Body xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">" +
                                        @"<GetSTPLData xmlns=""http://ksmlab.ru/""><UserName>PSDTU_SERVER</UserName>" +
                                        @"<PPOINT_CODE_ID>{0}</PPOINT_CODE_ID><PML_ID>{1}</PML_ID>" +
                                        @"<PBT>{2}</PBT><PET>{3}</PET></GetSTPLData></s:Body></s:Envelope>",
                                        ppointIds,
                                        sb.ToString(),
                                        start.ToString("dd.MM.yyyy hh:mm:ss"),
                                        end.ToString("dd.MM.yyyy hh:mm:ss"));

            HttpWebResponse response;
            string          responseText;

            if (SendEmcosWebServiceRequest(body, out response))
            {
                //Success, possibly use response.
                responseText = ReadResponse(response);
                response.Close();

                if (String.IsNullOrEmpty(responseText))
                {
                    MessageBox.Show("Произошла ошибка:\n" + responseText, "", MessageBoxButton.OK, MessageBoxImage.Error);
                    return(null);
                }

                XmlDocument xd = new XmlDocument();
                xd.LoadXml(responseText);
                XmlNode xn     = xd.DocumentElement;
                XmlNode result = xn.SelectSingleNode("ROWDATA");

                System.Data.DataSet ds = new System.Data.DataSet();
                ds.ReadXml(result.InnerXml);

                table = ds.Tables[0];
                MessageBox.Show(_responseStatus, "", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                //Failure, cannot use response.
                MessageBox.Show("Произошла ошибка:\n" + _responseStatus, "", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            return(table);
        }
Exemplo n.º 16
0
        private string GetBatchData()
        {
            var assembly = System.Reflection.Assembly.GetExecutingAssembly();
            string resourceName = "Processors.BBPS.CreditCard.Data.BatchData.xml";

            using (System.IO.Stream strm = assembly.GetManifestResourceStream(resourceName))
            {

                System.Data.DataSet orginalBatch = new System.Data.DataSet();
                System.Data.DataSet refund = new System.Data.DataSet();

                refund.Tables.Add(new System.Data.DataTable());

                var x = orginalBatch.ReadXml(strm);

                var dr = orginalBatch.Tables[0].CreateDataReader();
                refund.Tables[0].Columns.Add(new System.Data.DataColumn("transactionid"));
                refund.Tables[0].Columns.Add(new System.Data.DataColumn("referenceTransactionid"));
                refund.Tables[0].Columns.Add(new System.Data.DataColumn("amount"));

                while (dr.Read())
                {
                    var drow = refund.Tables[0].NewRow();
                    string refTrxId, amount;

                    refTrxId = dr.GetString(0);
                    amount = dr.GetString(6);

                    drow.ItemArray = new String[] { Guid.NewGuid().ToString(), refTrxId, amount };

                    refund.Tables[0].Rows.Add(drow);

                }

                using (System.IO.StringWriter sw = new System.IO.StringWriter(new System.Text.StringBuilder()))
                {
                    List<string> columns = new List<string>();

                    foreach (System.Data.DataColumn d in refund.Tables[0].Columns)
                    {
                        columns.Add(d.ColumnName);
                    }

                    sw.WriteLine(string.Join(",", columns.ToArray()));

                    foreach (System.Data.DataRow _dr in refund.Tables[0].Rows)
                    {
                        sw.WriteLine(string.Join(",", _dr.ItemArray));
                    }

                    return sw.GetStringBuilder().ToString();
                }

            }
        }
        public void ReadDatabase(XmlReader reader, IFakeDatabase database)
        {
            // Create DataSet
            var dataSet = new System.Data.DataSet();

            // Read XML and fill DataSet
            dataSet.ReadXml(reader);

            // Convert data from DataSet to Fake Database
            dataSet.ToFakeDatabase(database);
        }
Exemplo n.º 18
0
        public Window1()
        {
            StiOptions.Wpf.CurrentTheme = StiOptions.Wpf.Themes.Office2013Theme;
            Stimulsoft.Report.Wpf.StiThemesHelper.LoadTheme(this);
            InitializeComponent();

            dataSet1.ReadXmlSchema("..\\..\\Data\\Demo.xsd");
            dataSet1.ReadXml("..\\..\\Data\\Demo.xml");

            dataSet1.DataSetName = "Demo";
        }
Exemplo n.º 19
0
        private bool bCarregaDadosInternet(out bool bProxy, out string strProxyHost, out string strProxyPort, out bool bProxyAutentication, out string strProxyUser, out string strProxyPassword)
        {
            bool bRetorno = true;

            bProxy       = bProxyAutentication = false;
            strProxyHost = strProxyPort = strProxyUser = strProxyPassword = "";

            if (System.IO.File.Exists(m_strFileConfigPath + m_strFileConfigName))
            {
                System.Data.DataSet dtstProxy = new System.Data.DataSet();
                try
                {
                    dtstProxy.ReadXml(m_strFileConfigPath + m_strFileConfigName);
                    if (dtstProxy.Tables[DATASET_PROXY_NAME].Rows.Count > 0)
                    {
                        string strHost     = "";
                        string strPort     = "";
                        string strUser     = "";
                        string strPassword = "";
                        if (dtstProxy.Tables[DATASET_PROXY_NAME].Columns[DATASET_HOST_NAME] != null)
                        {
                            strHost = dtstProxy.Tables[DATASET_PROXY_NAME].Rows[0][DATASET_HOST_NAME].ToString();
                        }
                        if (dtstProxy.Tables[DATASET_PROXY_NAME].Columns[DATASET_PORT_NAME] != null)
                        {
                            strPort = dtstProxy.Tables[DATASET_PROXY_NAME].Rows[0][DATASET_PORT_NAME].ToString();
                        }
                        if (dtstProxy.Tables[DATASET_PROXY_NAME].Columns[DATASET_USER_NAME] != null)
                        {
                            strUser = dtstProxy.Tables[DATASET_PROXY_NAME].Rows[0][DATASET_USER_NAME].ToString();
                        }
                        if (dtstProxy.Tables[DATASET_PROXY_NAME].Columns[DATASET_PASSWORD_NAME] != null)
                        {
                            strPassword = dtstProxy.Tables[DATASET_PROXY_NAME].Rows[0][DATASET_PASSWORD_NAME].ToString();
                        }
                        if (bProxy = (strHost != ""))
                        {
                            strProxyHost = strHost;
                            strProxyPort = strPort;
                            if (bProxyAutentication = (strUser != ""))
                            {
                                strProxyUser     = strUser;
                                strProxyPassword = strPassword;
                            }
                        }
                    }
                }
                catch
                {
                    bRetorno = false;
                }
            }
            return(bRetorno);
        }
Exemplo n.º 20
0
 public static string CreateSchema(TextEditor doc, string xml)
 {
     using (var dataSet = new System.Data.DataSet()) {
         dataSet.ReadXml(new StringReader(xml), System.Data.XmlReadMode.InferSchema);
         using (var writer = new EncodedStringWriter(Encoding.UTF8)) {
             using (var xmlWriter = CreateXmlTextWriter(doc, writer)) {
                 dataSet.WriteXmlSchema(xmlWriter);
                 return(writer.ToString());
             }
         }
     }
 }
        private static Dictionary <string, string> readSatelliteXml(string Path)
        {
            Dictionary <string, string> satelliteName = new Dictionary <string, string>();

            System.Data.DataSet ds = new System.Data.DataSet();
            ds.ReadXml(Path);
            foreach (System.Data.DataRow item in ds.Tables["sat"].Rows)
            {
                satelliteName.Add(item.ItemArray[3].ToString(), item.ItemArray[1].ToString());
            }
            return(satelliteName);
        }
Exemplo n.º 22
0
 public static string CreateSchema(Document doc, string xml)
 {
     using (System.Data.DataSet dataSet = new System.Data.DataSet()) {
         dataSet.ReadXml(new StringReader(xml), System.Data.XmlReadMode.InferSchema);
         using (EncodedStringWriter writer = new EncodedStringWriter(Encoding.UTF8)) {
             using (XmlTextWriter xmlWriter = XmlEditorService.CreateXmlTextWriter(doc, writer)) {
                 dataSet.WriteXmlSchema(xmlWriter);
                 return(writer.ToString());
             }
         }
     }
 }
Exemplo n.º 23
0
        public IActionResult ShowReport()
        {
            WebReport WebReport = new WebReport();

            WebReport.Width  = "1000";
            WebReport.Height = "1000";
            WebReport.Report.Load("App_Data/Master-Detail.frx");     //Загружаем отчет в объект WebReport
            System.Data.DataSet dataSet = new System.Data.DataSet(); //Создаем источник данных
            dataSet.ReadXml("App_Data/nwind.xml");                   //Открываем базу данных xml
            WebReport.Report.RegisterData(dataSet, "NorthWind");     //Регистрируем источник данных в отчете
            ViewBag.WebReport = WebReport;                           //передаем отчет во View
            return(View());
        }
Exemplo n.º 24
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="p_objConfig"></param>
        public AU680_Duplex()
        {
            ReceiveBuf   = new StringBuilder(1024);
            ControlCode  = new AU680_ControlCode();
            DateAnalysis = new DataAnalysis_AU680();
            Logger       = new com.digitalwave.Utility.clsLogText();

            System.Data.DataSet ds = new System.Data.DataSet();
            ds.ReadXml(System.Windows.Forms.Application.StartupPath + "\\au680.xml");
            if (ds != null && ds.Tables != null && ds.Tables.Count > 0)
            {
                DateAnalysis.dtConfig = ds.Tables[0];
            }
        }
        public Form1()
        {
            InitializeComponent();
            // This line of code is generated by Data Source Configuration Wizard
            // Create a new DataSet
            System.Data.DataSet xmlDataSet = new System.Data.DataSet(@"XML DataSet");
            // Load the XML document to the DataSet
            xmlDataSet.ReadXml(@"Data\GDPofG7.xml");
            // This line of code is generated by Data Source Configuration Wizard
            chartControl1.DataSource = xmlDataSet.Tables[@"GDP"];

            chartControl1.SeriesTemplate.ArgumentDataMember = @"Year";
            chartControl1.SeriesTemplate.ValueDataMembers.AddRange(@"Product");
        }
Exemplo n.º 26
0
        /// <summary>
        /// Makes an authenticated web service call that returns XML data and returns the result as a dataset.
        /// </summary>
        /// <param name="wsAddress">Address of web service with parameters to call.</param>
        /// <returns></returns>
        public System.Data.DataSet GetAuthenticatedServiceDataSet(System.Uri wsAddress)
        {
            System.Data.DataSet result = null;

            using (System.IO.Stream dataStream = GetAuthenticatedServiceStream(wsAddress))
            {
                // Read result into a dataset
                result        = new System.Data.DataSet();
                result.Locale = System.Globalization.CultureInfo.InvariantCulture;
                result.ReadXml(dataStream);
            }

            return(result);
        }
        public Window1()
        {
            // How to Activate
            //Stimulsoft.Base.StiLicense.Key = "6vJhGtLLLz2GNviWmUTrhSqnO...";
            //Stimulsoft.Base.StiLicense.LoadFromFile("license.key");
            //Stimulsoft.Base.StiLicense.LoadFromStream(stream);

            StiOptions.Wpf.CurrentTheme = StiOptions.Wpf.Themes.Office2013Theme;
            Stimulsoft.Report.Wpf.StiThemesHelper.LoadTheme(this);
            InitializeComponent();

            dataSet1.ReadXmlSchema("..\\Data\\Demo.xsd");
            dataSet1.ReadXml("..\\Data\\Demo.xml");
            dataSet1.DataSetName = "Demo";
        }
Exemplo n.º 28
0
        public string GetCityByIP()
        {
            string publicIP = new System.Net.WebClient().DownloadString("https://api.ipify.org");
            string ipResponse = IPRequestHelper("http://ip-api.com/xml/" + publicIP);
            using (TextReader sr = new StringReader(ipResponse))
            {
                using (System.Data.DataSet dataBase = new System.Data.DataSet())
                {
                    dataBase.ReadXml(sr);
                    string city = dataBase.Tables[0].Rows[0][5].ToString();

                    return city;
                }
            }
        }
        private LineFeatureStyleEditor()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();
            using (System.IO.StringReader sr = new System.IO.StringReader(Strings.GeometryStyleComboDataset))
                ComboBoxDataSet.ReadXml(sr);

            lineStyleEditor.displayLine.Visible = false;
            lineStyleEditor.thicknessCombo.SelectedIndexChanged += new EventHandler(thicknessCombo_SelectedIndexChanged);
            lineStyleEditor.thicknessCombo.TextChanged          += new EventHandler(thicknessCombo_TextChanged);
            lineStyleEditor.colorCombo.CurrentColorChanged      += new EventHandler(colorCombo_CurrentValueChanged);
            lineStyleEditor.fillCombo.SelectedIndexChanged      += new EventHandler(fillCombo_SelectedIndexChanged);
        }
Exemplo n.º 30
0
 private void btnSelectFile_Click(object sender, RoutedEventArgs e)
 {
     using (System.Windows.Forms.OpenFileDialog fd = new System.Windows.Forms.OpenFileDialog())
     {
         fd.Filter = "*.action|*.action";
         if (fd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             txtFileName.Text = fd.FileName;
             using (var dset = new System.Data.DataSet())
             {
                 dset.ReadXml(fd.FileName);
                 cmbDBType.SelectedValue = dset.Tables[0].TableName;
             }
         }
     }
 }
Exemplo n.º 31
0
        /// <summary>
        /// Main entry point to load the XPath data from a defined method on a type.
        /// </summary>
        /// <param name="source"></param>
        /// <param name="context"></param>
        /// <returns></returns>
        protected override void DoEnsureDataLoaded(XPathDataSourceBase source, System.Data.DataSet ds, PDFDataContext context)
        {
            MethodInfo meth = AssertGetCallableMethod(source);

            object instance = GetCallableInstance(meth);

            object[] parameters = GetInvokingParameterValues(meth);

            object returnValue = InvokeMethod(meth, instance, parameters);

            if (null != returnValue)
            {
                XPathNavigator nav = GetNavigatorFromReturnValue(returnValue, meth.ReturnType);
                ds.ReadXml(nav.ReadSubtree());
            }
        }
Exemplo n.º 32
0
 public void CargarListaCA(String ArchivoListaCA)
 {
     if (System.IO.File.Exists(ArchivoListaCA))
     {
         System.Data.DataSet DS = new System.Data.DataSet();
         DS.ReadXml(ArchivoListaCA);
         if (DS.Tables.Count > 0)
         {
             CA = DS.Tables["Authority"];
         }
     }
     else
     {
         throw new Exception("No se puede encontrar el archivo " + ArchivoListaCA);
     }
 }
Exemplo n.º 33
0
        public Location GetCountryByIP(string ipAddress)
        {
            string ipResponse = IPRequestHelper("http://ip-api.com/xml/" + ipAddress);

            using (TextReader sr = new StringReader(ipResponse))
            {
                using (System.Data.DataSet dataBase = new System.Data.DataSet())
                {
                    Location location = new Location();
                    dataBase.ReadXml(sr);
                    location.Latitude  = dataBase.Tables[0].Rows[0][7].ToString();
                    location.Longitude = dataBase.Tables[0].Rows[0][8].ToString();
                    return(location);
                }
            }
        }
Exemplo n.º 34
0
        internal static void Process(ILRepack repack)
        {
            try
            {
                var validConfigFiles = new List<string>();
                foreach (string assembly in repack.MergedAssemblyFiles)
                {
                    string assemblyConfig = assembly + ".config";
                    if (File.Exists(assemblyConfig))
                    {
                        var doc = new XmlDocument();
                        doc.Load(assemblyConfig);
                        validConfigFiles.Add(assemblyConfig);
                    }
                }

                if (validConfigFiles.Count == 0)
                    return;

                string firstFile = validConfigFiles[0];
                var dataset = new System.Data.DataSet();
                dataset.ReadXml(firstFile);
                validConfigFiles.Remove(firstFile);

                foreach (string configFile in validConfigFiles)
                {
                    var nextDataset = new System.Data.DataSet();
                    nextDataset.ReadXml(configFile);
                    dataset.Merge(nextDataset);
                }
                dataset.WriteXml(repack.OutputFile + ".config");
            }
            catch (Exception e)
            {
                repack.ERROR("Failed to merge configuration files: " + e);
            }
        }
Exemplo n.º 35
0
        private string GetBatchData()
        {
            var assembly = System.Reflection.Assembly.GetExecutingAssembly();
            string resourceName = "Processors.BBPS.CreditCard.Data.BatchData.xml";

            using (System.IO.Stream strm = assembly.GetManifestResourceStream(resourceName))
            {

                System.Data.DataSet ds = new System.Data.DataSet("batch");

                var x = ds.ReadXml(strm);

                foreach (System.Data.DataRow dr in ds.Tables[0].Rows)
                {
                    dr["transactionid"] = Guid.NewGuid();
                }

                using (System.IO.StringWriter sw = new System.IO.StringWriter(new System.Text.StringBuilder()))
                {
                    List<string> columns = new List<string>();

                    foreach (System.Data.DataColumn d in ds.Tables[0].Columns) {
                        columns.Add(d.ColumnName);
                    }

                    sw.WriteLine(string.Join(",", columns.ToArray()));

                    foreach (System.Data.DataRow dr in ds.Tables[0].Rows) {
                        sw.WriteLine(string.Join(",",dr.ItemArray));
                    }

                    return sw.GetStringBuilder().ToString();
                }

            }
        }
Exemplo n.º 36
0
            /// <summary>  
            /// WebService para Busca de CEP  
            ///  </summary>  
            /// <param  name="CEP"></param>  
            public WebCEP(string CEP)
            {
                _uf = "";
                _cidade = "";
                _bairro = "";
                _tipo_lagradouro = "";
                _lagradouro = "";
                _resultado = "0";
                _resultato_txt = "CEP não encontrado";

                //Cria um DataSet  baseado no retorno do XML
                System.Data.DataSet ds = new System.Data.DataSet();
                ds.ReadXml("http://cep.republicavirtual.com.br/web_cep.php?cep=" + CEP.Replace("-", "").Trim() + "&formato=xml");

                if (ds != null)
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        _resultado = ds.Tables[0].Rows[0]["resultado"].ToString();
                        switch (_resultado)
                        {
                            case "1":
                                _uf = ds.Tables[0].Rows[0]["uf"].ToString().Trim();
                                _cidade = ds.Tables[0].Rows[0]["cidade"].ToString().Trim();
                                _bairro = ds.Tables[0].Rows[0]["bairro"].ToString().Trim();
                                _tipo_lagradouro = ds.Tables[0].Rows[0]["tipo_logradouro"].ToString().Trim();
                                _lagradouro = ds.Tables[0].Rows[0]["logradouro"].ToString().Trim();
                                _resultato_txt = "CEP completo";
                                break;
                            case "2":
                                _uf = ds.Tables[0].Rows[0]["uf"].ToString().Trim();
                                _cidade = ds.Tables[0].Rows[0]["cidade"].ToString().Trim();
                                _bairro = "";
                                _tipo_lagradouro = "";
                                _lagradouro = "";
                                _resultato_txt = "CEP  único";
                                break;
                            default:
                                _uf = "";
                                _cidade = "";
                                _bairro = "";
                                _tipo_lagradouro = "";
                                _lagradouro = "";
                                _resultato_txt = "CEP não  encontrado";
                                break;
                        }
                    }
                }
                //Exemplo do retorno da  WEB
                //<?xml version="1.0"  encoding="iso-8859-1"?>
                //<webservicecep>
                //<uf>RS</uf>
                //<cidade>Porto  Alegre</cidade>
                //<bairro>Passo  D'Areia</bairro>
                //<tipo_logradouro>Avenida</tipo_logradouro>
                //<logradouro>Assis Brasil</logradouro>
                //<resultado>1</resultado>
                //<resultado_txt>sucesso - cep  completo</resultado_txt>
                //</webservicecep>
            }
Exemplo n.º 37
0
    private void ExecuteQuery(/*bool ShowWindow*/)
    {
      if (dsData != null)
      {
        dsData = null;
      }

      dsData = new System.Data.DataSet();
      dsData.ReadXmlSchema("c:\\data.xsd");
      dsData.ReadXml("c:\\data.xml");

      if (_reporte != null)
      {
        //        _reporte.SQL = SQL;
        //        _reporte.ReloadData();
        _reporte.ReloadData(dsData);
      }

      if (_reporteRegadores != null)
      {
        ReporteRegadoresDataset rep = new ReporteRegadoresDataset();
        rep.Process(dsData);
        _reporteRegadores.ReloadData(rep.DataSet);
      }

      if (_rawDataForm != null)
      {
        _rawDataForm.DataSource = dsData;
      }
    }
Exemplo n.º 38
0
        /// <summary>
        /// ��XML�ĵ�
        /// </summary>
        /// <param name="name">Ҫȡ�������ļ��е�ָ������Դ������,��:��ϵͳ "oldsystem" </param>
        public ConfigStruct readXML(string name)
        {
            try
            {
                //�����µĽṹ����
                ConfigStruct cfg = new ConfigStruct();

                //����һ���µ�dataset
                System.Data.DataSet ds = new System.Data.DataSet();

                //�ж��ļ��Ƿ����,��������ʾ���󲢷���һ���յĽṹ����
                if (System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory.TrimEnd(new char[] {'\\'}) +"\\"+_FileName))
                {
                    //����������ȡconfig.xml�ļ�������
                    ds.ReadXml(AppDomain.CurrentDomain.BaseDirectory.TrimEnd(new char[] {'\\'}) +"\\" +_FileName);
                }
                else
                {
                    //                    System.Windows.Forms.MessageBox.Show("config.xml�ļ�������!" , "����",
                    //                        System.Windows.Forms.MessageBoxButtons.OK ,
                    //                        System.Windows.Forms.MessageBoxIcon.Warning);
                    return new ConfigStruct();
                }

                //�жϱ��Ƿ����,��������ʾ���󲢷���һ���յĽṹ����
                if (ds.Tables.IndexOf(name.ToUpper())== -1 )
                {
                    //                    System.Windows.Forms.MessageBox.Show("��config.xml�в����ҵ���ص�����Դ��������Ϣ!" , "����",
                    //                        System.Windows.Forms.MessageBoxButtons.OK ,
                    //                        System.Windows.Forms.MessageBoxIcon.Warning);
                    return new ConfigStruct();
                }

                SymmetricMethod sm = new SymmetricMethod();

            //                cfg.hostAddress = "CIT16-PC";
            //cfg.userName   ="******";
            //cfg.password   ="******";

            //cfg.DBName = "AutoUpDateData";

                //������ȡ��ֵ
                cfg.hostAddress = sm.Decrypto(ds.Tables[name.ToUpper()].Select("key='" + sm.Encrypto(str_HA) + "'")[0]["value"].ToString());
                cfg.userName = sm.Decrypto(ds.Tables[name.ToUpper()].Select("key='" + sm.Encrypto(str_UN) + "'")[0]["value"].ToString());
                cfg.password = sm.Decrypto(ds.Tables[name.ToUpper()].Select("key='" + sm.Encrypto(str_PWD) + "'")[0]["value"].ToString());
                cfg.DBName = sm.Decrypto(ds.Tables[name.ToUpper()].Select("key='" + sm.Encrypto(str_DBN) + "'")[0]["value"].ToString());

                ds.Dispose();

                return cfg;
            }
            catch//(Exception exp)
            {
                //System.Windows.Forms.MessageBox.Show(exp.Message);
                return new ConfigStruct();
            }
        }
Exemplo n.º 39
0
        /// <summary>
        /// this will load the database assuming a table with each 'rule' on a row
        /// This is generally used by the fRulesInspector in edit mode
        /// </summary>
        /// <param name="sFile"></param>
        public void LoadFromXmlTable(string sFile)
        {
            System.Data.DataSet ds = new System.Data.DataSet();
            ds.ReadXml(sFile);

            // now load the rules
            foreach (System.Data.DataRow row in ds.Tables[0].Rows)
            {
                Add(new Relationship(row["A"].ToString(),
                    row["Relation"].ToString(),
                    row["B"].ToString(),
                    row["Comment"].ToString(),
                    (double)row["Weight"],
                     (int)row["Priority"],
                    false

                ));
            }

            // try to make super generic with reflection
        }
        /// <summary>
        /// Makes an authenticated web service call that returns XML data and returns the result as a dataset.
        /// </summary>
        /// <param name="wsAddress">Address of web service with parameters to call.</param>
        /// <returns></returns>
        public System.Data.DataSet GetAuthenticatedServiceDataSet(System.Uri wsAddress)
        {
            System.Data.DataSet result = null;

            using (System.IO.Stream dataStream = GetAuthenticatedServiceStream(wsAddress))
            {
                // Read result into a dataset
                result = new System.Data.DataSet();
                result.Locale = System.Globalization.CultureInfo.InvariantCulture;
                result.ReadXml(dataStream);
            }

            return result;
        }
		public static string CreateSchema (TextEditor doc, string xml)
		{
			using (System.Data.DataSet dataSet = new System.Data.DataSet()) {
				dataSet.ReadXml(new StringReader (xml), System.Data.XmlReadMode.InferSchema);
				using (EncodedStringWriter writer = new EncodedStringWriter (Encoding.UTF8)) {
					using (XmlTextWriter xmlWriter = XmlEditorService.CreateXmlTextWriter (doc, writer)) {
						dataSet.WriteXmlSchema(xmlWriter);
						return writer.ToString();
					}
				}
			}
		}
Exemplo n.º 42
0
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["Cash"] != null)) {
             base.Tables.Add(new CashDataTable(ds.Tables["Cash"]));
         }
         if ((ds.Tables["DocumentType"] != null)) {
             base.Tables.Add(new DocumentTypeDataTable(ds.Tables["DocumentType"]));
         }
         if ((ds.Tables["InvoiceMaster"] != null)) {
             base.Tables.Add(new InvoiceMasterDataTable(ds.Tables["InvoiceMaster"]));
         }
         if ((ds.Tables["InvoiceDetail"] != null)) {
             base.Tables.Add(new InvoiceDetailDataTable(ds.Tables["InvoiceDetail"]));
         }
         if ((ds.Tables["Periods"] != null)) {
             base.Tables.Add(new PeriodsDataTable(ds.Tables["Periods"]));
         }
         if ((ds.Tables["ReceiptDetail"] != null)) {
             base.Tables.Add(new ReceiptDetailDataTable(ds.Tables["ReceiptDetail"]));
         }
         if ((ds.Tables["ReceiptMaster"] != null)) {
             base.Tables.Add(new ReceiptMasterDataTable(ds.Tables["ReceiptMaster"]));
         }
         if ((ds.Tables["ReceiptRemains"] != null)) {
             base.Tables.Add(new ReceiptRemainsDataTable(ds.Tables["ReceiptRemains"]));
         }
         if ((ds.Tables["Product"] != null)) {
             base.Tables.Add(new ProductDataTable(ds.Tables["Product"]));
         }
         if ((ds.Tables["Remains"] != null)) {
             base.Tables.Add(new RemainsDataTable(ds.Tables["Remains"]));
         }
         if ((ds.Tables["Stock"] != null)) {
             base.Tables.Add(new StockDataTable(ds.Tables["Stock"]));
         }
         if ((ds.Tables["LocalSetting"] != null)) {
             base.Tables.Add(new LocalSettingDataTable(ds.Tables["LocalSetting"]));
         }
         if ((ds.Tables["Orders"] != null)) {
             base.Tables.Add(new OrdersDataTable(ds.Tables["Orders"]));
         }
         if ((ds.Tables["inventoryMaster"] != null)) {
             base.Tables.Add(new inventoryMasterDataTable(ds.Tables["inventoryMaster"]));
         }
         if ((ds.Tables["inventoryDetails"] != null)) {
             base.Tables.Add(new inventoryDetailsDataTable(ds.Tables["inventoryDetails"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 43
0
        /// <summary>
        /// XML 문자열을 전달받아 DataTable로 변환 후 반환합니다.
        /// </summary>
        /// <param name="rawXml"></param>
        /// <returns></returns>
        private static System.Data.DataTable ToDataTable(string rawXml)
        {
            System.Data.DataSet ds = new System.Data.DataSet();

            ds.ReadXml(new System.IO.StringReader(rawXml));

            return ds.Tables[0].Copy();
        }
		/// <summary> Returns a semantic equivalent of a given XML-encoded message in a default format.
		/// Attributes, comments, and processing instructions are not considered to change the 
		/// HL7 meaning of the message, and are removed in the standardized representation.    
		/// </summary>
		public static System.String standardizeXML(System.String message)
		{			
			System.Xml.XmlDocument doc = null;
			System.IO.StringWriter out_Renamed = new System.IO.StringWriter();
			try
			{
				lock (parser)
				{
                    XmlTextReader reader = new XmlTextReader(new System.IO.MemoryStream(new System.Text.ASCIIEncoding().GetBytes(message)));
                    System.Data.DataSet data = new System.Data.DataSet();
                    data.ReadXml(reader);
                    doc = new XmlDataDocument(data);
				}
				clean((System.Xml.XmlElement) doc.DocumentElement);
			}
			catch (System.IO.IOException e)
			{
				throw new System.SystemException("IOException doing IO to a string!!! " + e.Message);
			}
			return out_Renamed.ToString();
		}
Exemplo n.º 45
0
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["tblIller"] != null)) {
             base.Tables.Add(new tblIllerDataTable(ds.Tables["tblIller"]));
         }
         if ((ds.Tables["tblSaglikTesisiList"] != null)) {
             base.Tables.Add(new tblSaglikTesisiListDataTable(ds.Tables["tblSaglikTesisiList"]));
         }
         if ((ds.Tables["st_iller"] != null)) {
             base.Tables.Add(new st_illerDataTable(ds.Tables["st_iller"]));
         }
         if ((ds.Tables["st_kamu_ozel"] != null)) {
             base.Tables.Add(new st_kamu_ozelDataTable(ds.Tables["st_kamu_ozel"]));
         }
         if ((ds.Tables["st_tesis_turleri"] != null)) {
             base.Tables.Add(new st_tesis_turleriDataTable(ds.Tables["st_tesis_turleri"]));
         }
         if ((ds.Tables["st_tesisler"] != null)) {
             base.Tables.Add(new st_tesislerDataTable(ds.Tables["st_tesisler"]));
         }
         if ((ds.Tables["tblDoktorList"] != null)) {
             base.Tables.Add(new tblDoktorListDataTable(ds.Tables["tblDoktorList"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 46
0
        /// <summary>
        /// Get some DataTable from RSS file.
        /// </summary>
        /// <param name="location"></param>
        /// <param name="address"></param>
        /// <param name="feedType"></param>
        /// <returns></returns>
        public static System.Data.DataTable GetRSSFeed(RSSLocation location, string address, RSSFeedType feedType)
        {
            int intIndex = 0;
            int intItemTableIndex = -1;

            System.IO.StreamReader oStreamReader = null;
            System.Xml.XmlTextReader oXmlTextReader = null;

            switch(location)
            {
                case RSSLocation.URL:
                    oXmlTextReader = new System.Xml.XmlTextReader(address);
                    break;

                case RSSLocation.Drive:
                    oStreamReader = new System.IO.StreamReader(address, System.Text.Encoding.UTF8);
                    oXmlTextReader = new System.Xml.XmlTextReader(oStreamReader);
                    break;
            }

            System.Data.DataSet oDataSet = new System.Data.DataSet();
            oDataSet.ReadXml(oXmlTextReader, System.Data.XmlReadMode.Auto);

            oXmlTextReader.Close();
            if(location == RSSLocation.Drive)
                oStreamReader.Close();

            while((intIndex <= oDataSet.Tables.Count - 1) && (intItemTableIndex == -1))
            {
                if(oDataSet.Tables[intIndex].TableName.ToUpper() == feedType.ToString().ToUpper())
                    intItemTableIndex = intIndex;

                intIndex++;
            }

            if(intItemTableIndex == -1)
                return(null);
            else
                return(oDataSet.Tables[intItemTableIndex]);
        }
Exemplo n.º 47
0
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["Product"] != null)) {
             base.Tables.Add(new ProductDataTable(ds.Tables["Product"]));
         }
         if ((ds.Tables["Country"] != null)) {
             base.Tables.Add(new CountryDataTable(ds.Tables["Country"]));
         }
         if ((ds.Tables["FarmGroup"] != null)) {
             base.Tables.Add(new FarmGroupDataTable(ds.Tables["FarmGroup"]));
         }
         if ((ds.Tables["FarmGroupLevel2"] != null)) {
             base.Tables.Add(new FarmGroupLevel2DataTable(ds.Tables["FarmGroupLevel2"]));
         }
         if ((ds.Tables["Manufacturer"] != null)) {
             base.Tables.Add(new ManufacturerDataTable(ds.Tables["Manufacturer"]));
         }
         if ((ds.Tables["Packing"] != null)) {
             base.Tables.Add(new PackingDataTable(ds.Tables["Packing"]));
         }
         if ((ds.Tables["StorageCondition"] != null)) {
             base.Tables.Add(new StorageConditionDataTable(ds.Tables["StorageCondition"]));
         }
         if ((ds.Tables["Unit"] != null)) {
             base.Tables.Add(new UnitDataTable(ds.Tables["Unit"]));
         }
         if ((ds.Tables["Substance"] != null)) {
             base.Tables.Add(new SubstanceDataTable(ds.Tables["Substance"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 48
0
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["tbl_TaniBlg"] != null)) {
             base.Tables.Add(new tbl_TaniBlgDataTable(ds.Tables["tbl_TaniBlg"]));
         }
         if ((ds.Tables["tblKonsultasyonBilgisi"] != null)) {
             base.Tables.Add(new tblKonsultasyonBilgisiDataTable(ds.Tables["tblKonsultasyonBilgisi"]));
         }
         if ((ds.Tables["tbkBranj"] != null)) {
             base.Tables.Add(new tbkBranjDataTable(ds.Tables["tbkBranj"]));
         }
         if ((ds.Tables["tbkHastaYatisBilgisi"] != null)) {
             base.Tables.Add(new tbkHastaYatisBilgisiDataTable(ds.Tables["tbkHastaYatisBilgisi"]));
         }
         if ((ds.Tables["tblDisBilgisi"] != null)) {
             base.Tables.Add(new tblDisBilgisiDataTable(ds.Tables["tblDisBilgisi"]));
         }
         if ((ds.Tables["tblAmeliyatveGirisimBilgisi"] != null)) {
             base.Tables.Add(new tblAmeliyatveGirisimBilgisiDataTable(ds.Tables["tblAmeliyatveGirisimBilgisi"]));
         }
         if ((ds.Tables["tblTetkikveRadyolojiBilgisi"] != null)) {
             base.Tables.Add(new tblTetkikveRadyolojiBilgisiDataTable(ds.Tables["tblTetkikveRadyolojiBilgisi"]));
         }
         if ((ds.Tables["tbkTahlilBilgisi"] != null)) {
             base.Tables.Add(new tbkTahlilBilgisiDataTable(ds.Tables["tbkTahlilBilgisi"]));
         }
         if ((ds.Tables["tblDigerIslemBilgileri"] != null)) {
             base.Tables.Add(new tblDigerIslemBilgileriDataTable(ds.Tables["tblDigerIslemBilgileri"]));
         }
         if ((ds.Tables["tblIlacBilgisi"] != null)) {
             base.Tables.Add(new tblIlacBilgisiDataTable(ds.Tables["tblIlacBilgisi"]));
         }
         if ((ds.Tables["tblMalzemeBilgileri"] != null)) {
             base.Tables.Add(new tblMalzemeBilgileriDataTable(ds.Tables["tblMalzemeBilgileri"]));
         }
         if ((ds.Tables["tblRaporBilgileri"] != null)) {
             base.Tables.Add(new tblRaporBilgileriDataTable(ds.Tables["tblRaporBilgileri"]));
         }
         if ((ds.Tables["tblOdemeSorguHataBilgisi"] != null)) {
             base.Tables.Add(new tblOdemeSorguHataBilgisiDataTable(ds.Tables["tblOdemeSorguHataBilgisi"]));
         }
         if ((ds.Tables["tblIslemFiyatBilgisi"] != null)) {
             base.Tables.Add(new tblIslemFiyatBilgisiDataTable(ds.Tables["tblIslemFiyatBilgisi"]));
         }
         if ((ds.Tables["tblHastaTakipList"] != null)) {
             base.Tables.Add(new tblHastaTakipListDataTable(ds.Tables["tblHastaTakipList"]));
         }
         if ((ds.Tables["tblFaturaBilgisi"] != null)) {
             base.Tables.Add(new tblFaturaBilgisiDataTable(ds.Tables["tblFaturaBilgisi"]));
         }
         if ((ds.Tables["tblFaturaHataliKayit"] != null)) {
             base.Tables.Add(new tblFaturaHataliKayitDataTable(ds.Tables["tblFaturaHataliKayit"]));
         }
         if ((ds.Tables["tblFaturaBasariliKayit"] != null)) {
             base.Tables.Add(new tblFaturaBasariliKayitDataTable(ds.Tables["tblFaturaBasariliKayit"]));
         }
         if ((ds.Tables["tblTakipNumaralari"] != null)) {
             base.Tables.Add(new tblTakipNumaralariDataTable(ds.Tables["tblTakipNumaralari"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["Categories"] != null)) {
             base.Tables.Add(new CategoriesDataTable(ds.Tables["Categories"]));
         }
         if ((ds.Tables["CustomerCustomerDemo"] != null)) {
             base.Tables.Add(new CustomerCustomerDemoDataTable(ds.Tables["CustomerCustomerDemo"]));
         }
         if ((ds.Tables["CustomerDemographics"] != null)) {
             base.Tables.Add(new CustomerDemographicsDataTable(ds.Tables["CustomerDemographics"]));
         }
         if ((ds.Tables["Customers"] != null)) {
             base.Tables.Add(new CustomersDataTable(ds.Tables["Customers"]));
         }
         if ((ds.Tables["Employees"] != null)) {
             base.Tables.Add(new EmployeesDataTable(ds.Tables["Employees"]));
         }
         if ((ds.Tables["EmployeeTerritories"] != null)) {
             base.Tables.Add(new EmployeeTerritoriesDataTable(ds.Tables["EmployeeTerritories"]));
         }
         if ((ds.Tables["Order Details"] != null)) {
             base.Tables.Add(new Order_DetailsDataTable(ds.Tables["Order Details"]));
         }
         if ((ds.Tables["Orders"] != null)) {
             base.Tables.Add(new OrdersDataTable(ds.Tables["Orders"]));
         }
         if ((ds.Tables["Products"] != null)) {
             base.Tables.Add(new ProductsDataTable(ds.Tables["Products"]));
         }
         if ((ds.Tables["Region"] != null)) {
             base.Tables.Add(new RegionDataTable(ds.Tables["Region"]));
         }
         if ((ds.Tables["Shippers"] != null)) {
             base.Tables.Add(new ShippersDataTable(ds.Tables["Shippers"]));
         }
         if ((ds.Tables["Suppliers"] != null)) {
             base.Tables.Add(new SuppliersDataTable(ds.Tables["Suppliers"]));
         }
         if ((ds.Tables["Territories"] != null)) {
             base.Tables.Add(new TerritoriesDataTable(ds.Tables["Territories"]));
         }
         if ((ds.Tables["Alphabetical list of products"] != null)) {
             base.Tables.Add(new Alphabetical_list_of_productsDataTable(ds.Tables["Alphabetical list of products"]));
         }
         if ((ds.Tables["Category Sales for 1997"] != null)) {
             base.Tables.Add(new Category_Sales_for_1997DataTable(ds.Tables["Category Sales for 1997"]));
         }
         if ((ds.Tables["Current Product List"] != null)) {
             base.Tables.Add(new Current_Product_ListDataTable(ds.Tables["Current Product List"]));
         }
         if ((ds.Tables["Customer and Suppliers by City"] != null)) {
             base.Tables.Add(new Customer_and_Suppliers_by_CityDataTable(ds.Tables["Customer and Suppliers by City"]));
         }
         if ((ds.Tables["Invoices"] != null)) {
             base.Tables.Add(new InvoicesDataTable(ds.Tables["Invoices"]));
         }
         if ((ds.Tables["Order Details Extended"] != null)) {
             base.Tables.Add(new Order_Details_ExtendedDataTable(ds.Tables["Order Details Extended"]));
         }
         if ((ds.Tables["Order Subtotals"] != null)) {
             base.Tables.Add(new Order_SubtotalsDataTable(ds.Tables["Order Subtotals"]));
         }
         if ((ds.Tables["Orders Qry"] != null)) {
             base.Tables.Add(new Orders_QryDataTable(ds.Tables["Orders Qry"]));
         }
         if ((ds.Tables["Product Sales for 1997"] != null)) {
             base.Tables.Add(new Product_Sales_for_1997DataTable(ds.Tables["Product Sales for 1997"]));
         }
         if ((ds.Tables["Products Above Average Price"] != null)) {
             base.Tables.Add(new Products_Above_Average_PriceDataTable(ds.Tables["Products Above Average Price"]));
         }
         if ((ds.Tables["Products by Category"] != null)) {
             base.Tables.Add(new Products_by_CategoryDataTable(ds.Tables["Products by Category"]));
         }
         if ((ds.Tables["Quarterly Orders"] != null)) {
             base.Tables.Add(new Quarterly_OrdersDataTable(ds.Tables["Quarterly Orders"]));
         }
         if ((ds.Tables["Sales by Category"] != null)) {
             base.Tables.Add(new Sales_by_CategoryDataTable(ds.Tables["Sales by Category"]));
         }
         if ((ds.Tables["Sales Totals by Amount"] != null)) {
             base.Tables.Add(new Sales_Totals_by_AmountDataTable(ds.Tables["Sales Totals by Amount"]));
         }
         if ((ds.Tables["Summary of Sales by Quarter"] != null)) {
             base.Tables.Add(new Summary_of_Sales_by_QuarterDataTable(ds.Tables["Summary of Sales by Quarter"]));
         }
         if ((ds.Tables["Summary of Sales by Year"] != null)) {
             base.Tables.Add(new Summary_of_Sales_by_YearDataTable(ds.Tables["Summary of Sales by Year"]));
         }
         if ((ds.Tables["CustOrderHist"] != null)) {
             base.Tables.Add(new CustOrderHistDataTable(ds.Tables["CustOrderHist"]));
         }
         if ((ds.Tables["CustOrdersDetail"] != null)) {
             base.Tables.Add(new CustOrdersDetailDataTable(ds.Tables["CustOrdersDetail"]));
         }
         if ((ds.Tables["CustOrdersOrders"] != null)) {
             base.Tables.Add(new CustOrdersOrdersDataTable(ds.Tables["CustOrdersOrders"]));
         }
         if ((ds.Tables["Employee Sales by Country"] != null)) {
             base.Tables.Add(new Employee_Sales_by_CountryDataTable(ds.Tables["Employee Sales by Country"]));
         }
         if ((ds.Tables["Sales by Year"] != null)) {
             base.Tables.Add(new Sales_by_YearDataTable(ds.Tables["Sales by Year"]));
         }
         if ((ds.Tables["SalesByCategory"] != null)) {
             base.Tables.Add(new SalesByCategoryDataTable(ds.Tables["SalesByCategory"]));
         }
         if ((ds.Tables["Ten Most Expensive Products"] != null)) {
             base.Tables.Add(new Ten_Most_Expensive_ProductsDataTable(ds.Tables["Ten Most Expensive Products"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 50
0
        /// <summary>
        /// 序列化XML文件
        /// </summary>
        /// <param name="FileFullPath">文件全路径</param>
        /// <returns></returns>
        public static bool SerializeXmlFile(string FileFullPath)
        {
            try
            {
                System.Data.DataSet DS = new System.Data.DataSet();
                DS.ReadXml(FileFullPath);
                FileStream FS = new FileStream(FileFullPath + ".tmp", FileMode.OpenOrCreate);
                System.Runtime.Serialization.Formatters.Binary.BinaryFormatter FT = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
                FT.Serialize(FS, DS);
                FS.Close();
                DeleteFile(FileFullPath);
                File.Move(FileFullPath + ".tmp", FileFullPath);
                return true;
            }
            catch
            {
                return false;
            }

        }
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["PACK_ID"] != null)) {
             base.Tables.Add(new PACK_IDDataTable(ds.Tables["PACK_ID"]));
         }
         if ((ds.Tables["EXPORT_NOTES_HEAD"] != null)) {
             base.Tables.Add(new EXPORT_NOTES_HEADDataTable(ds.Tables["EXPORT_NOTES_HEAD"]));
         }
         if ((ds.Tables["SHIPPING_INSTR_HEAD"] != null)) {
             base.Tables.Add(new SHIPPING_INSTR_HEADDataTable(ds.Tables["SHIPPING_INSTR_HEAD"]));
         }
         if ((ds.Tables["PICKING_INSTR_HEAD"] != null)) {
             base.Tables.Add(new PICKING_INSTR_HEADDataTable(ds.Tables["PICKING_INSTR_HEAD"]));
         }
         if ((ds.Tables["DELIVERY_INSTR_HEAD"] != null)) {
             base.Tables.Add(new DELIVERY_INSTR_HEADDataTable(ds.Tables["DELIVERY_INSTR_HEAD"]));
         }
         if ((ds.Tables["SPECIAL_INSTR_HEAD"] != null)) {
             base.Tables.Add(new SPECIAL_INSTR_HEADDataTable(ds.Tables["SPECIAL_INSTR_HEAD"]));
         }
         if ((ds.Tables["CUSTOMER_INSTR_HEAD"] != null)) {
             base.Tables.Add(new CUSTOMER_INSTR_HEADDataTable(ds.Tables["CUSTOMER_INSTR_HEAD"]));
         }
         if ((ds.Tables["LABEL_INSTR_HEAD"] != null)) {
             base.Tables.Add(new LABEL_INSTR_HEADDataTable(ds.Tables["LABEL_INSTR_HEAD"]));
         }
         if ((ds.Tables["CARRIER_INST_HEAD"] != null)) {
             base.Tables.Add(new CARRIER_INST_HEADDataTable(ds.Tables["CARRIER_INST_HEAD"]));
         }
         if ((ds.Tables["INVOICE_UDF_HEAD"] != null)) {
             base.Tables.Add(new INVOICE_UDF_HEADDataTable(ds.Tables["INVOICE_UDF_HEAD"]));
         }
         if ((ds.Tables["UDF_HEAD"] != null)) {
             base.Tables.Add(new UDF_HEADDataTable(ds.Tables["UDF_HEAD"]));
         }
         if ((ds.Tables["UDF_HEADER"] != null)) {
             base.Tables.Add(new UDF_HEADERDataTable(ds.Tables["UDF_HEADER"]));
         }
         if ((ds.Tables["HANDLING_INSTR_HEAD"] != null)) {
             base.Tables.Add(new HANDLING_INSTR_HEADDataTable(ds.Tables["HANDLING_INSTR_HEAD"]));
         }
         if ((ds.Tables["PACK_ID_LINE_ITEM"] != null)) {
             base.Tables.Add(new PACK_ID_LINE_ITEMDataTable(ds.Tables["PACK_ID_LINE_ITEM"]));
         }
         if ((ds.Tables["EXPORT_NOTES_DETAIL"] != null)) {
             base.Tables.Add(new EXPORT_NOTES_DETAILDataTable(ds.Tables["EXPORT_NOTES_DETAIL"]));
         }
         if ((ds.Tables["SHIPPING_INSTR_DETAIL"] != null)) {
             base.Tables.Add(new SHIPPING_INSTR_DETAILDataTable(ds.Tables["SHIPPING_INSTR_DETAIL"]));
         }
         if ((ds.Tables["PICKING_INSTR_DETAIL"] != null)) {
             base.Tables.Add(new PICKING_INSTR_DETAILDataTable(ds.Tables["PICKING_INSTR_DETAIL"]));
         }
         if ((ds.Tables["DELIVERY_INSTR_DETAIL"] != null)) {
             base.Tables.Add(new DELIVERY_INSTR_DETAILDataTable(ds.Tables["DELIVERY_INSTR_DETAIL"]));
         }
         if ((ds.Tables["SPECIAL_INSTR_DETAIL"] != null)) {
             base.Tables.Add(new SPECIAL_INSTR_DETAILDataTable(ds.Tables["SPECIAL_INSTR_DETAIL"]));
         }
         if ((ds.Tables["CUSTOMER_INSTR_DETAIL"] != null)) {
             base.Tables.Add(new CUSTOMER_INSTR_DETAILDataTable(ds.Tables["CUSTOMER_INSTR_DETAIL"]));
         }
         if ((ds.Tables["HANDLING_INSTR_DETAIL"] != null)) {
             base.Tables.Add(new HANDLING_INSTR_DETAILDataTable(ds.Tables["HANDLING_INSTR_DETAIL"]));
         }
         if ((ds.Tables["UID_INSTR_DETAIL"] != null)) {
             base.Tables.Add(new UID_INSTR_DETAILDataTable(ds.Tables["UID_INSTR_DETAIL"]));
         }
         if ((ds.Tables["CONFIG_INSTR_DETAIL"] != null)) {
             base.Tables.Add(new CONFIG_INSTR_DETAILDataTable(ds.Tables["CONFIG_INSTR_DETAIL"]));
         }
         if ((ds.Tables["MAXKIT_DETAIL"] != null)) {
             base.Tables.Add(new MAXKIT_DETAILDataTable(ds.Tables["MAXKIT_DETAIL"]));
         }
         if ((ds.Tables["UDF_DET"] != null)) {
             base.Tables.Add(new UDF_DETDataTable(ds.Tables["UDF_DET"]));
         }
         if ((ds.Tables["UDF_DETAIL"] != null)) {
             base.Tables.Add(new UDF_DETAILDataTable(ds.Tables["UDF_DETAIL"]));
         }
         if ((ds.Tables["HP_PN_COMPONENTS"] != null)) {
             base.Tables.Add(new HP_PN_COMPONENTSDataTable(ds.Tables["HP_PN_COMPONENTS"]));
         }
         if ((ds.Tables["BOX"] != null)) {
             base.Tables.Add(new BOXDataTable(ds.Tables["BOX"]));
         }
         if ((ds.Tables["SERIAL_NUM"] != null)) {
             base.Tables.Add(new SERIAL_NUMDataTable(ds.Tables["SERIAL_NUM"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 52
0
        /// <summary>
        /// дXML�ĵ�
        /// </summary>
        /// <param name="name">���ݿ������������</param>
        /// <param name="con_str">���ݿ������Դ��Ϣ</param>
        public void writeXML(string name , ConfigStruct con_str)
        {
            try
            {
                //����һ��dataset
                System.Data.DataSet   ds = new System.Data.DataSet("Autoconfig");

                //�ж��Ƿ����config.xml�ļ�,������ڴӸ��ļ��ж�ȡ���ݵ�dataset
                if(System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory.TrimEnd(new char[] {'\\'}) +"\\" +_FileName))
                {
                    ds.ReadXml(AppDomain.CurrentDomain.BaseDirectory.TrimEnd(new char[] {'\\'}) +"\\" +_FileName);
                }

                //�ж��Ƿ���ڸñ�,���������ɾ���ñ�
                if(ds.Tables.IndexOf(name.ToUpper()) != -1 )
                {
                    ds.Tables.Remove(name.ToUpper());
                }

                //����һ��datatable
                System.Data.DataTable dt = new System.Data.DataTable(name.ToUpper());

                //Ϊ�¶���ı�������
                dt.Columns.Add("key");
                dt.Columns.Add("value");

                SymmetricMethod sm = new SymmetricMethod();

                //���Ӽ�¼���¶���ı���
                dt.Rows.Add(new object[2]{ sm.Encrypto( str_HA  ),  sm.Encrypto( con_str.hostAddress)});
                dt.Rows.Add(new object[2]{ sm.Encrypto( str_UN  ),  sm.Encrypto( con_str.userName)});
                dt.Rows.Add(new object[2]{ sm.Encrypto( str_PWD ),  sm.Encrypto( con_str.password)});
                dt.Rows.Add(new object[2]{ sm.Encrypto( str_DBN ),  sm.Encrypto( con_str.DBName)});

                //�������ӵ�������µ�dataset��
                ds.Tables.Add(dt);

                //д��xml�ĵ�
                ds.WriteXml(AppDomain.CurrentDomain.BaseDirectory.TrimEnd(new char[] {'\\'}) +"\\" +_FileName);
                //�ͷ�datatable �� dataset
                dt.Dispose();
                ds.Dispose();
            }
            catch(Exception exp)
            {
                //System.Windows.Forms.MessageBox.Show(exp.Message);
                throw exp;
            }
        }
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     this.Reset();
     System.Data.DataSet ds = new System.Data.DataSet();
     ds.ReadXml(reader);
     if ((ds.Tables["A"] != null)) {
         base.Tables.Add(new ADataTable(ds.Tables["A"]));
     }
     if ((ds.Tables["B"] != null)) {
         base.Tables.Add(new BDataTable(ds.Tables["B"]));
     }
     if ((ds.Tables["C"] != null)) {
         base.Tables.Add(new CDataTable(ds.Tables["C"]));
     }
     this.DataSetName = ds.DataSetName;
     this.Prefix = ds.Prefix;
     this.Namespace = ds.Namespace;
     this.Locale = ds.Locale;
     this.CaseSensitive = ds.CaseSensitive;
     this.EnforceConstraints = ds.EnforceConstraints;
     this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
     this.InitVars();
 }
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["ListaCampos"] != null)) {
             base.Tables.Add(new ListaCamposDataTable(ds.Tables["ListaCampos"]));
         }
         if ((ds.Tables["MetodoConsulta"] != null)) {
             base.Tables.Add(new MetodoConsultaDataTable(ds.Tables["MetodoConsulta"]));
         }
         if ((ds.Tables["ClasseCRUD"] != null)) {
             base.Tables.Add(new ClasseCRUDDataTable(ds.Tables["ClasseCRUD"]));
         }
         if ((ds.Tables["Metodo"] != null)) {
             base.Tables.Add(new MetodoDataTable(ds.Tables["Metodo"]));
         }
         if ((ds.Tables["Versao"] != null)) {
             base.Tables.Add(new VersaoDataTable(ds.Tables["Versao"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 55
0
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["tblDoktorBilgisiDVO"] != null)) {
             base.Tables.Add(new tblDoktorBilgisiDVODataTable(ds.Tables["tblDoktorBilgisiDVO"]));
         }
         if ((ds.Tables["tblTaniBilgisiDVO"] != null)) {
             base.Tables.Add(new tblTaniBilgisiDVODataTable(ds.Tables["tblTaniBilgisiDVO"]));
         }
         if ((ds.Tables["tblHastaYatisBilgisi"] != null)) {
             base.Tables.Add(new tblHastaYatisBilgisiDataTable(ds.Tables["tblHastaYatisBilgisi"]));
         }
         if ((ds.Tables["tblCocukBilgisi"] != null)) {
             base.Tables.Add(new tblCocukBilgisiDataTable(ds.Tables["tblCocukBilgisi"]));
         }
         if ((ds.Tables["tblMalzemeBilgisi"] != null)) {
             base.Tables.Add(new tblMalzemeBilgisiDataTable(ds.Tables["tblMalzemeBilgisi"]));
         }
         if ((ds.Tables["tblTedaviIslemBilgisi"] != null)) {
             base.Tables.Add(new tblTedaviIslemBilgisiDataTable(ds.Tables["tblTedaviIslemBilgisi"]));
         }
         if ((ds.Tables["tblBransGorusBilgisi"] != null)) {
             base.Tables.Add(new tblBransGorusBilgisiDataTable(ds.Tables["tblBransGorusBilgisi"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 56
0
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["Country"] != null)) {
             base.Tables.Add(new CountryDataTable(ds.Tables["Country"]));
         }
         if ((ds.Tables["DocumentType"] != null)) {
             base.Tables.Add(new DocumentTypeDataTable(ds.Tables["DocumentType"]));
         }
         if ((ds.Tables["InvoiceDetail"] != null)) {
             base.Tables.Add(new InvoiceDetailDataTable(ds.Tables["InvoiceDetail"]));
         }
         if ((ds.Tables["InvoiceMaster"] != null)) {
             base.Tables.Add(new InvoiceMasterDataTable(ds.Tables["InvoiceMaster"]));
         }
         if ((ds.Tables["Organization"] != null)) {
             base.Tables.Add(new OrganizationDataTable(ds.Tables["Organization"]));
         }
         if ((ds.Tables["ReceiptRemains"] != null)) {
             base.Tables.Add(new ReceiptRemainsDataTable(ds.Tables["ReceiptRemains"]));
         }
         if ((ds.Tables["Stock"] != null)) {
             base.Tables.Add(new StockDataTable(ds.Tables["Stock"]));
         }
         if ((ds.Tables["TradePutlet"] != null)) {
             base.Tables.Add(new TradePutletDataTable(ds.Tables["TradePutlet"]));
         }
         if ((ds.Tables["ReceiptMaster"] != null)) {
             base.Tables.Add(new ReceiptMasterDataTable(ds.Tables["ReceiptMaster"]));
         }
         if ((ds.Tables["ReceiptDetail"] != null)) {
             base.Tables.Add(new ReceiptDetailDataTable(ds.Tables["ReceiptDetail"]));
         }
         if ((ds.Tables["StorageCondition"] != null)) {
             base.Tables.Add(new StorageConditionDataTable(ds.Tables["StorageCondition"]));
         }
         if ((ds.Tables["Product"] != null)) {
             base.Tables.Add(new ProductDataTable(ds.Tables["Product"]));
         }
         if ((ds.Tables["FarmGroup"] != null)) {
             base.Tables.Add(new FarmGroupDataTable(ds.Tables["FarmGroup"]));
         }
         if ((ds.Tables["Packing"] != null)) {
             base.Tables.Add(new PackingDataTable(ds.Tables["Packing"]));
         }
         if ((ds.Tables["Substance"] != null)) {
             base.Tables.Add(new SubstanceDataTable(ds.Tables["Substance"]));
         }
         if ((ds.Tables["Unit"] != null)) {
             base.Tables.Add(new UnitDataTable(ds.Tables["Unit"]));
         }
         if ((ds.Tables["Manufacturer"] != null)) {
             base.Tables.Add(new ManufacturerDataTable(ds.Tables["Manufacturer"]));
         }
         if ((ds.Tables["FarmGroupLevel2"] != null)) {
             base.Tables.Add(new FarmGroupLevel2DataTable(ds.Tables["FarmGroupLevel2"]));
         }
         if ((ds.Tables["Orders"] != null)) {
             base.Tables.Add(new OrdersDataTable(ds.Tables["Orders"]));
         }
         if ((ds.Tables["Remains"] != null)) {
             base.Tables.Add(new RemainsDataTable(ds.Tables["Remains"]));
         }
         if ((ds.Tables["PricesPurchase"] != null)) {
             base.Tables.Add(new PricesPurchaseDataTable(ds.Tables["PricesPurchase"]));
         }
         if ((ds.Tables["Periods"] != null)) {
             base.Tables.Add(new PeriodsDataTable(ds.Tables["Periods"]));
         }
         if ((ds.Tables["LinkedInvoiceDetail"] != null)) {
             base.Tables.Add(new LinkedInvoiceDetailDataTable(ds.Tables["LinkedInvoiceDetail"]));
         }
         if ((ds.Tables["LinkedInvoiceMaster"] != null)) {
             base.Tables.Add(new LinkedInvoiceMasterDataTable(ds.Tables["LinkedInvoiceMaster"]));
         }
         if ((ds.Tables["ReceiptDetailAdding"] != null)) {
             base.Tables.Add(new ReceiptDetailAddingDataTable(ds.Tables["ReceiptDetailAdding"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 57
0
		/// <summary>Parses profile string into DOM document </summary>
		private System.Xml.XmlDocument parseIntoDOM(System.String profileString)
		{
			if (this.alwaysValidate)
				profileString = insertDoctype(profileString);
			System.Xml.XmlDocument doc = null;
			try
			{
				lock (this)
				{
                    XmlTextReader reader = new XmlTextReader(new System.IO.MemoryStream(new System.Text.ASCIIEncoding().GetBytes(profileString)));
                    System.Data.DataSet data = new System.Data.DataSet();
                    data.ReadXml(reader);
                    doc = new XmlDataDocument(data);
				}
			}
			catch (System.Xml.XmlException se)
			{
				throw new NuGenProfileException("SAXException parsing message profile: " + se.Message);
			}
			catch (System.IO.IOException ioe)
			{
				throw new NuGenProfileException("IOException parsing message profile: " + ioe.Message);
			}
			return doc;
		}
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     this.Reset();
     System.Data.DataSet ds = new System.Data.DataSet();
     ds.ReadXml(reader);
     if ((ds.Tables["Products"] != null)) {
         base.Tables.Add(new ProductsDataTable(ds.Tables["Products"]));
     }
     if ((ds.Tables["Orders"] != null)) {
         base.Tables.Add(new OrdersDataTable(ds.Tables["Orders"]));
     }
     if ((ds.Tables["Suppliers"] != null)) {
         base.Tables.Add(new SuppliersDataTable(ds.Tables["Suppliers"]));
     }
     if ((ds.Tables["Shippers"] != null)) {
         base.Tables.Add(new ShippersDataTable(ds.Tables["Shippers"]));
     }
     if ((ds.Tables["Customers"] != null)) {
         base.Tables.Add(new CustomersDataTable(ds.Tables["Customers"]));
     }
     if ((ds.Tables["Categories"] != null)) {
         base.Tables.Add(new CategoriesDataTable(ds.Tables["Categories"]));
     }
     if ((ds.Tables["Order Details"] != null)) {
         base.Tables.Add(new Order_DetailsDataTable(ds.Tables["Order Details"]));
     }
     if ((ds.Tables["Employees"] != null)) {
         base.Tables.Add(new EmployeesDataTable(ds.Tables["Employees"]));
     }
     this.DataSetName = ds.DataSetName;
     this.Prefix = ds.Prefix;
     this.Namespace = ds.Namespace;
     this.Locale = ds.Locale;
     this.CaseSensitive = ds.CaseSensitive;
     this.EnforceConstraints = ds.EnforceConstraints;
     this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
     this.InitVars();
 }
Exemplo n.º 59
0
 protected override void ReadXmlSerializable(System.Xml.XmlReader reader) {
     if ((this.DetermineSchemaSerializationMode(reader) == System.Data.SchemaSerializationMode.IncludeSchema)) {
         this.Reset();
         System.Data.DataSet ds = new System.Data.DataSet();
         ds.ReadXml(reader);
         if ((ds.Tables["SPR_IZG"] != null)) {
             base.Tables.Add(new SPR_IZGDataTable(ds.Tables["SPR_IZG"]));
         }
         if ((ds.Tables["SPR_TOV"] != null)) {
             base.Tables.Add(new SPR_TOVDataTable(ds.Tables["SPR_TOV"]));
         }
         this.DataSetName = ds.DataSetName;
         this.Prefix = ds.Prefix;
         this.Namespace = ds.Namespace;
         this.Locale = ds.Locale;
         this.CaseSensitive = ds.CaseSensitive;
         this.EnforceConstraints = ds.EnforceConstraints;
         this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
         this.InitVars();
     }
     else {
         this.ReadXml(reader);
         this.InitVars();
     }
 }
Exemplo n.º 60
0
        /// <summary>
        /// Creates the XML schema
        /// </summary>
        /// <param name="className">Class name</param>
        /// <param name="methodName">Method name</param>
        /// <param name="paramList">Parameters list</param>
        /// <returns></returns>
        public Byte[] GetAxDataCreateSchema(string className, string methodName, params object[] paramList)
        {
            XmlDocument xmlDoc = new XmlDocument();

            try
            {
                this.AxLoginAs();
                AxaptaObject axObj = _Axapta.CreateAxaptaObject(className);
                string ret = (string)this.CallAxMethod(className, methodName, paramList);

                //convert string into XML document
                xmlDoc.LoadXml(ret);

                //create XML data reader to populate dataset
                XmlNodeReader xmlReader = new XmlNodeReader(xmlDoc.DocumentElement);
                System.Data.DataSet ds = new System.Data.DataSet();

                //load dataset with XML data (load schema)
                ds.ReadXml(xmlReader, System.Data.XmlReadMode.InferSchema);

                //GZIP compress dataset with schema. Return byte array
                MemoryStream ms = new MemoryStream();
                System.IO.Compression.GZipStream zip = new System.IO.Compression.GZipStream(ms, System.IO.Compression.CompressionMode.Compress);
                ds.WriteXml(zip, System.Data.XmlWriteMode.WriteSchema);
                zip.Close();
                ms.Close();
                axObj.Dispose();

                return ms.GetBuffer();
            }
            catch (Microsoft.Dynamics.AxaptaException ex)
            {
                this.WriteErrorToEventLog(ex);
                SoapException se = new SoapException(ex.Message, SoapException.ServerFaultCode, ex.InnerException);
                throw se;
            }
            catch (Exception ex)
            {
                this.WriteErrorToEventLog(ex);
                SoapException se = new SoapException(ex.Message, SoapException.ClientFaultCode, ex.InnerException);
                throw se;
            }
            finally
            {
                this.AxLogoff();
            }
        }