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(); } }
private void sbOK_Click(object sender, EventArgs e) { user = this.textEdit1.Text; string qry = string.Format("select MST06AID, MST06PWD from amr_mst06 where MST06AID = '{0}'", user); if (db.loginCheck(db.Connection, qry, user.ToUpper(), this.textEdit2.Text)) { string sql = string.Format("insert into amr_iqr03 values('{0}', '{1}', '1234', '{2}')", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), user.ToUpper(), 12); db.InsertMariaDB(db.Connection, sql); this.DialogResult = DialogResult.OK; this.Close(); } else { XtraMessageBox.Show("입력하신 아이디 또는 비밀번호가 잘못되었습니다."); } }
// 시간별 검침 데이터 Insert void mWorkArmTot00_eReady(object sender, EventArgs e) { int offset = 4; mCommTable = comm.CommTable; //DataRow foundErrRow = mErrorTable.Rows.Find(string.Format("0x{0:D2}", slaveId)); foreach (DataRow row in mCommTable.Rows) { //`TOT00SNO` INT(4) NOT NULL COMMENT '세대 번호', //`TOT00DAT` CHAR(20) NOT NULL COMMENT '검침 일시', //`TOT00PW1` VARCHAR(8) NULL DEFAULT NULL COMMENT '전력 검침 값', //`TOT00WT1` VARCHAR(8) NULL DEFAULT NULL COMMENT '수도 검침 값', //`TOT00GS1` VARCHAR(8) NULL DEFAULT NULL COMMENT '가스 검침 값', //`TOT00CL1` VARCHAR(8) NULL DEFAULT NULL COMMENT '열량 검침 값', //`TOT00HT1` VARCHAR(8) NULL DEFAULT NULL COMMENT '온수 검침 값', //`TOT00CO1` VARCHAR(8) NULL DEFAULT NULL COMMENT '냉방 검침 값', //mCommTable.Rows.Add(row[0], "null", row[1], row[2], "null", "null", "null", "null", "null", "null", "null"); offset = 4; // 빠른 테스트를 위해 이전시간값을 가져온다. string dat = row.ItemArray[1].ToString(); DateTime dtDate = DateTime.ParseExact(dat, "yyyy-MM-dd HH", null); string sql = string.Format("insert into amr_tot00 values('{0}', '{1}', '{2}', '{3}', '{4}', '{5}', '{6}', '{7}')", row.ItemArray[0], dtDate.AddHours(+1).ToString("yyyy-MM-dd HH"), row.ItemArray[offset++], row.ItemArray[offset++], row.ItemArray[offset++], row.ItemArray[offset++], row.ItemArray[offset++], row.ItemArray[offset++]); crud.InsertMariaDB(crud.Connection, sql); // 빠른 테스트를 위해 임의로 한시간씩 증가한다. string updatehour = dtDate.AddHours(+1).ToString("yyyy-MM-dd HH"); row["검침시간"] = updatehour; } }