Example #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);
        }
Example #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);
        }
Example #3
0
 public void Assign(AMR_MST04Model info)
 {
     this.MST04SNO = info.MST04SNO;
     this.MST04CMP = info.MST04CMP;
     this.MST04DON = info.MST04DON;
     this.MST04FLR = info.MST04FLR;
     this.MST04HNO = info.MST04HNO;
     this.MST04NAM = info.MST04NAM;
     this.MST04PHN = info.MST04PHN;
 }
Example #4
0
        public void Assign(AMR_MST04Model info)
        {
            this.MST04SNO = info.MST04SNO;
            this.MST04CMP = info.MST04CMP;
            this.MST04DON = info.MST04DON;
            this.MST04FLR = info.MST04FLR;
            this.MST04HNO = info.MST04HNO;
            this.MST04NAM = info.MST04NAM;
            this.MST04PHN = info.MST04PHN;

        }
Example #5
0
        public G02I01ModuleTab2()
        {
            InitializeComponent();

            //this.gridControl1.DataBindings.Add(new System.Windows.Forms.Binding("DataSource", this.bindingSource1, "DataTable", true ));

            this.dateEdit1.DateTime = DateTime.Now;

            mMST04 = new AMR_MST04Model();

        }
        void CurrentForm_Onload(object sender, EventArgs e)
        {

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

            string query = "select MST04SNO, MST04CMP, MST04DON, MST04HNO from amr_mst04";
            DataSet ds = new DataSet();
            ds = crud.SelectMariaDBTable(crud.Connection, query);

            AMR_MST04Model model = new AMR_MST04Model();

            model.DataTable = ds.Tables[0];

            CurrentForm.LoadComplete(model);
        }
        void CurrentForm_Onload(object sender, EventArgs e)
        {
            MySqlManage crud = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);

            string  query = "select MST04SNO, MST04CMP, MST04DON, MST04HNO from amr_mst04";
            DataSet ds    = new DataSet();

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

            AMR_MST04Model model = new AMR_MST04Model();

            model.DataTable = ds.Tables[0];

            CurrentForm.LoadComplete(model);
        }
Example #8
0
        public frmEdit_COM_SET(AMR_MST04Model contact, IDXMenuManager menuManager)
        {
            InitializeComponent();
            this.contact = contact;
            this.bindingContact = contact.Clone();
            InitEditors();
            InitMenuManager(menuManager);


            //teMST04CMP.DataBindings.Add("Text", bindingContact, "MST04CMP");
            //teMST04DON.DataBindings.Add("Text", bindingContact, "MST04DON");
            //teMST04HNO.DataBindings.Add("Text", bindingContact, "MST04HNO");
            //teMST04NAM.DataBindings.Add("Text", bindingContact, "MST04NAM");  
            //teMST04PHN.DataBindings.Add("Text", bindingContact, "MST04PHN"); 
            
            UpdateCaption();
            InitValidationProvider();
        }
Example #9
0
        public G02I02ModuleTab1()
        {
            InitializeComponent();

            //this.gridControl1.DataBindings.Add(new System.Windows.Forms.Binding("DataSource", this.bindingSource1, "DataTable", true ));

            //SideBySideBarSeriesLabel label = this.chartControl1.Series[0].Label as SideBySideBarSeriesLabel;

            //label.Position = BarSeriesLabelPosition.TopInside;


            this.dateEdit1.DateTime = DateTime.Now;

            // "전기", "수도", "온수", "가스", "난방"
            mSensorList = new string[] { "TOT00PW1", "TOT00WT1", "TOT00GS1", "TOT00HT1", "TOT00CL1"  };
            
            mMST04 = new AMR_MST04Model();

        }
Example #10
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);
        }
Example #11
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);
        }
Example #12
0
        public void SearchComplete(IBaseModel item)
        {
            if (item == null)
                return;

            AMR_MST04Model model = new AMR_MST04Model();
            model = (AMR_MST04Model)item;

            CurrentData = item;

            if( model.Name.Equals("Tab1") )
                tab1.DataBinding(this.CurrentData);
            else
                tab2.DataBinding(this.CurrentData);
        }
