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

 StartUp.vb
  1. Public Class StartUp
  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 BoxPath As String = DataPath & "\Box"
  13.     Dim AlertsPath As String = DataPath & "\Alerts"
  14.     Dim SettingsPath As String = DataPath & "\Settings"
  15.     Dim SenderName As Object
  16.     Dim TabCount As Integer = 0
  17.     Dim SelectedTab As String = ""
  18.     Private Sub StartUp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
  19.         MainView.GetInstance.HideSubPic()
  20.         If All.GetInstance.Visible = True Then
  21.             OpenNewTab(All.GetInstance)
  22.             CloseTabs()
  23.         End If
  24.     End Sub
  25.     Private Sub StartUp_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
  26.         e.Cancel = True
  27.         Me.Hide()
  28.     End Sub
  29.     Private Sub StartUp_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  30.         'Me.MaximizeBox = False
  31.         Me.Text = ProgramName & " " & My.Application.Info.Version.Major.ToString & " Update " & My.Application.Info.Version.Minor.ToString
  32.         MainPanel.Controls.Add(LoadingSaving.GetInstance())
  33.         AddNewTab(LoadingSaving.GetInstance.Tag, MainView.GetInstance.Name)
  34.         If Me.Text = "نسخة مسروقة" Then GoTo StealPoint
  35.         TestDate()
  36.         AddHandler ButtonPIC.MouseEnter, AddressOf PicMouseEnter
  37.         AddHandler ButtonPIC.MouseLeave, AddressOf PicMouseLeave
  38.         AddHandler ButtonPIC.MouseDown, AddressOf PicMouseDown
  39.         AddHandler ButtonPIC.MouseUp, AddressOf PicMouseUp
  40.         AddHandler NewTab1LBL.MouseEnter, AddressOf TabMouseEnter
  41.         AddHandler NewTab1LBL.MouseLeave, AddressOf TabMouseLeave
  42.         AddHandler NewTab1LBL.Click, AddressOf TabClick
  43.         AddHandler NewTab2LBL.MouseEnter, AddressOf TabMouseEnter
  44.         AddHandler NewTab2LBL.MouseLeave, AddressOf TabMouseLeave
  45.         AddHandler NewTab2LBL.Click, AddressOf TabClick
  46.         AddHandler NewTab3LBL.MouseEnter, AddressOf TabMouseEnter
  47.         AddHandler NewTab3LBL.MouseLeave, AddressOf TabMouseLeave
  48.         AddHandler NewTab3LBL.Click, AddressOf TabClick
  49.         AddHandler NewTab4LBL.MouseEnter, AddressOf TabMouseEnter
  50.         AddHandler NewTab4LBL.MouseLeave, AddressOf TabMouseLeave
  51.         AddHandler NewTab4LBL.Click, AddressOf TabClick
  52.         AddHandler NewTab5LBL.MouseEnter, AddressOf TabMouseEnter
  53.         AddHandler NewTab5LBL.MouseLeave, AddressOf TabMouseLeave
  54.         AddHandler NewTab5LBL.Click, AddressOf TabClick
  55.         AddHandler NewTab6LBL.MouseEnter, AddressOf TabMouseEnter
  56.         AddHandler NewTab6LBL.MouseLeave, AddressOf TabMouseLeave
  57.         AddHandler NewTab6LBL.Click, AddressOf TabClick
  58.         AddHandler NewTab7LBL.MouseEnter, AddressOf TabMouseEnter
  59.         AddHandler NewTab7LBL.MouseLeave, AddressOf TabMouseLeave
  60.         AddHandler NewTab7LBL.Click, AddressOf TabClick
  61.         SetupProgram()
  62.         CreateData()
  63.         LoadAlerts()
  64.         ShortCutsPanel.Controls.Add(Shortcuts.GetInstance())
  65.         NTFY.Icon = Me.Icon
  66.         NTFY.Text = Me.Text
  67.         Dim MyMenu As New ContextMenuStrip
  68.         MyMenu.Items.Add("إظهار", My.Resources.Export)
  69.         MyMenu.Items.Add("إخفاء", My.Resources.Import)
  70.         MyMenu.Items.Add("طلب بيع جديد", My.Resources.NewSell)
  71.         MyMenu.Items.Add("قائمة المبيعات", My.Resources.ListSell)
  72.         MyMenu.Items.Add("الرسم البياني", My.Resources.Charts)
  73.         MyMenu.Items.Add("الصندوق", My.Resources.Box)
  74.         MyMenu.Items.Add("حول", My.Resources.Accounting)
  75.         MyMenu.Items.Add("الإعدادات", My.Resources.Setting)
  76.         MyMenu.Items.Add("إنهاء", My.Resources.Del)
  77.         MyMenu.RightToLeft = RightToLeft.Yes
  78.         AddHandler MyMenu.Items.Item(0).Click, AddressOf ShowFunction
  79.         AddHandler MyMenu.Items.Item(1).Click, AddressOf HideFunction
  80.         AddHandler MyMenu.Items.Item(2).Click, AddressOf NewSellFunction
  81.         AddHandler MyMenu.Items.Item(3).Click, AddressOf ListSellFunction
  82.         AddHandler MyMenu.Items.Item(4).Click, AddressOf ChartFunction
  83.         AddHandler MyMenu.Items.Item(5).Click, AddressOf BoxFunction
  84.         AddHandler MyMenu.Items.Item(6).Click, AddressOf AboutFunction
  85.         AddHandler MyMenu.Items.Item(7).Click, AddressOf SettingFunction
  86.         AddHandler MyMenu.Items.Item(8).Click, AddressOf EndFunction
  87.         NTFY.ContextMenuStrip = MyMenu
  88.         NTFY.Visible = True
  89.         GoTo Finish
  90. StealPoint:
  91.         '/////////////Steeeeeeeeeeeeeeeeeeeeal
  92. Finish:
  93.     End Sub
  94.     Public Sub EndFunction()
  95.         NTFY.Visible = False
  96.         End
  97.     End Sub
  98.     Public Sub HideFunction()
  99.         Me.Hide()
  100.     End Sub
  101.     Public Sub ShowFunction()
  102.         Me.Show()
  103.     End Sub
  104.     Public Sub AboutFunction()
  105.         Me.Show()
  106.         OpenNewTab(About.GetInstance)
  107.     End Sub
  108.     Public Sub ChartFunction()
  109.         Me.Show()
  110.         OpenNewTab(Charts.GetInstance)
  111.     End Sub
  112.     Public Sub BoxFunction()
  113.         Me.Show()
  114.         OpenNewTab(ViewBox.GetInstance)
  115.     End Sub
  116.     Public Sub NewSellFunction()
  117.         Me.Show()
  118.         OpenNewTab(NewSell.GetInstance)
  119.     End Sub
  120.     Public Sub ListSellFunction()
  121.         Me.Show()
  122.         OpenNewTab(ListSell.GetInstance)
  123.     End Sub
  124.     Public Sub SettingFunction()
  125.         Me.Show()
  126.         OpenNewTab(Setting.GetInstance)
  127.     End Sub
  128.     Public Sub ZeroingAlerts()
  129.         Dim Addad As Integer = 0
  130.         For Addad = 0 To 43
  131.             RPanel.Controls.Item("LinkLBL" & Addad).Text = ""
  132.             RPanel.Controls.Item("LinkLBL" & Addad).Visible = False
  133.         Next
  134.         Label7.BackColor = Color.DarkKhaki
  135.         AlertON = False
  136.     End Sub
  137.     Public Sub AlertsWriter(ByVal Name As String, ByVal SAlert As String, ByVal STarget As String)
  138.         If My.Computer.FileSystem.DirectoryExists(AlertsPath & "\" & Name) = False Then My.Computer.FileSystem.CreateDirectory(AlertsPath & "\" & Name)
  139.         If My.Computer.FileSystem.DirectoryExists(AlertsPath & "\" & Name & "\" & STarget) = False Then My.Computer.FileSystem.CreateDirectory(AlertsPath & "\" & Name & "\" & STarget)
  140.         My.Computer.FileSystem.WriteAllText(AlertsPath & "\" & Name & "\" & STarget & "\alert.dat", SAlert, False, System.Text.Encoding.GetEncoding(0))
  141.         My.Computer.FileSystem.WriteAllText(AlertsPath & "\" & Name & "\" & STarget & "\target.dat", STarget, False, System.Text.Encoding.GetEncoding(0))
  142.     End Sub
  143.     Public Sub TestBox()
  144.         Dim YearSTR As String = Date.Now.Year
  145.         Dim MonthSTR As String = Date.Now.Month
  146.         Dim DaySTR As String = Date.Now.Day
  147.         If MonthSTR.Length <= 1 Then MonthSTR = "0" & MonthSTR
  148.         If DaySTR.Length <= 1 Then DaySTR = "0" & DaySTR
  149.         Dim DayDir As String = MovmentPath & "\" & YearSTR & "\" & MonthSTR & "\" & DaySTR
  150.         Dim PName As String = "الصندوق"
  151.         Dim WDir As String = ""
  152.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  153.         If Val(My.Computer.FileSystem.ReadAllText(DayDir & "\money.dat", System.Text.Encoding.GetEncoding(0))) <= 5000 Then
  154.             AlertsWriter(PName, "نقص في " & PName & " , قيمة أموالك في صندوقك منخفضة ، يمكنك تحويل مبلغ من المال من الأجور", "B-money")
  155.             WDir = AlertsPath & "\" & PName & "\B-money"
  156.             If My.Computer.FileSystem.DirectoryExists(WDir) = False Then LoadAlerts()
  157.         Else
  158.             WDir = AlertsPath & "\" & PName & "\B-money"
  159.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  160.         End If
  161.         If Val(My.Computer.FileSystem.ReadAllText(DayDir & "\capital.dat", System.Text.Encoding.GetEncoding(0))) <= 5000 Then
  162.             AlertsWriter(PName, "نقص في " & PName & " , قيمة رأسمالك المتوفرة منخفضة ، يمكنك تحويل مبلغ من المال من الأجور", "B-cap")
  163.             WDir = AlertsPath & "\" & PName & "\B-cap"
  164.             If My.Computer.FileSystem.DirectoryExists(WDir) = False Then LoadAlerts()
  165.         Else
  166.             WDir = AlertsPath & "\" & PName & "\B-cap"
  167.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  168.         End If
  169.         If Val(My.Computer.FileSystem.ReadAllText(DayDir & "\inter.dat", System.Text.Encoding.GetEncoding(0))) >= 50000 Then
  170.             AlertsWriter(PName, "تتوفر لديك سيولة في " & PName & " , يمكنك تحويل مبلغ من المال إلى الأجور", "B-intr")
  171.             WDir = AlertsPath & "\" & PName & "\B-intr"
  172.             If My.Computer.FileSystem.DirectoryExists(WDir) = False Then LoadAlerts()
  173.         Else
  174.             WDir = AlertsPath & "\" & PName & "\B-intr"
  175.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  176.         End If
  177.     End Sub
  178.     Public Sub LoadAlerts()
  179.         On Error Resume Next
  180.         ZeroingAlerts()
  181.         Dim LBLAddad As Integer = 0
  182.         Dim Addad As Integer = 0
  183.         For Addad = 0 To My.Computer.FileSystem.GetDirectories(AlertsPath).Count - 1
  184.             Dim PPath As String = My.Computer.FileSystem.GetDirectories(AlertsPath).Item(Addad)
  185.             Dim PName As String = My.Computer.FileSystem.GetDirectoryInfo(PPath).Name
  186.             Dim SubAddad As Integer = 0
  187.             For SubAddad = 0 To My.Computer.FileSystem.GetDirectories(PPath).Count - 1
  188.                 Dim AlertPath As String = My.Computer.FileSystem.GetDirectories(PPath).Item(SubAddad)
  189.                 Dim AlertName As String = My.Computer.FileSystem.GetDirectoryInfo(AlertPath).Name
  190.                 Dim AlertText As String = "- " & My.Computer.FileSystem.ReadAllText(AlertPath & "\alert.dat", System.Text.Encoding.GetEncoding(0)) & "."
  191.                 Dim AlertTag As String = My.Computer.FileSystem.ReadAllText(AlertPath & "\target.dat", System.Text.Encoding.GetEncoding(0))
  192.                 RPanel.Controls.Item("LinkLBL" & LBLAddad).Text = AlertText
  193.                 RPanel.Controls.Item("LinkLBL" & LBLAddad).Tag = PName
  194.                 RPanel.Controls.Item("LinkLBL" & LBLAddad).Visible = True
  195.                 SenderTarget(LBLAddad) = AlertPath
  196.                 If AlertName.Contains("M-") = True Then
  197.                     AddHandler RPanel.Controls.Item("LinkLBL" & LBLAddad).Click, AddressOf GotoMerchantName
  198.                 ElseIf AlertName.Contains("C-") = True Then
  199.                     AddHandler RPanel.Controls.Item("LinkLBL" & LBLAddad).Click, AddressOf GotoCustomerName
  200.                 ElseIf AlertName.Contains("P-") = True Then
  201.                     AddHandler RPanel.Controls.Item("LinkLBL" & LBLAddad).Click, AddressOf GotoBuyName
  202.                 ElseIf AlertName.Contains("S-") = True Then
  203.                     AddHandler RPanel.Controls.Item("LinkLBL" & LBLAddad).Click, AddressOf GotoSetting
  204.                 ElseIf AlertName.Contains("B-") = True Then
  205.                     AddHandler RPanel.Controls.Item("LinkLBL" & LBLAddad).Click, AddressOf GotoBox
  206.                 Else
  207.                     AddHandler RPanel.Controls.Item("LinkLBL" & LBLAddad).Click, AddressOf GotoProductName
  208.                 End If
  209.                 RPanel.Controls.Item("LinkLBL" & LBLAddad).Width = 120
  210.                 LBLAddad += 1
  211.                 AlertON = True
  212.             Next
  213.         Next
  214.     End Sub
  215.     Dim SenderTarget(90) As String
  216.     Public Sub GotoBox(ByVal sender As System.Object, ByVal e As System.EventArgs)
  217.         OpenNewTab(ViewBox.GetInstance)
  218.     End Sub
  219.     Public Sub GotoSetting(ByVal sender As System.Object, ByVal e As System.EventArgs)
  220.         OpenNewTab(Setting.GetInstance)
  221.     End Sub
  222.     Public Sub GotoProductName(ByVal sender As System.Object, ByVal e As System.EventArgs)
  223.         OpenNewTab(NewProduct.GetInstance)
  224.         Dim SNum As Integer = RPanel.Controls.Item(sender.name).name.replace("LinkLBL", "")
  225.         NewProduct.GetInstance.CalledFromWindow(SenderTarget(SNum), sender.tag)
  226.     End Sub
  227.     Public Sub GotoCustomerName(ByVal sender As System.Object, ByVal e As System.EventArgs)
  228.         OpenNewTab(NewCustomer.GetInstance)
  229.         NewCustomer.GetInstance.CNameTXT.Text = sender.tag
  230.     End Sub
  231.     Public Sub GotoMerchantName(ByVal sender As System.Object, ByVal e As System.EventArgs)
  232.         OpenNewTab(NewMerchant.GetInstance)
  233.         NewMerchant.GetInstance.CNameTXT.Text = sender.tag
  234.     End Sub
  235.     Public Sub GotoBuyName(ByVal sender As System.Object, ByVal e As System.EventArgs)
  236.         OpenNewTab(NewBuy.GetInstance)
  237.         NewBuy.GetInstance.NewSellProNameTXT.Text = sender.tag
  238.     End Sub
  239.     Public Sub SetupProgram()
  240.         If My.Computer.FileSystem.FileExists(BoxPath & "\money.dat") = False Then My.Computer.FileSystem.WriteAllText(BoxPath & "\money.dat", 0, False)
  241.         If My.Computer.FileSystem.FileExists(BoxPath & "\capital.dat") = False Then My.Computer.FileSystem.WriteAllText(BoxPath & "\capital.dat", 0, False)
  242.         If My.Computer.FileSystem.FileExists(BoxPath & "\tax.dat") = False Then My.Computer.FileSystem.WriteAllText(BoxPath & "\tax.dat", 0, False)
  243.         If My.Computer.FileSystem.FileExists(BoxPath & "\service.dat") = False Then My.Computer.FileSystem.WriteAllText(BoxPath & "\service.dat", 0, False)
  244.         If My.Computer.FileSystem.FileExists(BoxPath & "\inter.dat") = False Then My.Computer.FileSystem.WriteAllText(BoxPath & "\inter.dat", 0, False)
  245.         If My.Computer.FileSystem.GetDirectories(StoresPath).Count < 1 Then MainView.GetInstance.CreateNewStore()
  246.         If My.Computer.FileSystem.GetFiles(CatPath).Count < 1 Then MainView.GetInstance.CreateNewCat()
  247.         If My.Computer.FileSystem.ReadAllText(CompanyPath & "\name.dat", System.Text.Encoding.GetEncoding(0)) = "" Then
  248.             Setting.GetInstance.TestText()
  249.         End If
  250.     End Sub
  251.     Public Sub TestDate()
  252.         On Error Resume Next
  253.         Dim YearSTR As String = Date.Now.Year
  254.         Dim MonthSTR As String = Date.Now.Month
  255.         Dim DaySTR As String = Date.Now.Day
  256.         If MonthSTR.Length <= 1 Then MonthSTR = "0" & MonthSTR
  257.         If DaySTR.Length <= 1 Then DaySTR = "0" & DaySTR
  258.         Dim LastYear As String = My.Computer.FileSystem.GetDirectoryInfo(My.Computer.FileSystem.GetDirectories(DataPath & "\Movment").Item(My.Computer.FileSystem.GetDirectories(DataPath & "\Movment").Count - 1)).Name
  259.         If Val(LastYear) > Val(YearSTR) Then GoTo ErrorDate
  260.         Dim LastMonth As String = My.Computer.FileSystem.GetDirectoryInfo(My.Computer.FileSystem.GetDirectories(DataPath & "\Movment\" & YearSTR).Item(My.Computer.FileSystem.GetDirectories(DataPath & "\Movment\" & YearSTR).Count - 1)).Name
  261.         If Val(LastMonth) > Val(MonthSTR) Then GoTo ErrorDate
  262.         Dim LastDay As String = My.Computer.FileSystem.GetDirectoryInfo(My.Computer.FileSystem.GetDirectories(DataPath & "\Movment\" & YearSTR & "\" & MonthSTR).Item(My.Computer.FileSystem.GetDirectories(DataPath & "\Movment\" & YearSTR & "\" & MonthSTR).Count - 1)).Name
  263.         If Val(LastDay) > Val(DaySTR) Then GoTo ErrorDate
  264.         If Val(LastMonth) > Val(MonthSTR) Then GoTo ErrorDate
  265.         GoTo Finish
  266. ErrorDate:
  267.         TimeTMR.Enabled = False
  268.         MsgBox("خطأ في تاريخ الحاسب لديك ، الرجاء ضبط التاريخ فوراً")
  269.         End
  270. Finish:
  271.     End Sub
  272.     '...........................................................................................................................
  273.     '...........................................................................................................................
  274.     Public Sub CreateData()
  275.         If My.Computer.FileSystem.DirectoryExists(DataPath) = False Then My.Computer.FileSystem.CreateDirectory(DataPath)
  276.         If My.Computer.FileSystem.DirectoryExists(DataPath & "\Movment") = False Then My.Computer.FileSystem.CreateDirectory(DataPath & "\Movment")
  277.         If My.Computer.FileSystem.DirectoryExists(DataPath & "\Products") = False Then My.Computer.FileSystem.CreateDirectory(DataPath & "\Products")
  278.         Dim YearSTR As String = Date.Now.Year
  279.         Dim MonthSTR As String = Date.Now.Month
  280.         Dim DaySTR As String = Date.Now.Day
  281.         If MonthSTR.Length <= 1 Then MonthSTR = "0" & MonthSTR
  282.         If DaySTR.Length <= 1 Then DaySTR = "0" & DaySTR
  283.         If My.Computer.FileSystem.DirectoryExists(DataPath & "\Movment\" & YearSTR & "\" & MonthSTR & "\" & DaySTR) = False Then My.Computer.FileSystem.CreateDirectory(DataPath & "\Movment\" & YearSTR & "\" & MonthSTR & "\" & DaySTR) Else GoTo Finish
  284.         Dim DateDir As String = MovmentPath & "\" & YearSTR & "\" & MonthSTR & "\" & DaySTR
  285.         '.....................................................
  286.         '.....................................................
  287.         'Write Data To Box :..................................
  288.         '.....................................................
  289.         '.....................................................
  290.         Dim LastDayInterValue As Double = 0
  291.         'money'.....................................................
  292.         If My.Computer.FileSystem.FileExists(BoxPath & "\money.dat") = True Then
  293.             LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(BoxPath & "\money.dat", System.Text.Encoding.GetEncoding(0)))
  294.         Else
  295.             LastDayInterValue = 0
  296.         End If
  297.         My.Computer.FileSystem.WriteAllText(DateDir & "\money.dat", LastDayInterValue, False)
  298.         'capital'.....................................................
  299.         If My.Computer.FileSystem.FileExists(BoxPath & "\capital.dat") = True Then
  300.             LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(BoxPath & "\capital.dat", System.Text.Encoding.GetEncoding(0)))
  301.         Else
  302.             LastDayInterValue = 0
  303.         End If
  304.         My.Computer.FileSystem.WriteAllText(DateDir & "\capital.dat", LastDayInterValue, False)
  305.         'tax'.....................................................
  306.         If My.Computer.FileSystem.FileExists(BoxPath & "\tax.dat") = True Then
  307.             LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(BoxPath & "\tax.dat", System.Text.Encoding.GetEncoding(0)))
  308.         Else
  309.             LastDayInterValue = 0
  310.         End If
  311.         My.Computer.FileSystem.WriteAllText(DateDir & "\tax.dat", LastDayInterValue, False)
  312.         'service'.....................................................
  313.         If My.Computer.FileSystem.FileExists(BoxPath & "\service.dat") = True Then
  314.             LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(BoxPath & "\service.dat", System.Text.Encoding.GetEncoding(0)))
  315.         Else
  316.             LastDayInterValue = 0
  317.         End If
  318.         My.Computer.FileSystem.WriteAllText(DateDir & "\service.dat", LastDayInterValue, False)
  319.         'inter'.....................................................
  320.         If My.Computer.FileSystem.FileExists(BoxPath & "\inter.dat") = True Then
  321.             LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(BoxPath & "\inter.dat", System.Text.Encoding.GetEncoding(0)))
  322.         Else
  323.             LastDayInterValue = 0
  324.         End If
  325.         My.Computer.FileSystem.WriteAllText(DateDir & "\inter.dat", LastDayInterValue, False)
  326.         'placerent'.....................................................
  327.         My.Computer.FileSystem.WriteAllText(DateDir & "\placerent.dat", 0, False)
  328.         'electricity'.....................................................
  329.         My.Computer.FileSystem.WriteAllText(DateDir & "\electricity.dat", 0, False)
  330.         'water'.....................................................
  331.         My.Computer.FileSystem.WriteAllText(DateDir & "\water.dat", 0, False)
  332.         'workerrent'.....................................................
  333.         My.Computer.FileSystem.WriteAllText(DateDir & "\workerrent.dat", 0, False)
  334.         'daialyspent'.....................................................
  335.         My.Computer.FileSystem.WriteAllText(DateDir & "\daialyspent.dat", 0, False)
  336.         GoTo Finish
  337. ErrorDate:
  338.         MsgBox("خطأ في تاريخ الحاسب لديك ، الرجاء ضبط التاريخ فوراً")
  339. Finish:
  340.     End Sub
  341.     Public Sub PicMouseEnter(ByVal sender As Object, ByVal e As System.EventArgs)
  342.         SenderName = sender
  343.         Dim SizeA As Integer = 0
  344.         Dim SizeB As Integer = 0
  345.         If SenderName.Width >= 100 Then
  346.             SizeA = 16
  347.             SizeB = SizeA - 2
  348.         Else
  349.             SizeA = 8
  350.             SizeB = SizeA - 1
  351.         End If
  352.         SenderName.width += SizeA
  353.         SenderName.height += SizeA
  354.         SenderName.left -= SizeA / 2
  355.         SenderName.top -= SizeB
  356.     End Sub
  357.     Public Sub PicMouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
  358.         SenderName = sender
  359.         Dim SizeA As Integer = 0
  360.         Dim SizeB As Integer = 0
  361.         If SenderName.Width >= 100 Then
  362.             SizeA = 16
  363.             SizeB = SizeA - 2
  364.         Else
  365.             SizeA = 8
  366.             SizeB = SizeA - 1
  367.         End If
  368.         SenderName.width -= SizeA
  369.         SenderName.height -= SizeA
  370.         SenderName.left += SizeA / 2
  371.         SenderName.top += SizeB
  372.     End Sub
  373.     Public Sub PicMouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
  374.         SenderName = sender
  375.         Dim SizeA As Integer = 0
  376.         Dim SizeB As Integer = 0
  377.         If SenderName.Width >= 100 Then
  378.             SizeA = 16
  379.             SizeB = SizeA - 2
  380.         Else
  381.             SizeA = 8
  382.             SizeB = SizeA - 1
  383.         End If
  384.         SenderName.width += SizeA
  385.         SenderName.height += SizeA
  386.         SenderName.left -= SizeA / 2
  387.         SenderName.top -= SizeB
  388.     End Sub
  389.     Public Sub PicMouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)
  390.         SenderName = sender
  391.         Dim SizeA As Integer = 0
  392.         Dim SizeB As Integer = 0
  393.         If SenderName.Width >= 100 Then
  394.             SizeA = 16
  395.             SizeB = SizeA - 2
  396.         Else
  397.             SizeA = 8
  398.             SizeB = SizeA - 1
  399.         End If
  400.         SenderName.width -= SizeA
  401.         SenderName.height -= SizeA
  402.         SenderName.left += SizeA / 2
  403.         SenderName.top += SizeB
  404.     End Sub
  405.     Dim AlertON As Boolean = False
  406.     Private Sub TimeTMR_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TimeTMR.Tick
  407.         On Error Resume Next
  408.         TimeLBL.Text = Date.Now
  409.         BoxLBL.Text = _
  410.         "مجموع عملة الصندوق: " & Val(My.Computer.FileSystem.ReadAllText(BoxPath & "\money.dat", System.Text.Encoding.GetEncoding(0))) & " " & My.Computer.FileSystem.ReadAllText(SettingsPath & "\maincurrency.dat", System.Text.Encoding.GetEncoding(0)) & System.Environment.NewLine & _
  411.          "مجموع أرباح الصندوق: " & Val(My.Computer.FileSystem.ReadAllText(BoxPath & "\inter.dat", System.Text.Encoding.GetEncoding(0))) & " " & My.Computer.FileSystem.ReadAllText(SettingsPath & "\maincurrency.dat", System.Text.Encoding.GetEncoding(0))
  412.         TestDate()
  413.         Dim YearSTR As String = Date.Now.Year
  414.         Dim MonthSTR As String = Date.Now.Month
  415.         Dim DaySTR As String = Date.Now.Day
  416.         If MonthSTR.Length <= 1 Then MonthSTR = "0" & MonthSTR
  417.         If DaySTR.Length <= 1 Then DaySTR = "0" & DaySTR
  418.         Dim DateDir As String = MovmentPath & "\" & YearSTR & "\" & MonthSTR & "\" & DaySTR
  419.         If My.Computer.FileSystem.DirectoryExists(DateDir) = False Then CreateData()
  420.         If AlertON = True Then
  421.             If Label7.BackColor = Color.DarkKhaki Then Label7.BackColor = Color.Coral : GoTo Fin
  422.             If Label7.BackColor = Color.Coral Then Label7.BackColor = Color.DarkKhaki : GoTo Fin
  423. Fin:
  424.         End If
  425.         If Me.Width >= 1166 Then
  426.             MainPanel.Left = Label3.Left - 784 - 24
  427.             MainPanel.Width = 784
  428.         End If
  429.         TestBox()
  430.     End Sub
  431.     Private Sub ButtonPIC_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ButtonPIC.MouseMove
  432.         MainView.GetInstance.HideSubPic()
  433.     End Sub
  434.     Private Sub TimeLBL_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TimeLBL.MouseMove
  435.         MainView.GetInstance.HideSubPic()
  436.     End Sub
  437.     Public Sub ClearTabs()
  438.         Dim Addad As Integer = 1
  439.         For Addad = 1 To 6
  440.             If Me.Controls.Item("NewTab" & Addad & "LBL").Text = Me.Controls.Item("NewTab" & Addad + 1 & "LBL").Text Then
  441.                 Me.Controls.Item("NewTab" & Addad + 1 & "LBL").Text = ""
  442.                 Me.Controls.Item("NewTab" & Addad + 1 & "LBL").Tag = ""
  443.             End If
  444.             If Me.Controls.Item("NewTab" & Addad & "LBL").Text = "" And Me.Controls.Item("NewTab" & Addad + 1 & "LBL").Text <> "" Then
  445.                 Me.Controls.Item("NewTab" & Addad & "LBL").Text = Me.Controls.Item("NewTab" & Addad + 1 & "LBL").Text
  446.                 Me.Controls.Item("NewTab" & Addad & "LBL").Tag = Me.Controls.Item("NewTab" & Addad + 1 & "LBL").Tag
  447.                 Me.Controls.Item("NewTab" & Addad & "LBL").Visible = True
  448.                 Me.Controls.Item("NewTab" & Addad + 1 & "LBL").Text = ""
  449.                 Me.Controls.Item("NewTab" & Addad + 1 & "LBL").Tag = ""
  450.                 Me.Controls.Item("NewTab" & Addad + 1 & "LBL").Visible = False
  451.             End If
  452.         Next
  453.     End Sub
  454.     Public Sub AddNewTab(ByRef TabName As String, ByRef ControlName As String)
  455.         If NewTab1LBL.Text = "" Or NewTab1LBL.Text = TabName Then
  456.             NewTab1LBL.Visible = True
  457.             NewTab1LBL.Text = TabName
  458.             NewTab1LBL.Tag = ControlName
  459.             SelectedTab = NewTab1LBL.Name
  460.             NewTab1LBL.Image = My.Resources.NewTabME
  461.             NewTab2LBL.Image = My.Resources.NewTab
  462.             NewTab3LBL.Image = My.Resources.NewTab
  463.             NewTab4LBL.Image = My.Resources.NewTab
  464.             NewTab5LBL.Image = My.Resources.NewTab
  465.             NewTab6LBL.Image = My.Resources.NewTab
  466.             NewTab7LBL.Image = My.Resources.NewTab
  467.             'If NewTab2LBL.Text = NewTab1LBL.Text Then SelectedTab = "" : RemoveTab()
  468.             GoTo Finish
  469.         End If
  470.         If NewTab2LBL.Text = "" Or NewTab2LBL.Text = TabName Then
  471.             NewTab2LBL.Visible = True
  472.             NewTab2LBL.Text = TabName
  473.             NewTab2LBL.Tag = ControlName
  474.             SelectedTab = NewTab2LBL.Name
  475.             NewTab1LBL.Image = My.Resources.NewTab
  476.             NewTab2LBL.Image = My.Resources.NewTabME
  477.             NewTab3LBL.Image = My.Resources.NewTab
  478.             NewTab4LBL.Image = My.Resources.NewTab
  479.             NewTab5LBL.Image = My.Resources.NewTab
  480.             NewTab6LBL.Image = My.Resources.NewTab
  481.             NewTab7LBL.Image = My.Resources.NewTab
  482.             'If NewTab3LBL.Text = NewTab2LBL.Text Then SelectedTab = "" : RemoveTab()
  483.             GoTo Finish
  484.         End If
  485.         If NewTab3LBL.Text = "" Or NewTab3LBL.Text = TabName Then
  486.             NewTab3LBL.Visible = True
  487.             NewTab3LBL.Text = TabName
  488.             NewTab3LBL.Tag = ControlName
  489.             SelectedTab = NewTab3LBL.Name
  490.             NewTab1LBL.Image = My.Resources.NewTab
  491.             NewTab2LBL.Image = My.Resources.NewTab
  492.             NewTab3LBL.Image = My.Resources.NewTabME
  493.             NewTab4LBL.Image = My.Resources.NewTab
  494.             NewTab5LBL.Image = My.Resources.NewTab
  495.             NewTab6LBL.Image = My.Resources.NewTab
  496.             NewTab7LBL.Image = My.Resources.NewTab
  497.             'If NewTab4LBL.Text = NewTab3LBL.Text Then SelectedTab = "" : RemoveTab()
  498.             GoTo Finish
  499.         End If
  500.         If NewTab4LBL.Text = "" Or NewTab4LBL.Text = TabName Then
  501.             NewTab4LBL.Visible = True
  502.             NewTab4LBL.Text = TabName
  503.             NewTab4LBL.Tag = ControlName
  504.             SelectedTab = NewTab4LBL.Name
  505.             NewTab1LBL.Image = My.Resources.NewTab
  506.             NewTab2LBL.Image = My.Resources.NewTab
  507.             NewTab3LBL.Image = My.Resources.NewTab
  508.             NewTab4LBL.Image = My.Resources.NewTabME
  509.             NewTab5LBL.Image = My.Resources.NewTab
  510.             NewTab6LBL.Image = My.Resources.NewTab
  511.             NewTab7LBL.Image = My.Resources.NewTab
  512.             'If NewTab5LBL.Text = NewTab4LBL.Text Then SelectedTab = "" : RemoveTab()
  513.             GoTo Finish
  514.         End If
  515.         If NewTab5LBL.Text = "" Or NewTab5LBL.Text = TabName Then
  516.             NewTab5LBL.Visible = True
  517.             NewTab5LBL.Text = TabName
  518.             NewTab5LBL.Tag = ControlName
  519.             SelectedTab = NewTab5LBL.Name
  520.             NewTab1LBL.Image = My.Resources.NewTab
  521.             NewTab2LBL.Image = My.Resources.NewTab
  522.             NewTab3LBL.Image = My.Resources.NewTab
  523.             NewTab4LBL.Image = My.Resources.NewTab
  524.             NewTab5LBL.Image = My.Resources.NewTabME
  525.             NewTab6LBL.Image = My.Resources.NewTab
  526.             NewTab7LBL.Image = My.Resources.NewTab
  527.             'If NewTab6LBL.Text = NewTab5LBL.Text Then SelectedTab = "" : RemoveTab()
  528.             GoTo Finish
  529.         End If
  530.         If NewTab6LBL.Text = "" Or NewTab6LBL.Text = TabName Then
  531.             NewTab6LBL.Visible = True
  532.             NewTab6LBL.Text = TabName
  533.             NewTab6LBL.Tag = ControlName
  534.             SelectedTab = NewTab6LBL.Name
  535.             NewTab1LBL.Image = My.Resources.NewTab
  536.             NewTab2LBL.Image = My.Resources.NewTab
  537.             NewTab3LBL.Image = My.Resources.NewTab
  538.             NewTab4LBL.Image = My.Resources.NewTab
  539.             NewTab5LBL.Image = My.Resources.NewTab
  540.             NewTab6LBL.Image = My.Resources.NewTabME
  541.             NewTab7LBL.Image = My.Resources.NewTab
  542.             'If NewTab7LBL.Text = NewTab6LBL.Text Then SelectedTab = "" : RemoveTab()
  543.             GoTo Finish
  544.         End If
  545.         If NewTab7LBL.Text = "" Or NewTab7LBL.Text = TabName Then
  546.             NewTab7LBL.Visible = True
  547.             NewTab7LBL.Text = TabName
  548.             NewTab7LBL.Tag = ControlName
  549.             SelectedTab = NewTab7LBL.Name
  550.             NewTab1LBL.Image = My.Resources.NewTab
  551.             NewTab2LBL.Image = My.Resources.NewTab
  552.             NewTab3LBL.Image = My.Resources.NewTab
  553.             NewTab4LBL.Image = My.Resources.NewTab
  554.             NewTab5LBL.Image = My.Resources.NewTab
  555.             NewTab6LBL.Image = My.Resources.NewTab
  556.             NewTab7LBL.Image = My.Resources.NewTabME
  557.             GoTo Finish
  558.         End If
  559. Finish:
  560.     End Sub
  561.     Public Sub RemoveTab()
  562.         On Error Resume Next
  563.         Me.Controls.Item(SelectedTab).Visible = False
  564.         Me.Controls.Item(SelectedTab).Text = ""
  565.         ClearTabs()
  566.     End Sub
  567.     Public Sub TabMouseEnter(ByVal sender As Object, ByVal e As System.EventArgs)
  568.         sender.ForeColor = Color.SaddleBrown
  569.     End Sub
  570.     Public Sub TabMouseLeave(ByVal sender As Object, ByVal e As System.EventArgs)
  571.         sender.ForeColor = Color.Chocolate
  572.     End Sub
  573.     Private Sub TabClick(ByVal sender As System.Object, ByVal e As System.EventArgs)
  574.         MainPanel.Controls.Clear()
  575.         If sender.Tag = MainView.GetInstance.Name Then OpenNewTab(MainView.GetInstance())
  576.         If sender.Tag = NewProduct.GetInstance.Name Then OpenNewTab(NewProduct.GetInstance())
  577.         If sender.Tag = ListProducts.GetInstance.Name Then OpenNewTab(ListProducts.GetInstance())
  578.         If sender.Tag = NewSell.GetInstance.Name Then OpenNewTab(NewSell.GetInstance())
  579.         If sender.Tag = ListSell.GetInstance.Name Then OpenNewTab(ListSell.GetInstance())
  580.         If sender.Tag = Requests.GetInstance.Name Then OpenNewTab(Requests.GetInstance())
  581.         If sender.Tag = NewCustomer.GetInstance.Name Then OpenNewTab(NewCustomer.GetInstance())
  582.         If sender.Tag = ListCustomers.GetInstance.Name Then OpenNewTab(ListCustomers.GetInstance())
  583.         If sender.Tag = ListMerchant.GetInstance.Name Then OpenNewTab(ListMerchant.GetInstance())
  584.         If sender.Tag = NewMerchant.GetInstance.Name Then OpenNewTab(NewMerchant.GetInstance())
  585.         If sender.Tag = NewBuy.GetInstance.Name Then OpenNewTab(NewBuy.GetInstance())
  586.         If sender.Tag = ListBuy.GetInstance.Name Then OpenNewTab(ListBuy.GetInstance())
  587.         If sender.Tag = Setting.GetInstance.Name Then OpenNewTab(Setting.GetInstance())
  588.         If sender.Tag = AdjustStore.GetInstance.Name Then OpenNewTab(AdjustStore.GetInstance())
  589.         If sender.Tag = StoreCat.GetInstance.Name Then OpenNewTab(StoreCat.GetInstance())
  590.         If sender.Tag = ViewBox.GetInstance.Name Then OpenNewTab(ViewBox.GetInstance())
  591.         If sender.Tag = All.GetInstance.Name Then OpenNewTab(All.GetInstance())
  592.         If sender.Tag = About.GetInstance.Name Then OpenNewTab(About.GetInstance())
  593.         If sender.Tag = Charts.GetInstance.Name Then OpenNewTab(Charts.GetInstance())
  594. Finish:
  595.     End Sub
  596.     Public Sub CloseTabs()
  597.         RemoveTab()
  598.         MainPanel.Controls.Clear()
  599.         MainPanel.Controls.Add(MainView.GetInstance())
  600.         AddNewTab(MainView.GetInstance.Tag, MainView.GetInstance.Name)
  601.     End Sub
  602.     Public Sub OpenNewTab(ByVal UC As Object)
  603.         MainPanel.Controls.Clear()
  604.         MainPanel.Controls.Add(UC.GetInstance())
  605.         AddNewTab(UC.GetInstance.Tag, UC.GetInstance.Name)
  606.     End Sub
  607.     Private Sub Pan1LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Pan1LBL.Click
  608.         OpenNewTab(ViewBox.GetInstance)
  609.     End Sub
  610.     Private Sub BoxLBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BoxLBL.Click
  611.         OpenNewTab(ViewBox.GetInstance)
  612.     End Sub
  613.     Private Sub ButtonPIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonPIC.Click
  614.         OpenNewTab(All.GetInstance)
  615.     End Sub
  616.     Private Sub NTFY_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NTFY.MouseClick
  617.         If e.Button = MouseButtons.Left Then
  618.             If Me.Visible = True Then
  619.                 HideFunction()
  620.             Else
  621.                 ShowFunction()
  622.             End If
  623.         End If
  624.     End Sub
  625.     Private Sub StartUp_VisibleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.VisibleChanged
  626.         If Me.Visible = True Then
  627.             NTFY.ContextMenuStrip.Items.Item(0).Enabled = False
  628.             NTFY.ContextMenuStrip.Items.Item(1).Enabled = True
  629.         Else
  630.             NTFY.ContextMenuStrip.Items.Item(0).Enabled = True
  631.             NTFY.ContextMenuStrip.Items.Item(1).Enabled = False
  632.         End If
  633.     End Sub
  634.  
  635.     Private Sub NTFY_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NTFY.MouseDoubleClick
  636.  
  637.     End Sub
  638. 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.