Create Application Data Processing Goods
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.
Sub Clean
To cancel or clean part of Textbox
Sub Show_data
to display data from database to DataGridView
Sub Autocomplete
To make a suggestion on TextBox (Text CodeBarang)
Sub Call_All
To combine all Sub so that later call Sub enough Sub This is just the call
Event Form Load
Double click on the Form Customer section, then type the following coding
Event KeyPress (Only Number)
Creating Text Stock, Purchase Price and Selling Price can only be inputted with Figures. The event used is KeyPress
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.
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.
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
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, ....).Delete data
Double click the delete button then type the following coding.
Cancellation
Double Click on the Cancel button then type the following coding.
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