Create Application Data Processing Goods

in #science7 years ago

The goods data is included in the master data category ie the core data where the data can be used or called upon when the transaction occurred. This time the discussion of data processing of goods starting from the design form on VB. NET to CRUD (Create, Read, Update, Delete). This is where the data processing occurs, so the user only see the form to input and then stored into the database.

Design Form Data Processing Goods


Back again at Project, open Sales Apikasi Project. Then create a new Form by clicking on PROJECT menu -> Add Window Form and give name Form_Barang.vb after that Click Add. Design the Goods Form as shown below. Or according to your taste.

In the picture above I only use 3 buttons (Save, Cancel, Delete). Someone may ask why there is no Update / Edit button and also Exit button. Here the Save button has two actions namely Save and Update as well. The logic is if the data does not exist yet, then Save new data. If the data already exists, then update the existing data. As for the Exit button in the Goods Form itself is no Close button, so the addition of the exit button is not required.

Next set the Properties on some toolbox in Form_Barang as follows:

The purpose of granting the Properties Name in the Toolbox is to prevent confusion using the toolbox (especially TextBox) and also to make it easier to remember it.

Making Sub on Form Data Processing Goods


Here we will create some sub which will stay called in accordance with its function. Press F7 to switch to the coding screen and at the top of the ODBC data import.

  1. Sub Clean
    To cancel or clean part of Textbox

  2. Sub Show_data
    to display data from database to DataGridView

  3. Sub Autocomplete
    To make a suggestion on TextBox (Text CodeBarang)

  4. Sub Call_All
    To combine all Sub so that later call Sub enough Sub This is just the call

  5. Event Form Load
    Double click on the Form Customer section, then type the following coding

  6. Event KeyPress (Only Number)
    Creating Text Stock, Purchase Price and Selling Price can only be inputted with Figures. The event used is KeyPress

  7. Event KeyDown on the Text CodeBarang
    Aim to fill the existing data in the goods table into another TextBox-TextBox after the Text CodeFar filled and press Enter. This event is created in the Text CodeBarang. Click on the (General) select TKodeBarang, then in the (Declaration) select KeyDown. Type the following coding.

  8. Search Facility
    This search facility may be necessary, especially if the data reaches thousands. Very ineffective if looking for data one by one. This search is placed on the Text CodeBarang, if typing the Goods Code then the data directly sorted in the DataGridView. The Evetn is TextChanged. Double click on the text ID_customer then type the following coding.

  9. DataGridView to TextBox
    When data is clicked on the DataGridView, it will automatically appear on each TextBox. Event used is CellClick. In the (General) section select DGV (DataGridView), then in the (Declaration) section select CellClick. After that type the following coding

  10. Save or Update Data
    Double click the save button then type the following coding.


    Someone may ask why in coding save, Insert or Update using the "?" Sign (question mark)? That is a provision of ODBC, if you use my .net mysqlconnector then it can not use the "?" Question mark, but instead uses the @ character followed by a letter or number character. For example "INSERT INTO VALUES (@ 1, @ 2, @ 3, ....).

  11. Delete data
    Double click the delete button then type the following coding.

  12. Cancellation
    Double Click on the Cancel button then type the following coding.

  13. Determination of Selling Price
    In Text Selling Price will appear automatically with the condition of entering the purchase price first. The selling price is 15% of the purchase price. Double Click on THargaBeli then type the following coding.

Up here the discussion about Data Processing Goods. You do not have to be fixated on Coding above. You can add your own conding creations if the above coding is still lacking in your opinion.


UPVOTE & RESTEEM
FOLLOW ME @muchsin