Example #13
0
 public AMR_MST04Model(AMR_MST04Model info)
 {
     this.Assign(info);
 }
Example #14
0
        public void DataBinding(IBaseModel datalist)
        {
            if (datalist == null) return;
            if (this.InvokeRequired)
            {
                this.Invoke((MethodInvoker)delegate() { this.DataBinding(datalist); });
            }
            else
            {
                AMR_MST04Model model = new AMR_MST04Model();

                model = (AMR_MST04Model)datalist;
                gridControl1.DataSource = null;
                gridControl1.DataSource = model.DataTable;
                //bindingSource1.DataSource = datalist;

            }
        }
Example #15
0
        public void ReadingComplete(IBaseModel item)
        {
            if (item == null)
                return;

            AMR_MST04Model model = new AMR_MST04Model();
            model = (AMR_MST04Model)item;

            CurrentData = item;

            this.DataBinding(CurrentData);
            //if (model.Name.Equals("Tab1"))
            //    tab1.DataBinding(this.CurrentData);
            //else
            //    tab2.DataBinding(this.CurrentData);
        }
Example #16
0
        public void DataBinding(IBaseModel datalist)
        {
            if (datalist == null) return;
            if (this.InvokeRequired)
            {
                this.Invoke((MethodInvoker)delegate() { this.DataBinding(datalist); });
            }
            else
            {
                AMR_MST04Model model = new AMR_MST04Model();

                model = (AMR_MST04Model)datalist;
                //gridControl1.DataSource = null;
                //gridControl1.DataSource = model.DataTable;

                this.chartControl1.Series[0].Points.BeginUpdate();
                this.chartControl1.Series[0].Points.Clear();

                foreach (DataRow row in model.DataTable.Rows)
                {
                    string time = row["TOT00DAT"].ToString();
                    // 그래프 Y값 추출
                    DateTime datetime = DateTime.ParseExact(time, "yyyy-MM-dd HH", null);

                    // 센서 값 넣기
                    //double value = Convert.ToDouble(row.ItemArray[1]);
                    double value = Convert.ToDouble(row["TOT00VALUE"]);
                    //double[] value = new double[] { Convert.ToDouble(row.ItemArray[1]), Convert.ToDouble(row.ItemArray[2]), 
                    //                            Convert.ToDouble(row.ItemArray[3]), Convert.ToDouble(row.ItemArray[4]), Convert.ToDouble(row.ItemArray[5]) };


                    // 센서별 데이터 넣기
                    ChartVariable2 chartValue = new ChartVariable2();
                    chartValue.data = new SeriesPoint(datetime, value);
                    this.chartControl1.Series[0].Points.Add(chartValue.data);
                }

                this.chartControl1.Series[0].Points.EndUpdate();

                this.chartControl1.Titles.RemoveAt(0);
                ChartTitle chartTitle1 = new ChartTitle();
                chartTitle1.Text = string.Format("{0}동 {1}호 - {2}", model.MST04DON, model.MST04HNO, this.radioGroup1.Text);
                chartTitle1.Alignment = System.Drawing.StringAlignment.Center;
                chartTitle1.Dock = DevExpress.XtraCharts.ChartTitleDockStyle.Top;
                this.chartControl1.Titles.Add(chartTitle1);

            //    ChartTitle chartTitle1 = new ChartTitle();
            //    ChartTitle chartTitle2 = new ChartTitle();
            //    chartTitle1.Text = "Great Lakes Gross State Product";
            //    chartTitle2.Alignment = System.Drawing.StringAlignment.Far;
            //    chartTitle2.Dock = DevExpress.XtraCharts.ChartTitleDockStyle.Bottom;
            //    chartTitle2.Font = new System.Drawing.Font("Tahoma", 8F);
            //    chartTitle2.Text = "From www.bea.gov";
            //    chartTitle2.TextColor = System.Drawing.Color.Gray;
            //    this.chartControl1.Titles.AddRange(new DevExpress.XtraCharts.ChartTitle[] {
            //chartTitle1,
            //chartTitle2});
            }
        }
Example #17
0
 public AMR_MST04Model(AMR_MST04Model info)
 {
     this.Assign(info);
 }