예제 #1
0
        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();
            }
        }
예제 #2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (255 == CommondHandler.Test())
     {
         CommondHandler.Process("init");
     }
 }
예제 #3
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (255 == CommondHandler.Test())
     {
         CommondHandler.Process("init -f");
         CommondHandler.Process("act.init finance_demo -f");
     }
 }
예제 #4
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            clearRows();
            Logger.RestLogger();
            Logger.HookLogger(actPrintCallback);

            CommondHandler.Process("act.print");
            Logger.RestLogger();
        }
예제 #5
0
        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();
            }
        }
예제 #6
0
파일: Program.cs 프로젝트: ruo2012/finance
        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());
            }
        }
예제 #7
0
        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();
            }
        }