Пример #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);
        }
Пример #2
0
        static void Main(string[] arguments) {
            WindowsFormsSettings.ApplyDemoSettings();
            //new DevExpress.DemoReports.ConnectionStringConfigurator(System.Configuration.ConfigurationManager.ConnectionStrings)
            //    .SelectDbEngine()
            //    .ExpandDataDirectory(fileName => DevExpress.DemoData.Helpers.DataFilesHelper.FindFile(fileName, DevExpress.DemoData.Helpers.DataFilesHelper.DataPath));

            //string path = DevExpress.Utils.FilesHelper.FindingFileName(AppDomain.CurrentDomain.BaseDirectory, @"Data\NWind.mdf", false);
            //XtraReportsDemos.ConnectionHelper.ApplyDataDirectory(System.IO.Path.GetDirectoryName(path));

            DataHelper.ApplicationArguments = arguments;

            
            //System.Globalization.CultureInfo enUs = new System.Globalization.CultureInfo("en-US");
            //System.Threading.Thread.CurrentThread.CurrentCulture = enUs;
            //System.Threading.Thread.CurrentThread.CurrentUICulture = enUs;
            DevExpress.Utils.LocalizationHelper.SetCurrentCulture(DataHelper.ApplicationArguments);
            DevExpress.UserSkins.BonusSkins.Register();
            DevExpress.Utils.AppearanceObject.DefaultFont = new Font("Segoe UI", 8);
            //DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Office 2013");
            //DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Visual Studio 2013 Light");
            DevExpress.LookAndFeel.UserLookAndFeel.Default.SetSkinStyle("Office 2010 Black");
            SkinManager.EnableFormSkins();
            EnumProcessingHelper.RegisterEnum<TaskStatus>();


            //SplashScreenManager.ShowForm(null, typeof(ssMain), true, true, false, 1000);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            fmLogin login = new fmLogin();
            Application.Run(login);

            if( login.DialogResult == DialogResult.OK )
            {
                //DevExpress.Data.CurrencyDataController.DisableThreadingProblemsDetection = true;

                Application.Run(new frmMain());

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

                string sql = string.Format("insert into amr_iqr03 values('{0}', '{1}', '1234', '{2}')", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), login.User, 14);
                db.InsertMariaDB(db.Connection, sql);

                db.Dispose();

            }

            
        }
Пример #3
0
        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);
        }
Пример #4
0
        protected internal override void ButtonClick(string tag)
        {
            switch (tag)
            {
                case TagResources.LoginHistorySearch:
                    this.gcLoingHistoryGrid.SafeInvoke(d => d.DataSource = null);
                    MySqlManage crud = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);

                    string query = "select IQR03DAT, IQR03AID,  IQR03MNO from amr_iqr03";
                    DataSet ds = new DataSet();
                    ds = crud.SelectMariaDBTable(crud.Connection, query);
                    this.gcLoingHistoryGrid.DataSource = ds.Tables[0];

                    break;
                case TagResources.ContactNew:

                    break;
            }
        }
Пример #5
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);
        }
Пример #6
0
        /// <summary>
        /// 테이블 기본값 입력
        /// </summary>
        void InitGridData()
        {
            
            MySqlManage crud = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);

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

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                mDataTable.Rows.Add(row[0], DateTime.Now.ToString("yyyy-MM-dd hh"), row[1], row[2], "null", "null", "null", "null", "null", "null", "null");
                mCommTable.Rows.Add(row[0], DateTime.Now.ToString("yyyy-MM-dd hh"), row[1], row[2], "null", "null", "null", "null", "null", "null", "null");
            }

        }
Пример #7
0
        protected override void InitMDBData(string connectionString)
        {

            MariaDbConnection = new MySqlConnection(connectionString);
            MariaDbConnection.Open();
            MySqlManage sql = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);
            DataSet ds = new DataSet();
            ds = sql.SelectMariaDBTable(MariaDbConnection, "SELECT * FROM AMR_MST06");
            

            foreach( DataRow row in ds.Tables[0].Rows)
            {
                UserInfo contact = new UserInfo();

                contact.Id = row["MST06AID"].ToString();
                if (row["MST06LEV"].ToString() == "1")
                {
                    contact.Level = UserLevel.Level1;
                }
                else if (row["MST06LEV"].ToString() == "2")
                {
                    contact.Level = UserLevel.Level2;
                }
                else if (row["MST06LEV"].ToString() == "3")
                {
                    contact.Level = UserLevel.Level3;
                }

                contact.Name = row["MST06NAM"].ToString();
                contact.Phone = row["MST06PHN"].ToString();
                contact.Password = row["MST06PWD"].ToString();
                contact.ConfirmPassword = row["MST06PWD"].ToString();

                DataHelper.UserInfos.Add(contact);
            }
            
            gidControlUserManage.DataSource = DataHelper.UserInfos;

        }
Пример #8
0
        /// <summary>
        /// 테이블 기본값 입력
        /// </summary>
        void InitGridData()
        {
            this.gridControl1.SafeInvoke(d => d.DataSource = null);
            crud = new MySqlManage(ConfigurationManager.ConnectionStrings["MySQL"].ConnectionString);

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

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                mDataTable.Rows.Add(row[0], DateTime.Now.ToString("yyyy-MM-dd hh"), row[1], row[2], "null", "null", "null", "null", "null", "null", "null");
                mCommTable.Rows.Add(row[0], DateTime.Now.ToString("yyyy-MM-dd hh"), row[1], row[2], "null", "null", "null", "null", "null", "null", "null");
            }
            
            //gridControl1.DataSource = mSensorInfoTable;

            gridControl1.DataSource = CreateData();
        }
Пример #9
0
        public fmLogin() {
            InitializeComponent();

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

        }