Birthdate for C # financial data number

Source: Internet
Author: User

Implementation logic:

6-bit data Number = Receipt Number (010+000001=010000001) generated according to the front-stamp of the ticket

VOID ticket

Void the ticket number and insert it into the numbered table to be used next time

VOID ticket Use

The number table is now only 2, and when I void 1, there are 1 2 values in the table.

If I have an invalid number of 010000001, I insert a value of 1 in my table, so I will take the minimum value when I use it next time, and when I generate it, I'll delete the invalid number of this strip and keep only one in the numbered list.

  String sql = "SELECT COUNT (num) from F_za_code";            String codes = "";            Object i = sqlhelper.executescalartext (sql, NULL);            if (int. Parse (i.ToString ()) > 1)            {                string drs = "Select Lpad (num), 6,0) from F_za_code";                Mysqldatareader dr = Sqlhelper.executereadertext (DRS, NULL);                while (Dr. Read ())                {                    codes = dr[0]. ToString ();                }            }            else             {                string drs = "Select Lpad (num,6,0) from F_za_code";                Mysqldatareader dr = Sqlhelper.executereadertext (DRS, NULL);                while (Dr. Read ())                {                    codes = dr[0]. ToString ();                }            }            return codes;

  

Birthdate for C # financial data number

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.