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 - Setting.vb

Setting.vb
  1. Public Class Setting
  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.     Dim BoxPath As String = DataPath & "\Box"
  14.     Dim AlertsPath As String = DataPath & "\Alerts"
  15.     Dim SettingsPath As String = DataPath & "\Settings"
  16.     Dim AddToVindorBoolean As Boolean = False
  17.     Private Shared SettingInstance As Setting
  18.     Public Shared Function GetInstance() As Setting
  19.         If (SettingInstance Is Nothing) Then
  20.             SettingInstance = New Setting
  21.         End If
  22.         Return SettingInstance
  23.     End Function
  24.     Public Sub TestText()
  25.         'test values to add errors to Alerts :
  26.         Dim PName As String = "الإعدادات"
  27.         Dim WDir As String = ""
  28.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  29.         If CNameTXT.Text = "" Then
  30.             StartUp.AlertsWriter(PName, "نقص في " & PName & " , أدخل إسم شركتك الآن", "S-name")
  31.         Else
  32.             WDir = AlertsPath & "\" & PName & "\S-name"
  33.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  34.         End If
  35.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  36.         If CAddressTXT.Text = "" Then
  37.             StartUp.AlertsWriter(PName, "نقص في " & PName & " , أدخل عنوان شركتك الآن", "S-address")
  38.         Else
  39.             WDir = AlertsPath & "\" & PName & "\S-address"
  40.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  41.         End If
  42.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  43.         If CTelTXT.Text = "" Then
  44.             StartUp.AlertsWriter(PName, "نقص في " & PName & " , أدخل رقم هاتف شركتك الآن", "S-tel")
  45.         Else
  46.             WDir = AlertsPath & "\" & PName & "\S-tel"
  47.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  48.         End If
  49.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  50.         If FooterTXT.Text = "" Then
  51.             StartUp.AlertsWriter(PName, "نقص في " & PName & " , أدخل تذييل فواتيرك الآن", "S-footer")
  52.         Else
  53.             WDir = AlertsPath & "\" & PName & "\S-footer"
  54.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  55.         End If
  56.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  57.         If MainCurrencyTXT.Text = "" Then
  58.             StartUp.AlertsWriter(PName, "نقص في " & PName & " , أدخل عملة التداول الآن", "S-carrency")
  59.         Else
  60.             WDir = AlertsPath & "\" & PName & "\S-carrency"
  61.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  62.         End If
  63.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  64.         StartUp.LoadAlerts()
  65.     End Sub
  66.     Private Sub Setting_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  67.         SFD.InitialDirectory = "c:\"
  68.         SFD.Title = "حفظ نسخة من البيانات"
  69.         SFD.Filter = "Data files (*.dat)|*.dat"
  70.         SFD.FileName = Date.Now.Year & "-" & Date.Now.Month & "-" & Date.Now.Day & " " & Date.Now.Hour & Date.Now.Minute
  71.         RestDialog.Multiselect = False
  72.         RestDialog.InitialDirectory = "c:\"
  73.         RestDialog.Title = "إستعادة نسخة إحتياطية من البيانات"
  74.         RestDialog.Filter = "Data files (*.dat)|*.dat"
  75.         RestDialog.FileName = Date.Now.Year & "-" & Date.Now.Month & "-" & Date.Now.Day
  76.         OFD.Multiselect = False
  77.         OFD.InitialDirectory = "c:\"
  78.         OFD.Title = "إنتقاء صورة للمنتج"
  79.         OFD.Filter = "jpg files (*.jpg)|*.jpg|bmp files (*.bmp)|*.bmp|png files (*.png)|*.png"
  80.         LoadSettings()
  81.     End Sub
  82.     Private Sub ProductCancleBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProductCancleBTN.Click
  83.         StartUp.CloseTabs()
  84.     End Sub
  85.     Public Sub LoadSettings()
  86.         On Error Resume Next
  87.         Dim MainCName As String = ""
  88.         Dim SubCName As String = ""
  89.         MainCName = My.Computer.FileSystem.ReadAllText(SettingsPath & "\maincurrency.dat", System.Text.Encoding.GetEncoding(0))
  90.         MainCurrencyTXT.Text = MainCName
  91.         'If My.Computer.FileSystem.FileExists(SettingsPath & "\subcurrency.dat") = True Then
  92.         'SubCName = My.Computer.FileSystem.ReadAllText(SettingsPath & "\subcurrency.dat", System.Text.Encoding.GetEncoding(0))
  93.         'SubCurrencyTXT.Text = SubCName
  94.         'EveryLBL.Text = "كل 1 " & SubCName & " ="
  95.         'EqualTXT.Text = My.Computer.FileSystem.ReadAllText(SettingsPath & "\equal.dat", System.Text.Encoding.GetEncoding(0))
  96.         'SCNameLBL.Text = MainCName
  97.         'End If
  98.         PSizeTXT.Text = My.Computer.FileSystem.ReadAllText(SettingsPath & "\psize.dat", System.Text.Encoding.GetEncoding(0))
  99.         FooterTXT.Text = My.Computer.FileSystem.ReadAllText(SettingsPath & "\footer.dat", System.Text.Encoding.GetEncoding(0))
  100.         CNameTXT.Text = My.Computer.FileSystem.ReadAllText(CompanyPath & "\name.dat", System.Text.Encoding.GetEncoding(0))
  101.         CAddressTXT.Text = My.Computer.FileSystem.ReadAllText(CompanyPath & "\address.dat", System.Text.Encoding.GetEncoding(0))
  102.         CTelTXT.Text = My.Computer.FileSystem.ReadAllText(CompanyPath & "\tel.dat", System.Text.Encoding.GetEncoding(0))
  103.         CLogoPIC.Image = System.Drawing.Bitmap.FromFile(CompanyPath & "\img.pic")
  104.         PlaceRentTXT.Text = My.Computer.FileSystem.ReadAllText(CompanyPath & "\placerent.dat", System.Text.Encoding.GetEncoding(0))
  105.         ELCRentTXT.Text = My.Computer.FileSystem.ReadAllText(CompanyPath & "\electricity.dat", System.Text.Encoding.GetEncoding(0))
  106.         WRentTXT.Text = My.Computer.FileSystem.ReadAllText(CompanyPath & "\water.dat", System.Text.Encoding.GetEncoding(0))
  107.         WorkerTXT.Text = My.Computer.FileSystem.ReadAllText(CompanyPath & "\workerrent.dat", System.Text.Encoding.GetEncoding(0))
  108.     End Sub
  109.     Public Sub SaveChanges()
  110.         My.Computer.FileSystem.WriteAllText(SettingsPath & "\maincurrency.dat", MainCurrencyTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  111.         'If SubCurrencyTXT.Text <> "-" Then
  112.         'My.Computer.FileSystem.WriteAllText(SettingsPath & "\subcurrency.dat", SubCurrencyTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  113.         'My.Computer.FileSystem.WriteAllText(SettingsPath & "\equal.dat", EqualTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  114.         'End If
  115.         My.Computer.FileSystem.WriteAllText(SettingsPath & "\psize.dat", PSizeTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  116.         My.Computer.FileSystem.WriteAllText(SettingsPath & "\footer.dat", FooterTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  117.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\name.dat", CNameTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  118.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\address.dat", CAddressTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  119.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\tel.dat", CTelTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  120.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\placerent.dat", PlaceRentTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  121.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\electricity.dat", ELCRentTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  122.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\water.dat", WRentTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  123.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\workerrent.dat", WorkerTXT.Text, False, System.Text.Encoding.GetEncoding(0))
  124.     End Sub
  125.     Private Sub ProductShowBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ProductShowBTN.Click
  126.         SaveChanges()
  127.         TestText()
  128.         StartUp.CloseTabs()
  129.     End Sub
  130.     Private Sub SubCurrencyTXT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
  131.         'If SubCurrencyTXT.Text <> "-" Then
  132.         'EveryLBL.Visible = True
  133.         'EqualTXT.Visible = True
  134.         'SCNameLBL.Visible = True
  135.         'EveryLBL.Text = "كل 1 " & SubCurrencyTXT.Text & " ="
  136.         'SCNameLBL.Text = MainCurrencyTXT.Text
  137.         'End If
  138.     End Sub
  139.     Private Sub MainCurrencyTXT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MainCurrencyTXT.TextChanged
  140.         'SCNameLBL.Text = MainCurrencyTXT.Text
  141.     End Sub
  142.     Private Sub OFD_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OFD.FileOk
  143.         On Error Resume Next
  144.         ClearBTN_Click(sender, e)
  145.         My.Computer.FileSystem.CopyFile(OFD.FileName, CompanyPath & "\img.pic", True)
  146.         CLogoPIC.Image = System.Drawing.Bitmap.FromFile(CompanyPath & "\img.pic")
  147.     End Sub
  148.     Private Sub ClearBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearBTN.Click
  149.         On Error Resume Next
  150.         CLogoPIC.Image = Nothing
  151.         CLogoPIC.Refresh()
  152.         Dim TryNum As Integer = 0
  153.         If My.Computer.FileSystem.FileExists(CompanyPath & "\img.pic") = False Then GoTo Finish
  154. Retry:
  155.         System.IO.File.SetAttributes(CompanyPath & "\img.pic", IO.FileAttributes.Normal)
  156.         System.IO.File.Delete(CompanyPath & "\img.pic")
  157.         If My.Computer.FileSystem.FileExists(CompanyPath & "\img.pic") = True And TryNum < 100 Then TryNum += 1 : GoTo Retry Else MsgBox("لا يمكن التعامل مع الصورة حالياً أعد المحاولة بعد قليل")
  158. Finish:
  159.     End Sub
  160.     Private Sub BrowseBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BrowseBTN.Click
  161.         OFD.ShowDialog()
  162.     End Sub
  163.     Private Sub CleanDataBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CleanDataBTN.Click
  164.         If MsgBox("هل أنت متأكد من رغبتك بمسح جميع بيانات البرنامج بما فيها بيانانك الخاصة", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
  165.             DeleteAllData()
  166.         End If
  167.     End Sub
  168.     Public Sub DeleteAllData()
  169.         On Error Resume Next
  170.         'Deleting Alerts:
  171.         System.IO.Directory.Delete(AlertsPath, True)
  172.         My.Computer.FileSystem.CreateDirectory(AlertsPath)
  173.         'Zeroing Box :
  174.         System.IO.Directory.Delete(BoxPath, True)
  175.         My.Computer.FileSystem.CreateDirectory(BoxPath)
  176.         '
  177.         System.IO.Directory.Delete(CatPath, True)
  178.         My.Computer.FileSystem.CreateDirectory(CatPath)
  179.         '
  180.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\address.dat", "", False, System.Text.Encoding.GetEncoding(0))
  181.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\electricity.dat", "", False, System.Text.Encoding.GetEncoding(0))
  182.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\name.dat", "", False, System.Text.Encoding.GetEncoding(0))
  183.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\placerent.dat", "", False, System.Text.Encoding.GetEncoding(0))
  184.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\tel.dat", "", False, System.Text.Encoding.GetEncoding(0))
  185.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\water.dat", "", False, System.Text.Encoding.GetEncoding(0))
  186.         My.Computer.FileSystem.WriteAllText(CompanyPath & "\workerrent.dat", "", False, System.Text.Encoding.GetEncoding(0))
  187.         System.IO.File.Delete(CompanyPath & "\img.pic")
  188.         '
  189.         System.IO.Directory.Delete(CustomersPath, True)
  190.         My.Computer.FileSystem.CreateDirectory(CustomersPath)
  191.         '
  192.         System.IO.Directory.Delete(MovmentPath, True)
  193.         My.Computer.FileSystem.CreateDirectory(MovmentPath)
  194.         '
  195.         System.IO.Directory.Delete(ProductPath, True)
  196.         My.Computer.FileSystem.CreateDirectory(ProductPath)
  197.         '
  198.         System.IO.Directory.Delete(RequestsPath, True)
  199.         My.Computer.FileSystem.CreateDirectory(RequestsPath)
  200.         '
  201.         System.IO.Directory.Delete(ServicesPath, True)
  202.         My.Computer.FileSystem.CreateDirectory(ServicesPath)
  203.         '
  204.         System.IO.Directory.Delete(ServicesPath, True)
  205.         My.Computer.FileSystem.CreateDirectory(ServicesPath)
  206.         '
  207.         My.Computer.FileSystem.WriteAllText(SettingsPath & "\equal.dat", "", False, System.Text.Encoding.GetEncoding(0))
  208.         My.Computer.FileSystem.WriteAllText(SettingsPath & "\footer.dat", "", False, System.Text.Encoding.GetEncoding(0))
  209.         My.Computer.FileSystem.WriteAllText(SettingsPath & "\maincurrency.dat", "", False, System.Text.Encoding.GetEncoding(0))
  210.         My.Computer.FileSystem.WriteAllText(SettingsPath & "\psize.dat", "", False, System.Text.Encoding.GetEncoding(0))
  211.         My.Computer.FileSystem.WriteAllText(SettingsPath & "\subcurrency.dat", "", False, System.Text.Encoding.GetEncoding(0))
  212.         '
  213.         System.IO.Directory.Delete(StoresPath, True)
  214.         My.Computer.FileSystem.CreateDirectory(StoresPath)
  215.         '
  216.         System.IO.Directory.Delete(VendorsPath, True)
  217.         My.Computer.FileSystem.CreateDirectory(VendorsPath)
  218.         '
  219.         My.Computer.FileSystem.WriteAllText(DataPath & "\defaultstore.dat", "", False, System.Text.Encoding.GetEncoding(0))
  220.         Windows.Forms.Application.Restart()
  221.     End Sub
  222.     Private Sub SFD_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SFD.FileOk
  223.         My.Computer.FileSystem.WriteAllText(SFD.FileName, Date.Now.Year & Date.Now.Month & Date.Now.Day & Date.Now.Hour & Date.Now.Minute, False, System.Text.Encoding.GetEncoding(0))
  224.         My.Computer.FileSystem.CopyDirectory(DataPath, System.Environment.GetFolderPath(Environment.SpecialFolder.System) & "\uam backup\" & Date.Now.Year & Date.Now.Month & Date.Now.Day & Date.Now.Hour & Date.Now.Minute, FileIO.UIOption.AllDialogs, FileIO.UICancelOption.DoNothing)
  225.         MsgBox("لقد تم إعداد نسخة إحتياطية من بياناتك بنجاح")
  226.     End Sub
  227.     Private Sub SaveDataBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveDataBTN.Click
  228.         SFD.ShowDialog()
  229.     End Sub
  230.     Private Sub RestDataBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RestDataBTN.Click
  231.         RestDialog.ShowDialog()
  232.     End Sub
  233.     Private Sub RestDialog_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles RestDialog.FileOk
  234.         On Error Resume Next
  235.         Dim Reader As String = My.Computer.FileSystem.ReadAllText(RestDialog.FileName, System.Text.Encoding.GetEncoding(0))
  236.         Dim TargetData = System.Environment.GetFolderPath(Environment.SpecialFolder.System) & "\uam backup\" & Reader
  237.         If My.Computer.FileSystem.DirectoryExists(TargetData) = True Then
  238.             System.IO.Directory.Delete(DataPath, True)
  239.             My.Computer.FileSystem.CreateDirectory(DataPath)
  240.             My.Computer.FileSystem.CopyDirectory(TargetData, DataPath, True)
  241.         End If
  242.         MsgBox("لقد تمت إستعادة بياناتك بنجاح")
  243.         Windows.Forms.Application.Restart()
  244.     End Sub
  245. 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.