private void functionKeypress(byte index) { switch (index) { case 1: if (com.DSP_MSG("Q003", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty).Equals("1")) { this.Close(); } break; case 12: if (bnF12.Enabled) { logininfo.CompanyCode = mopeData.KAICD = txtKAICD.Text.ToString(); logininfo.OperatorCode = mopeData.TANCD = txtTANCD.Text.ToString(); ////Log and store to notepad in path // ~/Resources/store_operator // Added by Phyoe Gyi 03-26-2019 -- to make temp store in note like session for tracing_log table //string path = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location.Replace("\\bin\\Debug", "")) + @"\Resources\"; //File.WriteAllText(Path.Combine(path, "store_operator"), ""); //using (StreamWriter writer = File.AppendText(Path.Combine(path, "store_operator"))) // { // writer.WriteLine(logininfo.CompanyCode + "|" + logininfo.OperatorCode); // writer.Close(); // } DataTable dt1 = loginbl.MOPE_SELECT(mopeData); if (dt1.Rows.Count > 0) { mopeData.PASWD = dt1.Rows[0][0].ToString(); mopeData.KNGCD = dt1.Rows[0][1].ToString(); mopeData.MNUCD = dt1.Rows[0][2].ToString(); logininfo.StoreCode = mopeData.TMPCD = dt1.Rows[0][4].ToString(); logininfo.DepCode = mopeData.BMNCD = dt1.Rows[0][5].ToString(); } if (mopeData.PASWD != string.Empty && mopeData.PASWD == txtPASWD.Text.ToString()) { DataTable dt = loginbl.SMNU_SELECT(mopeData); //mopeData = new MOPE_Data(); mopeData.dtMope = dt; logininfo.PcLoginName = System.Security.Principal.WindowsIdentity.GetCurrent().Name; logininfo.PcName = System.Environment.MachineName; logininfo.CallerID = string.Empty; logininfo.StartMode = string.Empty; logininfo.Authority = string.Empty; logininfo.StartMode = "新規"; logininfo.ProcessDate = lblSProcessingDate.Text; logininfo.ProcessClass = "1"; bnF12.Enabled = false; btnChange.Enabled = false; this.Hide(); frmMainMenu mm = new frmMainMenu(mopeData, logininfo); mm.ShowDialog(); this.Close(); Environment.Exit(1); } else { com.DSP_MSG("E017", txtPASWD.Text.ToString(), string.Empty, string.Empty, string.Empty, string.Empty).Equals("1"); txtPASWD.Focus(); bnF1.Enabled = true; } break; } break; } }