using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Text;
using WebSite5.App_Code;
using System.Globalization;

public partial class ESP_savedata : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
        int id_op = Int16.Parse(Request.QueryString["id_op"]);
        int id_str = 0;
        DBMaster dbm2 = new DBMaster();
        if (id_op != 0)
        {
            switch (id_op) {
                case 1:
                    id_str = Int16.Parse(Request.QueryString["id_str"]);
                    string takt = (Request.QueryString["takt"]);
                    dbm2.Zapis("INSERT INTO [RKC_Database_00].[dbo].[ESP_LOG] ([Time],[ID_op],[ID_STROJ],[Hodnota1]) VALUES (CURRENT_TIMESTAMP," + id_op + "," + id_str + "," + takt + ")");
                    break;

                case 2:
                    id_str = Int16.Parse(Request.QueryString["id_str"]);
                    string tepl = (Request.QueryString["tepl"]);
                    string vlh = (Request.QueryString["vlh"]);
                    string tlak = (Request.QueryString["tlak"]);
                    string ip = (Request.QueryString["ip_addr"]);

                    dbm2.Zapis("INSERT INTO [RKC_Database_00].[dbo].[ESP_LOG] ([Time],[ID_op],[ID_STROJ],[Hodnota2],[Hodnota3],[Hodnota4],[Hodnota5]) VALUES (CURRENT_TIMESTAMP," + id_op + "," + id_str + ","+ip+"," + tepl + "," + vlh + "," + tlak + ")");
                    break;
            }
            
            
        }
    }
}