Process Modules Project

Full Puzzle Game 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 - AdjustStore.vb

 AdjustStore.vb
  1. Public Class AdjustStore
  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 AdjustStoreInstance As AdjustStore
  14.     Public Shared Function GetInstance() As AdjustStore
  15.         If (AdjustStoreInstance Is Nothing) Then
  16.             AdjustStoreInstance = New AdjustStore
  17.         End If
  18.         Return AdjustStoreInstance
  19.     End Function
  20.     Private Sub AdjustStore_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.         LoadSelectedStore()
  28.         Refresher.Enabled = True
  29.     End Sub
  30.     Public Sub LoadSelectedStore()
  31.         LV.Items.Clear()
  32.         Dim SName As String = ""
  33.         Dim SAmount As Double = 0
  34.         Dim SCat As String = ""
  35.         Dim SPurch As Double = 0
  36.         Dim SInter As Double = 0
  37.         Dim Addad As Integer = 0
  38.         For Addad = 0 To My.Computer.FileSystem.GetFiles(StoresPath & "\" & CNameTXT.Text).Count - 1
  39.             SName = My.Computer.FileSystem.GetFileInfo(My.Computer.FileSystem.GetFiles(StoresPath & "\" & CNameTXT.Text).Item(Addad)).Name.Replace(".dat", "")
  40.             'SCat = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\cat.dat", System.Text.Encoding.GetEncoding(0))
  41.             SCat = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\cat.dat", System.Text.Encoding.GetEncoding(0))
  42.             'SPurch = Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\purch.dat", System.Text.Encoding.GetEncoding(0)))
  43.             SPurch = Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\purch.dat", System.Text.Encoding.GetEncoding(0)))
  44.             '.............................
  45.             Dim MyStoreName As String = CNameTXT.Text
  46.             Dim FName As String = ""
  47.             If MyStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\store.dat", System.Text.Encoding.GetEncoding(0)) Then FName = "mount.dat" : GoTo FinishStoreName
  48.             If Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\stores.dat", System.Text.Encoding.GetEncoding(0))) = 0 Then
  49.                 If My.Computer.FileSystem.FileExists(ProductPath & "\" & SName & "\mount0.dat") = True Then
  50.                     If MyStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\store0.dat", System.Text.Encoding.GetEncoding(0)) Then FName = "mount0.dat" : GoTo FinishStoreName
  51.                 End If
  52.             Else
  53.                 Dim SubAddad As Integer = 0
  54.                 For SubAddad = 0 To Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\stores.dat", System.Text.Encoding.GetEncoding(0)))
  55.                     If MyStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\store" & SubAddad & ".dat", System.Text.Encoding.GetEncoding(0)) Then FName = "mount" & SubAddad & ".dat" : GoTo FinishStoreName
  56.                 Next
  57.             End If
  58. FinishStoreName:
  59.             SAmount = Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\" & FName, System.Text.Encoding.GetEncoding(0)))
  60.             '.............................
  61.             Dim InterValue As Double = 0
  62.             Dim TaxValue As Double = 0
  63.             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)
  64.             InterValue = SPurch - Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\price.dat", System.Text.Encoding.GetEncoding(0)))) - (TaxValue)
  65.             SInter = InterValue
  66.             LV.Items.Add(SName)
  67.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(SAmount)
  68.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(SCat)
  69.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(SPurch)
  70.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(SInter)
  71.         Next
  72.         LV.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize)
  73.     End Sub
  74.     Public Sub LoadStores()
  75.         CNameTXT.Items.Clear()
  76.         ToStoresTXT.Items.Clear()
  77.         Dim Addad As Integer = 0
  78.         For Addad = 0 To My.Computer.FileSystem.GetDirectories(StoresPath).Count - 1
  79.             Dim SPath As String = My.Computer.FileSystem.GetDirectories(StoresPath).Item(Addad)
  80.             Dim SName As String = My.Computer.FileSystem.GetDirectoryInfo(My.Computer.FileSystem.GetDirectories(StoresPath).Item(Addad)).Name
  81.             CNameTXT.Items.Add(SName)
  82.             ToStoresTXT.Items.Add(SName)
  83.         Next
  84.         CNameTXT.Text = My.Computer.FileSystem.ReadAllText(DataPath & "\defaultstore.dat", System.Text.Encoding.GetEncoding(0))
  85.         ToStoresTXT.Text = My.Computer.FileSystem.ReadAllText(DataPath & "\defaultstore.dat", System.Text.Encoding.GetEncoding(0))
  86.     End Sub
  87.     Private Sub ProductCancleBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CloseBTN.Click
  88.         ToStoresTXT.Visible = False
  89.         MoveBTN.Visible = False
  90.         StartUp.CloseTabs()
  91.     End Sub
  92.     Private Sub LV_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV.DoubleClick
  93.         LoadProduct()
  94.     End Sub
  95.     Public Sub LoadProduct()
  96.         If LV.SelectedItems.Count > 0 Then
  97.             NewProduct.GetInstance.LoadProduct(LV.FocusedItem.Text)
  98.             StartUp.MainPanel.Controls.Clear()
  99.             StartUp.MainPanel.Controls.Add(NewProduct.GetInstance())
  100.             StartUp.AddNewTab(NewProduct.GetInstance.Tag, NewProduct.GetInstance.Name)
  101.         End If
  102.     End Sub
  103.     Private Sub CNameTXT_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CNameTXT.SelectedIndexChanged
  104.         LoadSelectedStore()
  105.     End Sub
  106.     Private Sub RenameStoreBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RenameStoreBTN.Click
  107.         Dim NewName As String = ""
  108.         NewName = InputBox("إسم المخزن الجديد", "إعادة تسمية المخزن", CNameTXT.Text)
  109.         If NewName <> "" And NewName <> CNameTXT.Text Then
  110.             RenameStore(CNameTXT.Text, NewName)
  111.         End If
  112.     End Sub
  113.     Public Sub RenameStore(ByVal OldName As String, ByVal NewName As String)
  114.         My.Computer.FileSystem.RenameDirectory(StoresPath & "\" & OldName, NewName)
  115.         Dim Addad As Integer = 0
  116.         For Addad = 0 To LV.Items.Count - 1
  117.             Dim MyStoreName As String = CNameTXT.Text
  118.             Dim SName As String = LV.Items.Item(Addad).Text
  119.             Dim FName As String = ""
  120.             If MyStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\store.dat", System.Text.Encoding.GetEncoding(0)) Then FName = "store.dat" : GoTo FinishStoreName
  121.             If Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\stores.dat", System.Text.Encoding.GetEncoding(0))) = 0 Then
  122.                 If My.Computer.FileSystem.FileExists(ProductPath & "\" & SName & "\store0.dat") = True Then
  123.                     If MyStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\store0.dat", System.Text.Encoding.GetEncoding(0)) Then FName = "store0.dat" : GoTo FinishStoreName
  124.                 End If
  125.             Else
  126.                 Dim SubAddad As Integer = 0
  127.                 For SubAddad = 0 To Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\stores.dat", System.Text.Encoding.GetEncoding(0)))
  128.                     If MyStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & SName & "\store" & SubAddad & ".dat", System.Text.Encoding.GetEncoding(0)) Then FName = "store" & SubAddad & ".dat" : GoTo FinishStoreName
  129.                 Next
  130.             End If
  131. FinishStoreName:
  132.             My.Computer.FileSystem.WriteAllText(ProductPath & "\" & SName & "\" & FName, NewName, False, System.Text.Encoding.GetEncoding(0))
  133.         Next
  134.         LoadStores()
  135.         CNameTXT.SelectedItem = NewName
  136.         LoadSelectedStore()
  137.     End Sub
  138.     Private Sub LV_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV.GotFocus
  139.         ToStoresTXT.Visible = True
  140.         MoveBTN.Visible = True
  141.         MoveLBL.Visible = True
  142.     End Sub
  143.     Private Sub MoveBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MoveBTN.Click
  144.         Dim PName As String = ""
  145.         Dim PAmount As Double = 0
  146.         Dim SStoreName As String = CNameTXT.Text
  147.         Dim SName As String = ""
  148.         Dim SAName As String = ""
  149.         Dim SUName As String = ""
  150.         Dim TStoreName As String = ToStoresTXT.Text
  151.         Dim TName As String = ""
  152.         Dim TAName As String = ""
  153.         Dim TUName As String = ""
  154.         Dim TAddad As Integer = 0
  155.         If CNameTXT.Text <> ToStoresTXT.Text Then
  156.             PName = LV.FocusedItem.Text
  157.             PAmount = Val(InputBox("الكمية التي ترغب بنقلها :", "نقل " & PName & " من مخزن " & CNameTXT.Text & " - إلى مخزن " & ToStoresTXT.Text, "0"))
  158.             If PAmount <> 0 And PAmount <> Nothing And PAmount <= Val(LV.FocusedItem.SubItems(1).Text) Then
  159.                 'Special Target Store Product :
  160.                 If SStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\store.dat", System.Text.Encoding.GetEncoding(0)) Then
  161.                     SName = "store.dat"
  162.                     SAName = "mount.dat"
  163.                     SUName = "unit.dat"
  164.                     GoTo FirsStepFinished
  165.                 End If
  166.                 If Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\stores.dat", System.Text.Encoding.GetEncoding(0))) = 0 Then
  167.                     If My.Computer.FileSystem.FileExists(ProductPath & "\" & PName & "\mount0.dat") = True Then
  168.                         If SStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\store0.dat", System.Text.Encoding.GetEncoding(0)) Then
  169.                             SName = "store0.dat"
  170.                             SAName = "mount0.dat"
  171.                             SUName = "unit0.dat"
  172.                             GoTo FirsStepFinished
  173.                         End If
  174.                     End If
  175.                 Else
  176.                     Dim SubAddad As Integer = 0
  177.                     For SubAddad = 0 To Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\stores.dat", System.Text.Encoding.GetEncoding(0)))
  178.                         If SStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\store" & SubAddad & ".dat", System.Text.Encoding.GetEncoding(0)) Then
  179.                             SName = "store" & SubAddad & ".dat"
  180.                             SAName = "mount" & SubAddad & ".dat"
  181.                             SUName = "unit" & SubAddad & ".dat"
  182.                             GoTo FirsStepFinished
  183.                         End If
  184.                     Next
  185.                 End If
  186.                 ';;;;;;;;;;;;;;;;;;;;;;;;;;
  187.                 'Source Store not contains product
  188.                 ';;;;;;;;;;;;;;;;;;;;;;;;;;
  189. FirsStepFinished:
  190.                 'Special Target Store Product :
  191.                 If TStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\store.dat", System.Text.Encoding.GetEncoding(0)) Then
  192.                     TName = "store.dat"
  193.                     TAName = "mount.dat"
  194.                     TUName = "unit.dat"
  195.                     TAddad = 0
  196.                     GoTo Finish
  197.                 End If
  198.                 If Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\stores.dat", System.Text.Encoding.GetEncoding(0))) = 0 Then
  199.                     If My.Computer.FileSystem.FileExists(ProductPath & "\" & PName & "\mount0.dat") = True Then
  200.                         If TStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\store0.dat", System.Text.Encoding.GetEncoding(0)) Then
  201.                             TName = "store0.dat"
  202.                             TAName = "mount0.dat"
  203.                             TUName = "unit0.dat"
  204.                             TAddad = 1
  205.                             GoTo Finish
  206.                         End If
  207.                     End If
  208.                 Else
  209.                     Dim SubAddad As Integer = 0
  210.                     For SubAddad = 0 To Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\stores.dat", System.Text.Encoding.GetEncoding(0)))
  211.                         If TStoreName = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\store" & SubAddad & ".dat", System.Text.Encoding.GetEncoding(0)) Then
  212.                             TName = "store" & SubAddad & ".dat"
  213.                             TAName = "mount" & SubAddad & ".dat"
  214.                             TUName = "unit" & SubAddad & ".dat"
  215.                             TAddad = Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\stores.dat", System.Text.Encoding.GetEncoding(0))) + 1
  216.                             GoTo Finish
  217.                         End If
  218.                     Next
  219.                 End If
  220.                 ';;;;;;;;;;;;;;;;;;;;;;;;;;
  221.                 'Target Store not contains product
  222.                 ';;;;;;;;;;;;;;;;;;;;;;;;;;
  223.                 My.Computer.FileSystem.WriteAllText(StoresPath & "\" & TStoreName & "\" & PName & ".dat", "0", False, System.Text.Encoding.GetEncoding(0))
  224.                 TName = "store" & TAddad & ".dat"
  225.                 TAName = "mount" & TAddad & ".dat"
  226.                 My.Computer.FileSystem.WriteAllText(ProductPath & "\" & PName & "\stores.dat", TAddad, False, System.Text.Encoding.GetEncoding(0))
  227.                 My.Computer.FileSystem.WriteAllText(ProductPath & "\" & PName & "\store" & TAddad & ".dat", TStoreName, False, System.Text.Encoding.GetEncoding(0))
  228.                 My.Computer.FileSystem.WriteAllText(ProductPath & "\" & PName & "\mount" & TAddad & ".dat", 0, False, System.Text.Encoding.GetEncoding(0))
  229.                 My.Computer.FileSystem.WriteAllText(ProductPath & "\" & PName & "\unit" & TAddad & ".dat", Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\" & SUName, System.Text.Encoding.GetEncoding(0))), False, System.Text.Encoding.GetEncoding(0))
  230. Finish:
  231.                 Dim LastAmount As Double = 0
  232.                 LastAmount = Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\" & SAName, System.Text.Encoding.GetEncoding(0)))
  233.                 LastAmount = LastAmount - PAmount
  234.                 My.Computer.FileSystem.WriteAllText(ProductPath & "\" & PName & "\" & SAName, LastAmount, False, System.Text.Encoding.GetEncoding(0))
  235.                 LastAmount = Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\" & TAName, System.Text.Encoding.GetEncoding(0)))
  236.                 LastAmount = LastAmount + PAmount
  237.                 My.Computer.FileSystem.WriteAllText(ProductPath & "\" & PName & "\" & TAName, LastAmount, False, System.Text.Encoding.GetEncoding(0))
  238.                 ToStoresTXT.Visible = False
  239.                 MoveBTN.Visible = False
  240.                 MoveLBL.Visible = False
  241.                 LoadSelectedStore()
  242.             End If
  243.         End If
  244.     End Sub
  245.     Private Sub Refresher_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Refresher.Tick
  246.         LoadSelectedStore()
  247.     End Sub
  248. 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.