예제 #1
0
        public int UpdateMissSentDate(string recid, string recvalue, out string msg)
        {
            int ret = 0;

            msg = null;

            SqlConnection connect;
            Log           log = new Log(LogPath);

            try
            {
                connect = new SqlConnection(ConnectionString);
                connect.Open();
                if (connect.State == ConnectionState.Open)
                {
                    TAG tag = new TAG(recvalue);
                    tag.Delete("MDT");
                    tag.SetValue("MDT", DateTime.Now.ToString("yyyyMMddHHmmss"));
                    string retvalue = tag.ToString();

                    string     query = "UPDATE dbo.Mails SET RecValue=@1 WHERE RecId=@2";
                    SqlCommand cmd   = new SqlCommand(query, connect);
                    cmd.Parameters.Add(crp(SqlDbType.VarChar, "@1", retvalue, false));
                    cmd.Parameters.Add(crp(SqlDbType.VarChar, "@2", recid, false));
                    SqlDataReader reader = cmd.ExecuteReader();
                    connect.Close();
                }
                else
                {
                    return(1);
                }
            }
            catch (Exception ex) { log.Write(LogType.Error, ex.Message); ret = -1; msg = ex.Message; }
            return(ret);
        }
예제 #2
0
        // nur für test
        private void btnEplanDatatoOutput_click(object sender, RoutedEventArgs e)
        {
            XElement xelement = XElement.Load(@"C:\Users\Public\Documents\ComosEplanVerrgleich\Eplan_Inhaltsverzeichnis_201753.xml");
            IEnumerable <XElement> outputData = xelement.Elements("MSR_Gerät");
            IEnumerable <XElement> eplandata  = outputData.Elements("EPLAN_DATA");
            IEnumerable <XElement> makroData  = eplandata.Elements("Makroname");

            Console.WriteLine("List of all Tag :");
            foreach (var TAG in makroData)
            {
                // Console.WriteLine(TAG.Elements("Status_Erstellt").ToString());
                Console.WriteLine(TAG.ToString());
            }
        }