示例#1
0
        // 当执行结转损益操作的时,执行此操作
        public void insertCashInvoiceData()
        {
            string insert = "INSERT INTO [dbo].[COMPANY_PROFIT]([DATE],[DATA_SOURCE],[CASH_BALANCE],[BANK_BALANCE]";

            insert += ",[SUM_RECEIVABLE],[SUM_PAYABLE],[SUM_STORAGE_STOCK]) VALUES (";

            insert += "'" + DateTime.Now.ToString("yyyyMMdd") + "',";
            insert += "'结转损益',";
            insert += Convert.ToString(BalanceManager.getCachBalance()) + ",";
            insert += Convert.ToString(BalanceManager.getAllBankBalance()) + ",";
            insert += Convert.ToString(BalanceManager.getSumAccountReceiveable()) + ",";
            insert += Convert.ToString(BalanceManager.getSumAccountPayable()) + ",";
            insert += Convert.ToString(BalanceManager.getSumStorageStockBalance());
            insert += ")";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, insert);
                load();
            }
            catch (Exception)
            {
                return;
            }
        }
示例#2
0
        public void initBusinessSystemBalanceInfo()
        {
            if (m_companyProfitDataList.Count == 0)
            {
                insertNullInitDate();
            }

            string update = "UPDATE [dbo].[COMPANY_PROFIT] SET ";

            update += "[DATE] = '" + DateTime.Now.ToString("yyyyMMdd") + "',";
            update += "[SUM_RECEIVABLE] = " + BalanceManager.getSumAccountReceiveable() + ",";
            update += "[SUM_PAYABLE] = " + BalanceManager.getSumAccountPayable() + ",";
            update += "[SUM_STORAGE_STOCK] = " + BalanceManager.getSumStorageStockBalance();
            update += " WHERE [DATA_SOURCE] = '初始数据'";

            try
            {
                DatabaseAccessFactoryInstance.Instance.ExecuteCommand(FormMain.DB_NAME, update);
                load();
            }
            catch (Exception)
            {
                return;
            }
        }