Process Modules Project

Process Modules Project source code and complete project in "Process Modules and ProcessName Collecter" e-learning section.
Coded by: Wesam Naffaa

Puzzle Game project

Full Puzzle Game source code and complete project in "Puzzle Game project" e-learning section.
NOTE: You must read "Puzzle Game - Resources" to understand how to apply the sources & codes to your side.
Coded by: Wesam Naffaa

Accounting Manager project

Full Accounting manager source code and complete project in "Universal Accounting Manager project" e-learning section.
NOTE: You must read "Universal Accounting Manager - Resources" to understand how to apply the sources & codes to your side.
Coded by: Wesam Naffaa

File encryption project

Full File encryption center source code and complete project in "File encryption center project" e-learning section.
NOTE: You must read "File encryption center - Resources" to understand how to apply the sources & codes to your side.
Coded by: Wesam Naffaa

Universal Accounting Manager - StoreCat.vb

StoreCat.vb
  1. Public Class StoreCat
  2.     Dim ProgramName As String = My.Application.Info.AssemblyName
  3.     Dim DataPath As String = System.Environment.CurrentDirectory & "\UAM"
  4.     Dim ProductPath As String = DataPath & "\Products" '
  5.     Dim ServicesPath As String = DataPath & "\Services"
  6.     Dim CatPath As String = DataPath & "\Categories"
  7.     Dim StoresPath As String = DataPath & "\Stores"
  8.     Dim CustomersPath As String = DataPath & "\Customers"
  9.     Dim CompanyPath As String = DataPath & "\Company"
  10.     Dim MovmentPath As String = DataPath & "\Movment"
  11.     Dim RequestsPath As String = DataPath & "\Requests"
  12.     Dim VendorsPath As String = DataPath & "\Vendors"
  13.     Private Shared StoreCatInstance As StoreCat
  14.     Public Shared Function GetInstance() As StoreCat
  15.         If (StoreCatInstance Is Nothing) Then
  16.             StoreCatInstance = New StoreCat
  17.         End If
  18.         Return StoreCatInstance
  19.     End Function
  20.     Private Sub StoreCat_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  21.         LV.Columns.Add("إسم السلعة \ المنتج")
  22.         LV.Columns.Add("الكمية")
  23.         LV.Columns.Add("الكمية المباعة")
  24.         LV.Columns.Add("سعر المبيع")
  25.         LV.Columns.Add("ربح القطعة")
  26.         LoadStores()
  27.         LoadCats()
  28.         LoadSelectedStore()
  29.         Refresher.Enabled = True
  30.     End Sub
  31.     Public Sub LoadStores()
  32.         On Error Resume Next
  33.         CNameTXT.Items.Clear()
  34.         Dim Addad As Integer = 0
  35.         For Addad = 0 To My.Computer.FileSystem.GetDirectories(StoresPath).Count - 1
  36.             Dim SPath As String = My.Computer.FileSystem.GetDirectories(StoresPath).Item(Addad)
  37.             Dim SName As String = My.Computer.FileSystem.GetDirectoryInfo(My.Computer.FileSystem.GetDirectories(StoresPath).Item(Addad)).Name
  38.             CNameTXT.Items.Add(SName)
  39.         Next
  40.         CNameTXT.Text = My.Computer.FileSystem.ReadAllText(DataPath & "\defaultstore.dat", System.Text.Encoding.GetEncoding(0))
  41.     End Sub
  42.     Public Sub LoadCats()
  43.         On Error Resume Next
  44.         CatNameTXT.Items.Clear()
  45.         Dim Addad As Integer = 0
  46.         For Addad = 0 To My.Computer.FileSystem.GetFiles(CatPath).Count - 1
  47.             Dim SPath As String = My.Computer.FileSystem.GetFiles(CatPath).Item(Addad)
  48.             Dim SName As String = My.Computer.FileSystem.GetFileInfo(My.Computer.FileSystem.GetFiles(CatPath).Item(Addad)).Name.Replace(".dat", "")
  49.             CatNameTXT.Items.Add(SName)
  50.             ToStoresTXT.Items.Add(SName)
  51.         Next
  52.         CatNameTXT.SelectedIndex = 0
  53.         ToStoresTXT.SelectedIndex = 0
  54.     End Sub
  55.     Public Sub LoadProduct()
  56.         If LV.SelectedItems.Count > 0 Then
  57.             NewProduct.GetInstance.LoadProduct(LV.FocusedItem.Text)
  58.             StartUp.MainPanel.Controls.Clear()
  59.             StartUp.MainPanel.Controls.Add(NewProduct.GetInstance())
  60.             StartUp.AddNewTab(NewProduct.GetInstance.Tag, NewProduct.GetInstance.Name)
  61.         End If
  62.     End Sub
  63.     Private Sub LV_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV.DoubleClick
  64.         LoadProduct()
  65.     End Sub
  66.     Public Sub LoadSelectedStore()
  67.         On Error Resume Next
  68.         LV.Items.Clear()
  69.         Dim SName As String = ""
  70.         Dim SAmount As Double = 0
  71.         Dim SSold As String = ""
  72.         Dim SPurch As Double = 0
  73.         Dim SInter As Double = 0
  74.         Dim Addad As Integer = 0
  75.         Dim MyArr() As String = {""}
  76.         MyArr = System.IO.File.ReadAllLines(CatPath & "\" & CatNameTXT.Text & ".dat", System.Text.Encoding.GetEncoding(0))
  77.         LV.Items.Clear()
  78.         For Addad = 0 To MyArr.Length - 1
  79.             SName = MyArr(Addad)
  80.             SSold = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\sold.dat", System.Text.Encoding.GetEncoding(0))
  81.             SPurch = Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\purch.dat", System.Text.Encoding.GetEncoding(0)))
  82.             '.............................
  83.             Dim MyStoreName As String = CNameTXT.Text
  84.             Dim FName As String = ""
  85.             If MyStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\store.dat", System.Text.Encoding.GetEncoding(0)) Then FName = "mount.dat" : GoTo FinishStoreName
  86.             If Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\stores.dat", System.Text.Encoding.GetEncoding(0))) = 0 Then
  87.                 If My.Computer.FileSystem.FileExists(ProductPath & "\" & SName & "\mount0.dat") = True Then
  88.                     If MyStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\store0.dat", System.Text.Encoding.GetEncoding(0)) Then FName = "mount0.dat" : GoTo FinishStoreName
  89.                 End If
  90.             Else
  91.                 Dim SubAddad As Integer = 0
  92.                 For SubAddad = 0 To Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\stores.dat", System.Text.Encoding.GetEncoding(0)))
  93.                     If MyStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\store" & SubAddad & ".dat", System.Text.Encoding.GetEncoding(0)) Then FName = "mount" & SubAddad & ".dat" : GoTo FinishStoreName
  94.                 Next
  95.             End If
  96.             SAmount = 0
  97.             GoTo NextStep
  98. FinishStoreName:
  99.             SAmount = Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\" & FName, System.Text.Encoding.GetEncoding(0)))
  100. NextStep:
  101.             '.............................
  102.             Dim InterValue As Double = 0
  103.             Dim TaxValue As Double = 0
  104.             TaxValue = Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\price.dat", System.Text.Encoding.GetEncoding(0))) * Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\maintax.dat", System.Text.Encoding.GetEncoding(0))) / 100) + Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\price.dat", System.Text.Encoding.GetEncoding(0))) * Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\subtax.dat", System.Text.Encoding.GetEncoding(0))) / 100)
  105.             InterValue = SPurch - Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\price.dat", System.Text.Encoding.GetEncoding(0)))) - (TaxValue)
  106.             SInter = InterValue
  107.             LV.Items.Add(SName)
  108.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(SAmount)
  109.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(SSold)
  110.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(SPurch)
  111.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(SInter)
  112.         Next
  113.         LV.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize)
  114.     End Sub
  115.     Private Sub CNameTXT_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CNameTXT.SelectedIndexChanged
  116.         LoadSelectedStore()
  117.     End Sub
  118.     Private Sub CatNameTXT_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CatNameTXT.SelectedIndexChanged
  119.         LoadSelectedStore()
  120.     End Sub
  121.     Public Sub RenameCat(ByVal OldName As String, ByVal NewName As String)
  122.         My.Computer.FileSystem.RenameFile(CatPath & "\" & OldName & ".dat", NewName & ".dat")
  123.         Dim Addad As Integer = 0
  124.         For Addad = 0 To LV.Items.Count - 1
  125.             Dim SName As String = LV.Items.Item(Addad).Text
  126.             My.Computer.FileSystem.WriteAllText(ProductPath & "\" & SName & "\cat.dat", NewName, False, System.Text.Encoding.GetEncoding(0))
  127.         Next
  128.         LoadStores()
  129.         LoadCats()
  130.         CatNameTXT.SelectedItem = NewName
  131.         LoadSelectedStore()
  132.     End Sub
  133.     Private Sub RenameStoreBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RenameStoreBTN.Click
  134.         Dim NewName As String = ""
  135.         NewName = InputBox("إسم التصنيف الجديد", "إعادة تسمية التصنيف", CatNameTXT.Text)
  136.         If NewName <> "" And NewName <> CNameTXT.Text Then
  137.             RenameCat(CatNameTXT.Text, NewName)
  138.         End If
  139.     End Sub
  140.     Private Sub LV_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV.GotFocus
  141.         ToStoresTXT.Visible = True
  142.         MoveBTN.Visible = True
  143.     End Sub
  144.     Public Sub MoveCat()
  145.         If CatNameTXT.Text <> CatNameTXT.Text Then
  146.             Dim PName As String = ""
  147.             PName = LV.FocusedItem.Text
  148.             My.Computer.FileSystem.WriteAllText(ProductPath & "\" & PName & "\cat.dat", ToStoresTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  149.             Dim LastCatReader As String = ""
  150.             LastCatReader = My.Computer.FileSystem.ReadAllText(CatPath & "\" & CatNameTXT.Text & ".dat", System.Text.Encoding.GetEncoding(0))
  151.             LastCatReader = LastCatReader.Replace(PName & System.Environment.NewLine, "")
  152.             My.Computer.FileSystem.WriteAllText(CatPath & "\" & CatNameTXT.Text & ".dat", LastCatReader, False, System.Text.Encoding.GetEncoding(0))
  153.             My.Computer.FileSystem.WriteAllText(CatPath & "\" & ToStoresTXT.Text & ".dat", PName & System.Environment.NewLine, True, System.Text.Encoding.GetEncoding(0))
  154.             LoadSelectedStore()
  155.         End If
  156.     End Sub
  157.     Private Sub MoveBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MoveBTN.Click
  158.         MoveCat()
  159.     End Sub
  160.     Private Sub ProductCancleBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProductCancleBTN.Click
  161.         ToStoresTXT.Visible = False
  162.         MoveBTN.Visible = False
  163.         StartUp.CloseTabs()
  164.     End Sub
  165.     Private Sub Refresher_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Refresher.Tick
  166.         LoadSelectedStore()
  167.     End Sub
  168. End Class

Valuable E-Book

Hello,
Baby first step is a friendly flashcards offering a growing collection of creative and educational ideas to help the toddler to learn the alphabet, so I put images that would be attractive to babies.

Support independent publishing: Buy this e-book on Lulu.