Create a simple ledger for yourself (1)

Source: Internet
Author: User

When I receive a credit card bill every month, I am always surprised and confused. How did I spend so much money last month? Looking at every bill, I couldn't remember where the money was spent. Think twice and take action. I want to keep an account. As an IT person who believes that technology can change the world, I naturally search for various electronic bookbooks online. Online accounting functions cannot be used for fear of harassment). Some stand-alone accounting software does not provide the functions I want.

At the same time, I was looking at SQLite materials when I was empty recently. SQLite is concise and compact, which makes me easy to understand. Therefore, we decided to create a ledger for ourselves and use SQLite as the local data engine.

Function Overview

The accounting function I need is relatively simple:

1. record each consumption and add the required tags. When I view the details, I can know what I bought.

2. For me, there are two types of consumption: 'daily necessities consumed 'and 'Enjoy consumed '. The proportion and amount of the two types of consumption are displayed on a weekly or monthly basis.

Third, you can view your consumption trend in the last six months.

Based on these three requirements, I customized this accounting tool for myself.

Figure 1 shows the startup box of the ledger.

The program starts a working thread to check whether there is a Ledger database under the accounting program path. If not, create the database and the required table structure. At the same time, the timer polls the check results.

Figure 1)

Figure 2 shows the main interface of the ledger.

Many other accounting software divide consumption into catering, transportation, and clothes ...... Or finer. What kind of account should I consider for a long time? The charts produced at the same time are complex but of little significance.

There are only two types of consumption for your account book, corresponding to two big buttons, click to enter the accounting page. The proportion and total amount of these two types of consumption are my monthly concerns.

There are three buttons at the bottom of the main interface, which correspond to 'return to the main interface ', 'Exit the project', and 'view report' respectively '. In any other interface, the three buttons have the same pattern and function.

Figure 2)

Click the green or red button on the main interface to go to the accounting page. 3.

The title, icon, and main colors are different for consumption. This interface is also designed to be simplified, saving the consumption time selection box. The default value is the current record time.

One highlight of this interface is the 'tag selection box '. The labels in the box are dynamically generated. The system displays the 10 most frequently used tags in the last month. Code analysis is also available)

Here, the record tags will appear in the detailed report, which is used for reconciliation.

Figure 3)

Finally, let's take a look at the charts and reports generated by this tool, as shown in figure 4.

The tool can output three types of reports, namely the consumption proportion chart, the consumption trend chart in the last month, and the consumption reconciliation details. For charts, the consumption amount is displayed when you move the cursor over the color block.

These three reports are designed to reduce operations, complexity, and ease of use. Therefore, they only provide the most necessary functions.

Figure 4)

Program Structure

After reading the interface design of the tool, let's take a look at the program structure, as shown in Figure 5.

Figure 5)

The entire Solution mainly consists of three projects.

1. DataAccessLayer. SQLite encapsulates the SQLite access method.

2. ForSingle main program

3. UserControls Custom User Control

Note:

The three buttons at the bottom of all interfaces of this tool are consistent, so I drew an orange box in the BaseForm diagram in UserControls) to let the main interface inherit from BaseForm.

Every other interface is set as UserControl, which controls the creation and display of them in the main program. Marked in green.

SQLite is a good choice for local applications. I use an SQLite engine packaged as An ADO. NET interface. The following links are provided for reference:

My class library: http://sqlite.phxsoftware.com/

SQLite Official Website: http://www.sqlite.org/


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.