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

NewCustomer.vb
  1. Public Class NewCustomer
  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 SettingsPath As String = DataPath & "\Settings"
  13.     Dim AlertsPath As String = DataPath & "\Alerts"
  14.     Dim BoxPath As String = DataPath & "\Box"
  15.     Dim MaxList As Integer = 0
  16.     Dim FromList As Integer = 0
  17.     Dim ToList As Integer = 0
  18.     Private Shared NewCustomerInstance As NewCustomer
  19.     Public Shared Function GetInstance() As NewCustomer
  20.         If (NewCustomerInstance Is Nothing) Then
  21.             NewCustomerInstance = New NewCustomer
  22.         End If
  23.         Return NewCustomerInstance
  24.     End Function
  25.     Private Sub NewCustomer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  26.         MaxList = 0
  27.         FromList = 0
  28.         ToList = 0
  29.         LoadCustomers()
  30.     End Sub
  31.     Private Sub CancelBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CancelBTN.Click
  32.         MaxList = 0
  33.         FromList = 0
  34.         ToList = 0
  35.         StartUp.CloseTabs()
  36.     End Sub
  37.     Public Sub LoadCustomerInfo(ByRef CName As String)
  38.         On Error Resume Next
  39.         CNameTXT.Text = CName
  40.         LV.Items.Clear()
  41.         Dim Addad As Integer = 0
  42.         CAddressTXT.Text = My.Computer.FileSystem.ReadAllText(CustomersPath & "\" & CName & "\address.dat", System.Text.Encoding.GetEncoding(0))
  43.         CTelTXT.Text = My.Computer.FileSystem.ReadAllText(CustomersPath & "\" & CName & "\tel.dat", System.Text.Encoding.GetEncoding(0))
  44.         CMailTXT.Text = My.Computer.FileSystem.ReadAllText(CustomersPath & "\" & CName & "\mail.dat", System.Text.Encoding.GetEncoding(0))
  45.         CWebTXT.Text = My.Computer.FileSystem.ReadAllText(CustomersPath & "\" & CName & "\web.dat", System.Text.Encoding.GetEncoding(0))
  46.         CJobTXT.Text = My.Computer.FileSystem.ReadAllText(CustomersPath & "\" & CName & "\job.dat", System.Text.Encoding.GetEncoding(0))
  47.         CJobAddressTXT.Text = My.Computer.FileSystem.ReadAllText(CustomersPath & "\" & CName & "\jobaddress.dat", System.Text.Encoding.GetEncoding(0))
  48.         If My.Computer.FileSystem.DirectoryExists(CustomersPath & "\" & CName & "\payment") = False Then GoTo CalcIt
  49.         MaxList = My.Computer.FileSystem.GetDirectories(CustomersPath & "\" & CName & "\payment").Count
  50.         If FromList = 0 Then FromList = MaxList
  51.         ToList = FromList - 20
  52.         If MaxList - ToList > MaxList Then
  53.             ToList = 0
  54.         End If
  55.         For Addad = FromList - 1 To ToList Step -1
  56.             'For Addad = My.Computer.FileSystem.GetDirectories(CustomersPath & "\" & CName & "\payment").Count - 1 To 0 Step -1
  57.             Dim DateFormat As String = My.Computer.FileSystem.ReadAllText(My.Computer.FileSystem.GetDirectories(CustomersPath & "\" & CName & "\payment").Item(Addad) & "\date.dat", System.Text.Encoding.GetEncoding(0))
  58.             LV.Items.Add(DateFormat.Chars(0) & DateFormat.Chars(1) & DateFormat.Chars(2) & DateFormat.Chars(3) & "/" & DateFormat.Chars(4) & DateFormat.Chars(5) & "/" & DateFormat.Chars(6) & DateFormat.Chars(7) & " " & DateFormat.Chars(8) & DateFormat.Chars(9) & ":" & DateFormat.Chars(10) & DateFormat.Chars(11))
  59.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(My.Computer.FileSystem.ReadAllText(My.Computer.FileSystem.GetDirectories(CustomersPath & "\" & CName & "\payment").Item(Addad) & "\pname.dat", System.Text.Encoding.GetEncoding(0)))
  60.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(My.Computer.FileSystem.ReadAllText(My.Computer.FileSystem.GetDirectories(CustomersPath & "\" & CName & "\payment").Item(Addad) & "\pamount.dat", System.Text.Encoding.GetEncoding(0)))
  61.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(My.Computer.FileSystem.ReadAllText(My.Computer.FileSystem.GetDirectories(CustomersPath & "\" & CName & "\payment").Item(Addad) & "\paymenttotal.dat", System.Text.Encoding.GetEncoding(0)))
  62.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(My.Computer.FileSystem.ReadAllText(My.Computer.FileSystem.GetDirectories(CustomersPath & "\" & CName & "\payment").Item(Addad) & "\paydbl.dat", System.Text.Encoding.GetEncoding(0)))
  63.             LV.Items.Item(LV.Items.Count - 1).SubItems.Add(My.Computer.FileSystem.ReadAllText(My.Computer.FileSystem.GetDirectories(CustomersPath & "\" & CName & "\payment").Item(Addad) & "\remaindbl.dat", System.Text.Encoding.GetEncoding(0)))
  64.         Next
  65.         SLBL.Text = MaxList - ToList & " من " & MaxList
  66.         SLBL.Tag = 20
  67. CalcIt:
  68.         Dim Total As Double = 0
  69.         Dim Dept As Double = 0
  70.         For Addad = 0 To LV.Items.Count - 1
  71.             Total += Val(LV.Items.Item(Addad).SubItems(3).Text)
  72.             Dept += Val(LV.Items.Item(Addad).SubItems(5).Text)
  73.         Next
  74.         TotalPayment.Text = "قيمة المشتريات : " & Total & " " & My.Computer.FileSystem.ReadAllText(SettingsPath & "\maincurrency.dat", System.Text.Encoding.GetEncoding(0))
  75.         TotaldebtTXT.Text = "باقي الديون : " & Dept & " " & My.Computer.FileSystem.ReadAllText(SettingsPath & "\maincurrency.dat", System.Text.Encoding.GetEncoding(0))
  76.         'Correct Main Dir :
  77.         My.Computer.FileSystem.WriteAllText(CustomersPath & "\" & CName & "\totalpayment.dat", Total, False, System.Text.Encoding.GetEncoding(0))
  78.         My.Computer.FileSystem.WriteAllText(CustomersPath & "\" & CName & "\totaldept.dat", Dept, False, System.Text.Encoding.GetEncoding(0))
  79.         LV.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize)
  80.     End Sub
  81.     Public Sub CreateNewCustomer()
  82.         Dim CPath As String = CustomersPath & "\" & CNameTXT.Text
  83.         Dim CName As String = CNameTXT.Text
  84.         Dim CAddress As String = CAddressTXT.Text
  85.         Dim CTel As String = CTelTXT.Text
  86.         Dim CMail As String = CMailTXT.Text
  87.         Dim CWeb As String = CWebTXT.Text
  88.         Dim CJob As String = CJobTXT.Text
  89.         Dim CJobAddress As String = CJobAddressTXT.Text
  90.         If My.Computer.FileSystem.DirectoryExists(CPath) = False Then
  91.             My.Computer.FileSystem.CreateDirectory(CPath)
  92.         End If
  93.         My.Computer.FileSystem.WriteAllText(CPath & "\name.dat", CName, False, System.Text.Encoding.GetEncoding(0))
  94.         My.Computer.FileSystem.WriteAllText(CPath & "\address.dat", CAddress, False, System.Text.Encoding.GetEncoding(0))
  95.         My.Computer.FileSystem.WriteAllText(CPath & "\tel.dat", CTel, False, System.Text.Encoding.GetEncoding(0))
  96.         My.Computer.FileSystem.WriteAllText(CPath & "\mail.dat", CMail, False, System.Text.Encoding.GetEncoding(0))
  97.         My.Computer.FileSystem.WriteAllText(CPath & "\web.dat", CWeb, False, System.Text.Encoding.GetEncoding(0))
  98.         My.Computer.FileSystem.WriteAllText(CPath & "\job.dat", CJob, False, System.Text.Encoding.GetEncoding(0))
  99.         My.Computer.FileSystem.WriteAllText(CPath & "\jobaddress.dat", CJobAddress, False, System.Text.Encoding.GetEncoding(0))
  100.         My.Computer.FileSystem.WriteAllText(CPath & "\totaldept.dat", 0, False, System.Text.Encoding.GetEncoding(0))
  101.         My.Computer.FileSystem.WriteAllText(CPath & "\totalpayment.dat", 0, False, System.Text.Encoding.GetEncoding(0))
  102.     End Sub
  103.     Private Sub AddCBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddCBTN.Click
  104.         TestText()
  105.         CreateNewCustomer()
  106.         StartUp.CloseTabs()
  107.     End Sub
  108.     Public Sub TestText()
  109.         'test values to add errors to Alerts :
  110.         Dim PName As String = CNameTXT.Text
  111.         Dim WDir As String = ""
  112.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  113.         If CAddressTXT.Text = "" Then
  114.             StartUp.AlertsWriter(PName, "لم تقم بوضع عنوان الزبون " & PName & " , أنقر هنا لوضع عنوان الزبون", "C-add")
  115.         Else
  116.             WDir = AlertsPath & "\" & PName & "\C-add"
  117.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  118.         End If
  119.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  120.         If CTelTXT.Text = "" Then
  121.             StartUp.AlertsWriter(PName, "لم تقم بوضع رقم هاتف الزبون " & PName & " , أنقر هنا لوضع رقم الهاتف", "C-tel")
  122.         Else
  123.             WDir = AlertsPath & "\" & PName & "\C-tel"
  124.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  125.         End If
  126.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  127.         If CMailTXT.Text = "" Then
  128.             StartUp.AlertsWriter(PName, "لم تقم بوضع عنوان البريد الإلكتروني للزبون " & PName & " , أنقر هنا لوضع عنوان البريد الإلكتروني", "C-mail")
  129.         Else
  130.             WDir = AlertsPath & "\" & PName & "\C-mail"
  131.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  132.         End If
  133.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  134.         If CWebTXT.Text = "" Then
  135.             StartUp.AlertsWriter(PName, "لم تقم بوضع عنوان الموقع الإلكتروني للزبون " & PName & " , أنقر هنا لوضع عنوان الموقع الإلكتروني", "C-web")
  136.         Else
  137.             WDir = AlertsPath & "\" & PName & "\C-web"
  138.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  139.         End If
  140.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  141.         If CJobTXT.Text = "" Then
  142.             StartUp.AlertsWriter(PName, "لم تقم بتسجيل عمل الزبون " & PName & " , أنقر هنا لتعيين وظيفة الزبون", "C-job")
  143.         Else
  144.             WDir = AlertsPath & "\" & PName & "\C-job"
  145.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  146.         End If
  147.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  148.         If CJobAddressTXT.Text = "" Then
  149.             StartUp.AlertsWriter(PName, "لم تقم بتعيين عنوان عمل الزبون " & PName & " , أنقر هنا لتعيين عنوان عمل الزبون", "C-jobaddress")
  150.         Else
  151.             WDir = AlertsPath & "\" & PName & "\C-jobaddress"
  152.             If My.Computer.FileSystem.DirectoryExists(WDir) Then System.IO.Directory.Delete(WDir, True)
  153.         End If
  154.         '××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××
  155.         StartUp.LoadAlerts()
  156.     End Sub
  157.     Public Sub LoadCustomers()
  158.         Dim Addad As Integer = 0
  159.         For Addad = 0 To My.Computer.FileSystem.GetDirectories(CustomersPath).Count - 1
  160.             Dim CustomerName As String = ""
  161.             CustomerName = My.Computer.FileSystem.GetDirectoryInfo(My.Computer.FileSystem.GetDirectories(CustomersPath).Item(Addad)).Name
  162.             CNameTXT.Items.Add(CustomerName)
  163.         Next
  164.     End Sub
  165.     Private Sub CNameTXT_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CNameTXT.KeyDown
  166.         If e.KeyCode = Keys.Enter Then CAddressTXT.Select()
  167.     End Sub
  168.     Private Sub CNameTXT_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles CNameTXT.TextChanged
  169.         If My.Computer.FileSystem.DirectoryExists(CustomersPath & "\" & CNameTXT.Text) = True And CNameTXT.Text <> "" Then
  170.             LV.Items.Clear()
  171.             MaxList = 0
  172.             FromList = 0
  173.             ToList = 0
  174.             LoadCustomerInfo(CNameTXT.Text)
  175.             AddCBTN.Text = "تعديل"
  176.             Refresher.Enabled = True
  177.         Else
  178.             Refresher.Enabled = False
  179.             AddCBTN.Text = "إضافة"
  180.             CAddressTXT.Text = ""
  181.             CTelTXT.Text = ""
  182.             CMailTXT.Text = ""
  183.             CWebTXT.Text = ""
  184.             CJobTXT.Text = ""
  185.             CJobAddressTXT.Text = ""
  186.             MaxList = 0
  187.             FromList = 0
  188.             ToList = 0
  189.             LV.Items.Clear()
  190.         End If
  191.     End Sub
  192.     Private Sub LV_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles LV.DoubleClick
  193.         LoadProduct()
  194.     End Sub
  195.     Public Sub LoadProduct()
  196.         If LV.SelectedItems.Count > 0 Then
  197.             NewProduct.GetInstance.LoadProduct(LV.FocusedItem.SubItems(1).Text)
  198.             StartUp.MainPanel.Controls.Clear()
  199.             StartUp.MainPanel.Controls.Add(NewProduct.GetInstance())
  200.             StartUp.AddNewTab(NewProduct.GetInstance.Tag, NewProduct.GetInstance.Name)
  201.         End If
  202.     End Sub
  203.     Private Sub NextBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NextBTN.Click
  204.         If FromList > 20 Then FromList -= 20 : LoadCustomerInfo(CNameTXT.Text)
  205.     End Sub
  206.     Private Sub PrevBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrevBTN.Click
  207.         If FromList < MaxList Then FromList += 20 : LoadCustomerInfo(CNameTXT.Text)
  208.     End Sub
  209.     Private Sub DeptBTN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DeptBTN.Click
  210.         Dim Addad As Integer = 0
  211.         Dim Total As Double = 0
  212.         Dim Dept As Double = 0
  213.         Dim CNamePath As String = CustomersPath & "\" & CNameTXT.Text & "\payment"
  214.         Dim WDir As String = ""
  215.         Dim MyValue As Double = 0
  216.         MyValue = Val(InputBox("أدخل المبلغ الذي سيقوم الزبون  " & CNameTXT.Text & " بتسديده", "تسديد دين الزبون " & CNameTXT.Text, 0))
  217.         For Addad = 0 To My.Computer.FileSystem.GetDirectories(CNamePath).Count - 1
  218.             WDir = My.Computer.FileSystem.GetDirectories(CNamePath).Item(Addad)
  219.             Total += Val(My.Computer.FileSystem.ReadAllText(WDir & "\paymenttotal.dat", System.Text.Encoding.GetEncoding(0)))
  220.             Dept += Val(My.Computer.FileSystem.ReadAllText(WDir & "\remaindbl.dat", System.Text.Encoding.GetEncoding(0)))
  221.         Next
  222.         If MyValue = Nothing Then GoTo Finish
  223.         If MyValue > Dept Then MyValue = Dept
  224.         For Addad = 0 To My.Computer.FileSystem.GetDirectories(CNamePath).Count - 1
  225.             Dim YearSTR As String = Date.Now.Year
  226.             Dim MonthSTR As String = Date.Now.Month
  227.             Dim DaySTR As String = Date.Now.Day
  228.             If MonthSTR.Length <= 1 Then MonthSTR = "0" & MonthSTR
  229.             If DaySTR.Length <= 1 Then DaySTR = "0" & DaySTR
  230.             Dim DateDir As String = MovmentPath & "\" & YearSTR & "\" & MonthSTR & "\" & DaySTR
  231.             Dim MonthDir As String = MovmentPath & "\" & YearSTR & "\" & MonthSTR
  232.             Dim YearDir As String = MovmentPath & "\" & YearSTR
  233.             Dim LastDayInterValue As Double = 0
  234.             Dim InterValue As Double = 0
  235.             Dim TaxValue As Double = 0
  236.             Dim LastValue As Double = 0
  237.             Dim LValue As Double = 0
  238.             WDir = My.Computer.FileSystem.GetDirectories(CNamePath).Item(Addad)
  239.             LastValue = Val(My.Computer.FileSystem.ReadAllText(WDir & "\remaindbl.dat", System.Text.Encoding.GetEncoding(0)))
  240.             LValue = Val(My.Computer.FileSystem.ReadAllText(WDir & "\paydbl.dat", System.Text.Encoding.GetEncoding(0)))
  241.             If LastValue > 0 Then
  242.                 If MyValue >= LastValue Then
  243.                     My.Computer.FileSystem.WriteAllText(WDir & "\remaindbl.dat", 0, False, System.Text.Encoding.GetEncoding(0))
  244.                     My.Computer.FileSystem.WriteAllText(WDir & "\paydbl.dat", LastValue + LValue, False, System.Text.Encoding.GetEncoding(0))
  245.                     'MsgBox(Addad & " , " & LastValue & " , " & LastValue & " , تم التسديد")
  246.                     '..............
  247.                     '..............
  248.                     '..............
  249.                     'Write To Box :
  250.                     '..............
  251.                     '..............
  252.                     '..............
  253.                     Dim PType As String = ""
  254.                     Dim PName As String = My.Computer.FileSystem.ReadAllText(WDir & "\pname.dat", System.Text.Encoding.GetEncoding(0))
  255.                     Dim Amount As Double = Val(My.Computer.FileSystem.ReadAllText(WDir & "\pamount.dat", System.Text.Encoding.GetEncoding(0)))
  256.                     TaxValue = Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\price.dat", System.Text.Encoding.GetEncoding(0))) * Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\maintax.dat", System.Text.Encoding.GetEncoding(0))) / 100) + Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\price.dat", System.Text.Encoding.GetEncoding(0))) * Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\subtax.dat", System.Text.Encoding.GetEncoding(0))) / 100)
  257.                     InterValue = Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\purch.dat", System.Text.Encoding.GetEncoding(0))) * Amount) - Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\price.dat", System.Text.Encoding.GetEncoding(0))) * Amount) - (TaxValue * Amount)
  258.                     PType = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\type.dat", System.Text.Encoding.GetEncoding(0))
  259.                     If My.Computer.FileSystem.FileExists(MonthDir & "\inter.dat") = True Then
  260.                         LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(MonthDir & "\inter.dat", System.Text.Encoding.GetEncoding(0)))
  261.                     Else
  262.                         LastDayInterValue = 0
  263.                     End If
  264.                     My.Computer.FileSystem.WriteAllText(MonthDir & "\inter.dat", InterValue + LastDayInterValue, False)
  265.                     If My.Computer.FileSystem.FileExists(YearDir & "\inter.dat") = True Then
  266.                         LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(YearDir & "\inter.dat", System.Text.Encoding.GetEncoding(0)))
  267.                     Else
  268.                         LastDayInterValue = 0
  269.                     End If
  270.                     My.Computer.FileSystem.WriteAllText(YearDir & "\inter.dat", InterValue + LastDayInterValue, False)
  271.                     'money
  272.                     If My.Computer.FileSystem.FileExists(DateDir & "\money.dat") = True Then
  273.                         LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(DateDir & "\money.dat", System.Text.Encoding.GetEncoding(0)))
  274.                     Else
  275.                         LastDayInterValue = 0
  276.                     End If
  277.                     My.Computer.FileSystem.WriteAllText(DateDir & "\money.dat", Val(LastValue + LastDayInterValue), False)
  278.                     My.Computer.FileSystem.WriteAllText(BoxPath & "\money.dat", Val(LastValue + LastDayInterValue), False)
  279.                     'capital
  280.                     If My.Computer.FileSystem.FileExists(DateDir & "\capital.dat") = True Then
  281.                         LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(DateDir & "\capital.dat", System.Text.Encoding.GetEncoding(0)))
  282.                     Else
  283.                         LastDayInterValue = 0
  284.                     End If
  285.                     Dim TotalPrice As Double = Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\price.dat", System.Text.Encoding.GetEncoding(0))) * Amount)
  286.                     My.Computer.FileSystem.WriteAllText(DateDir & "\capital.dat", TotalPrice + LastDayInterValue, False)
  287.                     My.Computer.FileSystem.WriteAllText(BoxPath & "\capital.dat", TotalPrice + LastDayInterValue, False)
  288.                     'tax
  289.                     If My.Computer.FileSystem.FileExists(DateDir & "\tax.dat") = True Then
  290.                         LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(DateDir & "\tax.dat", System.Text.Encoding.GetEncoding(0)))
  291.                     Else
  292.                         LastDayInterValue = 0
  293.                     End If
  294.                     Dim TotalTax As Double = TaxValue * Amount
  295.                     My.Computer.FileSystem.WriteAllText(DateDir & "\tax.dat", TotalTax + LastDayInterValue, False)
  296.                     My.Computer.FileSystem.WriteAllText(BoxPath & "\tax.dat", TotalTax + LastDayInterValue, False)
  297.                     'service
  298.                     If PType = "خدمات" Then
  299.                         If My.Computer.FileSystem.FileExists(DateDir & "\service.dat") = True Then
  300.                             LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(DateDir & "\service.dat", System.Text.Encoding.GetEncoding(0)))
  301.                         Else
  302.                             LastDayInterValue = 0
  303.                         End If
  304.                         My.Computer.FileSystem.WriteAllText(DateDir & "\service.dat", Val(LastValue) + LastDayInterValue, False)
  305.                         My.Computer.FileSystem.WriteAllText(BoxPath & "\service.dat", Val(LastValue) + LastDayInterValue, False)
  306.                     End If
  307.                     'inter
  308.                     If My.Computer.FileSystem.FileExists(DateDir & "\inter.dat") = True Then
  309.                         LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(DateDir & "\inter.dat", System.Text.Encoding.GetEncoding(0)))
  310.                     Else
  311.                         LastDayInterValue = 0
  312.                     End If
  313.                     My.Computer.FileSystem.WriteAllText(DateDir & "\inter.dat", InterValue + LastDayInterValue, False)
  314.                     My.Computer.FileSystem.WriteAllText(BoxPath & "\inter.dat", InterValue + LastDayInterValue, False)
  315.                     '..............
  316.                     '..............
  317.                     '..............
  318.                     'Sub Salary :
  319.                     '..............
  320.                     '..............
  321.                     '..............
  322.                     MyValue = MyValue - LastValue
  323.                     Dept = Dept - LastValue
  324.                 Else
  325.                     My.Computer.FileSystem.WriteAllText(WDir & "\remaindbl.dat", LastValue - MyValue, False, System.Text.Encoding.GetEncoding(0))
  326.                     My.Computer.FileSystem.WriteAllText(WDir & "\paydbl.dat", MyValue + LValue, False, System.Text.Encoding.GetEncoding(0))
  327.                     'MsgBox(Addad & " , " & LastValue & " , " & MyValue & " , تم التسديد والإنتهاء")
  328.                     '..............
  329.                     '..............
  330.                     '..............
  331.                     'Write To Box :
  332.                     '..............
  333.                     '..............
  334.                     '..............
  335.                     Dim PType As String = ""
  336.                     Dim PName As String = My.Computer.FileSystem.ReadAllText(WDir & "\pname.dat", System.Text.Encoding.GetEncoding(0))
  337.                     Dim Amount As Double = Val(My.Computer.FileSystem.ReadAllText(WDir & "\pamount.dat", System.Text.Encoding.GetEncoding(0)))
  338.                     TaxValue = Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\price.dat", System.Text.Encoding.GetEncoding(0))) * Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\maintax.dat", System.Text.Encoding.GetEncoding(0))) / 100) + Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\price.dat", System.Text.Encoding.GetEncoding(0))) * Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\subtax.dat", System.Text.Encoding.GetEncoding(0))) / 100)
  339.                     InterValue = Val(LastValue) - Val(Val(My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\price.dat", System.Text.Encoding.GetEncoding(0))) * Amount) - (TaxValue * Amount)
  340.                     PType = My.Computer.FileSystem.ReadAllText(ProductPath & "\" & PName & "\type.dat", System.Text.Encoding.GetEncoding(0))
  341.                     'money
  342.                     If My.Computer.FileSystem.FileExists(DateDir & "\money.dat") = True Then
  343.                         LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(DateDir & "\money.dat", System.Text.Encoding.GetEncoding(0)))
  344.                     Else
  345.                         LastDayInterValue = 0
  346.                     End If
  347.                     My.Computer.FileSystem.WriteAllText(DateDir & "\money.dat", Val(MyValue + LastDayInterValue), False)
  348.                     My.Computer.FileSystem.WriteAllText(BoxPath & "\money.dat", Val(MyValue + LastDayInterValue), False)
  349.                     'service
  350.                     If PType = "خدمات" Then
  351.                         If My.Computer.FileSystem.FileExists(DateDir & "\service.dat") = True Then
  352.                             LastDayInterValue = Val(My.Computer.FileSystem.ReadAllText(DateDir & "\service.dat", System.Text.Encoding.GetEncoding(0)))
  353.                         Else
  354.                             LastDayInterValue = 0
  355.                         End If
  356.                         My.Computer.FileSystem.WriteAllText(DateDir & "\service.dat", Val(MyValue) + LastDayInterValue, False)
  357.                         My.Computer.FileSystem.WriteAllText(BoxPath & "\service.dat", Val(MyValue) + LastDayInterValue, False)
  358.                     End If
  359.                     '..............
  360.                     '..............
  361.                     '..............
  362.                     'Sub Salary :
  363.                     '..............
  364.                     '..............
  365.                     '..............
  366.                     Dept = Dept - MyValue
  367.                     MyValue = 0
  368.                     GoTo Finish
  369.                 End If
  370.             End If
  371.         Next
  372. Finish:
  373.         My.Computer.FileSystem.WriteAllText(CustomersPath & "\" & CNameTXT.Text & "\totaldept.dat", Dept, False, System.Text.Encoding.GetEncoding(0))
  374.         '
  375.         LoadCustomerInfo(CNameTXT.Text)
  376.     End Sub
  377.     Private Sub Refresher_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Refresher.Tick
  378.         LoadCustomerInfo(CNameTXT.Text)
  379.     End Sub
  380.     Private Sub CAddressTXT_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CAddressTXT.KeyDown
  381.         If e.KeyCode = Keys.Enter Then CTelTXT.Select()
  382.     End Sub
  383.     Private Sub CTelTXT_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CTelTXT.KeyDown
  384.         If e.KeyCode = Keys.Enter Then CMailTXT.Select()
  385.     End Sub
  386.     Private Sub CMailTXT_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CMailTXT.KeyDown
  387.         If e.KeyCode = Keys.Enter Then CWebTXT.Select()
  388.     End Sub
  389.     Private Sub CWebTXT_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CWebTXT.KeyDown
  390.         If e.KeyCode = Keys.Enter Then CJobTXT.Select()
  391.     End Sub
  392.     Private Sub CJobTXT_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CJobTXT.KeyDown
  393.         If e.KeyCode = Keys.Enter Then CJobAddressTXT.Select()
  394.     End Sub
  395.     Private Sub CJobAddressTXT_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles CJobAddressTXT.KeyDown
  396.         If e.KeyCode = Keys.Enter Then AddCBTN.Select()
  397.     End Sub
  398.     Private Sub CAddressTXT_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles CAddressTXT.LostFocus
  399.         Refresher.Enabled = True
  400.     End Sub
  401.     Private Sub CAddressTXT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CAddressTXT.TextChanged
  402.         Refresher.Enabled = False
  403.     End Sub
  404.     Private Sub CTelTXT_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles CTelTXT.LostFocus
  405.         Refresher.Enabled = True
  406.     End Sub
  407.     Private Sub CTelTXT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CTelTXT.TextChanged
  408.         Refresher.Enabled = False
  409.     End Sub
  410.     Private Sub CMailTXT_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles CMailTXT.LostFocus
  411.         Refresher.Enabled = True
  412.     End Sub
  413.     Private Sub CMailTXT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CMailTXT.TextChanged
  414.         Refresher.Enabled = False
  415.     End Sub
  416.     Private Sub CWebTXT_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles CWebTXT.LostFocus
  417.         Refresher.Enabled = True
  418.     End Sub
  419.     Private Sub CWebTXT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CWebTXT.TextChanged
  420.         Refresher.Enabled = False
  421.     End Sub
  422.     Private Sub CJobTXT_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles CJobTXT.LostFocus
  423.         Refresher.Enabled = True
  424.     End Sub
  425.     Private Sub CJobTXT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CJobTXT.TextChanged
  426.         Refresher.Enabled = False
  427.     End Sub
  428.     Private Sub CJobAddressTXT_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles CJobAddressTXT.LostFocus
  429.         Refresher.Enabled = True
  430.     End Sub
  431.     Private Sub CJobAddressTXT_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CJobAddressTXT.TextChanged
  432.         Refresher.Enabled = False
  433.     End Sub
  434. 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.