Ejemplo n.º 1
0
        void StateChanged_Executed(object sender, ExecutedEventArgs e)
        {
            string         messgae = "불러오기를 완료하였습니다.";
            AMR_MST04Model model   = new AMR_MST04Model();

            model = (AMR_MST04Model)e.Parameter;

            MySqlManage crud = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);
            DataSet     ds   = new DataSet();

            MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand();

            cmd.CommandText = "CALL sp_load(@sno, @datefrom, @dateto);";
            cmd.Parameters.AddWithValue("@sno", model.MST04SNO);
            cmd.Parameters.AddWithValue("@datefrom", model.From.ToString("yyyy-MM-dd") + " 00");
            cmd.Parameters.AddWithValue("@dateto", model.To.ToString("yyyy-MM-dd") + " 00");

            ds = crud.CallSPMariaDBTable(crud.Connection, cmd);

            if (ds.Tables.Count > 0)
            {
                model.DataTable = ds.Tables[0];

                CurrentForm.SearchComplete(model);
            }
            CurrentForm.ShowMessage(messgae);
        }
Ejemplo n.º 2
0
        void StateChanged_Executed(object sender, ExecutedEventArgs e)
        {
            string messgae = "불러오기를 완료하였습니다.";
            AMR_MST04Model model = new AMR_MST04Model();
            
            model = (AMR_MST04Model)e.Parameter;
            
            MySqlManage crud = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);
            DataSet ds = new DataSet();
            MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand();

            cmd.CommandText = "CALL sp_load(@sno, @datefrom, @dateto);";
            cmd.Parameters.AddWithValue("@sno", model.MST04SNO);
            cmd.Parameters.AddWithValue("@datefrom", model.From.ToString("yyyy-MM-dd") + " 00");
            cmd.Parameters.AddWithValue("@dateto", model.To.ToString("yyyy-MM-dd") + " 00");

            ds = crud.CallSPMariaDBTable(crud.Connection, cmd);

            if (ds.Tables.Count > 0)
            {
                model.DataTable = ds.Tables[0];
                
                CurrentForm.SearchComplete(model);
            }
            CurrentForm.ShowMessage(messgae);
        }
Ejemplo n.º 3
0
        void ReadingChanged(object sender, ExecutedEventArgs e)
        {
            if (e.Parameter.ToString().Equals("ReadingStart"))
                ReadingStart();
            else
                ReadingStop();

            CurrentForm.ShowMessage(e.Parameter.ToString());
        }
Ejemplo n.º 4
0
 public void Execute(object parameter)
 {
     if (this.CanExecute(parameter))
     {
         if (this.Executed != null)
         {
             ExecutedEventArgs e = new ExecutedEventArgs(this, parameter);
             this.Executed(this, e);
         }
     }
 }
Ejemplo n.º 5
0
 public void Execute(object parameter)
 {
     if (this.CanExecute(parameter))
     {
         if (this.Executed != null)
         {
             ExecutedEventArgs e = new ExecutedEventArgs(this, parameter);
             this.Executed(this, e);
         }
     }
 }
Ejemplo n.º 6
0
        void ReadingChanged(object sender, ExecutedEventArgs e)
        {
            if (e.Parameter.ToString().Equals("ReadingStart"))
            {
                ReadingStart();
            }
            else
            {
                ReadingStop();
            }

            CurrentForm.ShowMessage(e.Parameter.ToString());
        }
Ejemplo n.º 7
0
        void GraphSearchChanged_Executed(object sender, ExecutedEventArgs e)
        {
            string         messgae = "불러오기를 완료하였습니다.";
            AMR_MST04Model model   = new AMR_MST04Model();

            model = (AMR_MST04Model)e.Parameter;

            MySqlManage crud = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);

            //string query = string.Format("select TOT00DAT, {0} from amr_tot00 " +
            //    "where TOT00SNO = '{1}' and TOT00DAT between '{2}' and '{3}' " +
            //    "order by TOT00DAT asc ",
            //    model.Sensor,
            //    model.MST04SNO,
            //    model.From.ToString("yyyy-MM-dd"),
            //    model.To.ToString("yyyy-MM-dd"));

            //ds = crud.SelectMariaDBTable(crud.Connection, query);

            DataSet ds = new DataSet();

            MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand();

            cmd.CommandText = "CALL sp_load_G02I02(@sno, @sensor, @datefrom, @dateto);";
            cmd.Parameters.AddWithValue("@sno", model.MST04SNO);
            cmd.Parameters.AddWithValue("@sensor", model.Sensor);
            cmd.Parameters.AddWithValue("@datefrom", model.From.ToString("yyyy-MM-dd") + " 00");
            cmd.Parameters.AddWithValue("@dateto", model.To.ToString("yyyy-MM-dd") + " 00");

            ds = crud.CallSPMariaDBTable(crud.Connection, cmd);


            if (ds.Tables.Count > 0)
            {
                model.DataTable = ds.Tables[0];

                CurrentForm.SearchComplete(model);
            }
            CurrentForm.ShowMessage(messgae);
        }
Ejemplo n.º 8
0
        void GraphSearchChanged_Executed(object sender, ExecutedEventArgs e)
        {
            string messgae = "불러오기를 완료하였습니다.";
            AMR_MST04Model model = new AMR_MST04Model();
            
            model = (AMR_MST04Model)e.Parameter;
            
            MySqlManage crud = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);

            //string query = string.Format("select TOT00DAT, {0} from amr_tot00 " +
            //    "where TOT00SNO = '{1}' and TOT00DAT between '{2}' and '{3}' " + 
            //    "order by TOT00DAT asc ",
            //    model.Sensor,
            //    model.MST04SNO,
            //    model.From.ToString("yyyy-MM-dd"),
            //    model.To.ToString("yyyy-MM-dd"));
            
            //ds = crud.SelectMariaDBTable(crud.Connection, query);

            DataSet ds = new DataSet();
            MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand();

            cmd.CommandText = "CALL sp_load_G02I02(@sno, @sensor, @datefrom, @dateto);";
            cmd.Parameters.AddWithValue("@sno", model.MST04SNO);
            cmd.Parameters.AddWithValue("@sensor", model.Sensor);
            cmd.Parameters.AddWithValue("@datefrom", model.From.ToString("yyyy-MM-dd") + " 00");
            cmd.Parameters.AddWithValue("@dateto", model.To.ToString("yyyy-MM-dd") + " 00");

            ds = crud.CallSPMariaDBTable(crud.Connection, cmd);

            
            if (ds.Tables.Count > 0)
            {
                model.DataTable = ds.Tables[0];
                
                CurrentForm.SearchComplete(model);
            }
            CurrentForm.ShowMessage(messgae);
        }