private void operate_Click(object sender, RoutedEventArgs e) { try { actManagerLoggerView.Text = "开始执行..."; Logger.RestLogger(); Logger.HookLogger(logCallback); MenuItem menuItem = sender as MenuItem; TextBox txtNo = grid.FindName("txtNo_" + m_FocusRowIndex) as TextBox; string actNo = txtNo.Text; if ("init_k" == menuItem.Name) { CommondHandler.Process("act.init " + actNo + " -k -f"); } else { CommondHandler.Process("act." + menuItem.Name + " " + actNo + " -f"); } UserControl_Loaded(null, null); } catch (Exception ex) { logCallback(LogLevel.LevError, ex.Message); } finally { Logger.RestLogger(); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (255 == CommondHandler.Test()) { CommondHandler.Process("init"); } }
private void Window_Loaded(object sender, RoutedEventArgs e) { if (255 == CommondHandler.Test()) { CommondHandler.Process("init -f"); CommondHandler.Process("act.init finance_demo -f"); } }
private void UserControl_Loaded(object sender, RoutedEventArgs e) { clearRows(); Logger.RestLogger(); Logger.HookLogger(actPrintCallback); CommondHandler.Process("act.print"); Logger.RestLogger(); }
private void Btn_Click(object sender, RoutedEventArgs e) { try { actManagerLoggerView.Text = "开始执行..."; Logger.RestLogger(); Logger.HookLogger(logCallback); string btnName = (sender as Button).Name; FormAccountUserPopup popup = new FormAccountUserPopup(); popup.FinanceMsgEvent = (msgType, paras) => { bool bRet = false; try { int iRet = CommondHandler.Process("usr." + btnName + " " + paras["no"] + " " + paras["name"] + " " + paras["pwd1"] + " " + paras["pwd2"] + " " + "-f"); if (0 == iRet) { UserControl_Loaded(null, null); bRet = true; } } catch (Exception fex) { logCallback(LogLevel.LevError, fex.Message); } finally { Logger.RestLogger(); } return(bRet); }; popup.ShowDialog(); } catch (Exception ex) { logCallback(LogLevel.LevError, ex.Message); } finally { Logger.RestLogger(); } }
static void Main(string[] args) { try { var defaultConnectionString = ConfigHelper.XmlReadConnectionString("Finance.exe.config", "default"); DBHelper.DefaultInstance = new DBHelper(defaultConnectionString); Console.Write("login as : "); string userName = Console.ReadLine(); LOGIN_FLAG: Console.Write("password : "******"Incorrect user name or password."); goto LOGIN_FLAG; } Console.WriteLine("Welcome to use finance."); while (true) { Console.Write("$ "); string commond = Console.ReadLine(); if (!string.IsNullOrEmpty(commond)) { int returnCode = CommondHandler.Process(commond); switch (returnCode) { case -1: Console.WriteLine("Commond handler return code:" + returnCode + ", exit this process."); return; case 1: Console.Clear(); break; default: break; } } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
private void operate_Click(object sender, RoutedEventArgs e) { try { actManagerLoggerView.Text = "开始执行..."; Logger.RestLogger(); Logger.HookLogger(logCallback); MenuItem menuItem = sender as MenuItem; TextBox txtNo = grid.FindName("txtNo_" + m_FocusRowIndex) as TextBox; string usrNo = txtNo.Text; if (menuItem.Name == "delete") { CommondHandler.Process("usr." + menuItem.Name + " " + usrNo + " -f"); UserControl_Loaded(null, null); } else { TextBox txtName = grid.FindName("txtName_" + m_FocusRowIndex) as TextBox; string usrName = txtName.Text; FormAccountUserPopup popup = new FormAccountUserPopup(); popup.xNo = usrNo; popup.xName = usrName; popup.txtBoxNo.Text = usrNo; popup.txtBoxName.Text = usrName; popup.txtBoxNo.IsEnabled = false; popup.txtBoxName.IsEnabled = false; popup.FinanceMsgEvent = (msgType, paras) => { bool bRet = false; try { int iRet = CommondHandler.Process("usr." + menuItem.Name + " " + paras["no"] + " " + paras["pwd1"] + " " + paras["pwd2"] + " " + "-f"); if (0 == iRet) { UserControl_Loaded(null, null); bRet = true; } } catch (Exception fex) { logCallback(LogLevel.LevError, fex.Message); } finally { Logger.RestLogger(); } return(bRet); }; popup.ShowDialog(); } } catch (Exception ex) { logCallback(LogLevel.LevError, ex.Message); } finally { Logger.RestLogger(); } }