Пример #1
0
        static public CashBalanceLastMonth getInctance()
        {
            if (m_instance == null)
            {
                m_instance = new CashBalanceLastMonth();
            }

            return(m_instance);
        }
Пример #2
0
        public static double getCashBalanceLaseMonth()
        {
            double balance = 0;

            SortedDictionary <int, CashBalanceLastMonthTable> CashBalanceLastMonthList
                = CashBalanceLastMonth.getInctance().getAllCashBalanceLastMonthInfo();

            if (CashBalanceLastMonthList.Count > 0)
            {
                balance = CashBalanceLastMonthList[0].balance;
            }

            return(balance);
        }
Пример #3
0
        public void update(int pkey, double accountBalanec)
        {
            string update = "UPDATE [dbo].[INIT_CASH_BALANCE] SET ";

            update += "[CASH_BALANCE] = " + accountBalanec;
            update += " WHERE PKEY = " + Convert.ToString(pkey);

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);

                // 结转损益表插入现金期初数据
                CashBalanceLastMonth.getInctance().delete();
                CashBalanceLastMonth.getInctance().insert(accountBalanec, "初始余额");
                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }
Пример #4
0
        public void insert(double cashBalanec)
        {
            string insert = "INSERT INTO [dbo].[INIT_CASH_BALANCE] ([OBJECT_NAME],[CASH_BALANCE]) VALUES ('库存现金', ";

            insert += cashBalanec;
            insert += ")";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, insert);

                // 结转损益表插入现金期初数据
                CashBalanceLastMonth.getInctance().delete();
                CashBalanceLastMonth.getInctance().insert(cashBalanec, "初始余额");
                load();
            }
            catch (Exception error)
            {
                MessageBoxExtend.messageWarning(error.Message);
                return;
            }
        }