MainView.vb
- Public Class MainView
- Dim ProgramName As String = My.Application.Info.AssemblyName
- Dim DataPath As String = System.Environment.CurrentDirectory & "\UAM"
- Dim ProductPath As String = DataPath & "\Products" '
- Dim ServicesPath As String = DataPath & "\Services"
- Dim CatPath As String = DataPath & "\Categories"
- Dim StoresPath As String = DataPath & "\Stores"
- Dim CustomersPath As String = DataPath & "\Customers"
- Dim CompanyPath As String = DataPath & "\Company"
- Dim MovmentPath As String = DataPath & "\Movment"
- Dim RequestsPath As String = DataPath & "\Requests"
- Dim VendorsPath As String = DataPath & "\Vendors"
- Private Shared MainViewInstance As MainView
- Public Shared Function GetInstance() As MainView
- If (MainViewInstance Is Nothing) Then
- MainViewInstance = New MainView
- End If
- Return MainViewInstance
- End Function
- Private Sub MainView_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- On Error Resume Next
- AddHandler VendorPIC.MouseEnter, AddressOf StartUp.PicMouseEnter
- AddHandler VendorPIC.MouseLeave, AddressOf StartUp.PicMouseLeave
- AddHandler VendorPIC.MouseDown, AddressOf StartUp.PicMouseDown
- AddHandler VendorPIC.MouseUp, AddressOf StartUp.PicMouseUp
- AddHandler BuyPIC.MouseEnter, AddressOf StartUp.PicMouseEnter
- AddHandler BuyPIC.MouseLeave, AddressOf StartUp.PicMouseLeave
- AddHandler BuyPIC.MouseDown, AddressOf StartUp.PicMouseDown
- AddHandler BuyPIC.MouseUp, AddressOf StartUp.PicMouseUp
- AddHandler StorePIC.MouseEnter, AddressOf StartUp.PicMouseEnter
- AddHandler StorePIC.MouseLeave, AddressOf StartUp.PicMouseLeave
- AddHandler StorePIC.MouseDown, AddressOf StartUp.PicMouseDown
- AddHandler StorePIC.MouseUp, AddressOf StartUp.PicMouseUp
- AddHandler SellPIC.MouseEnter, AddressOf StartUp.PicMouseEnter
- AddHandler SellPIC.MouseLeave, AddressOf StartUp.PicMouseLeave
- AddHandler SellPIC.MouseDown, AddressOf StartUp.PicMouseDown
- AddHandler SellPIC.MouseUp, AddressOf StartUp.PicMouseUp
- AddHandler CustomerPIC.MouseEnter, AddressOf StartUp.PicMouseEnter
- AddHandler CustomerPIC.MouseLeave, AddressOf StartUp.PicMouseLeave
- AddHandler CustomerPIC.MouseDown, AddressOf StartUp.PicMouseDown
- AddHandler CustomerPIC.MouseUp, AddressOf StartUp.PicMouseUp
- End Sub
- Private Sub VendorPIC_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles VendorPIC.MouseEnter
- HideSubPic()
- VendorL1PIC.Visible = True
- VendorL2PIC.Visible = True
- VendorL1LBL.Visible = True
- VendorL2LBL.Visible = True
- VendorTXTPIC.Top += 7
- End Sub
- Private Sub VendorPIC_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles VendorPIC.MouseLeave
- VendorTXTPIC.Top -= 7
- End Sub
- Private Sub BuyPIC_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles BuyPIC.MouseEnter
- HideSubPic()
- BuyL1PIC.Visible = True
- BuyL2PIC.Visible = True
- BuyL1LBL.Visible = True
- BuyL2LBL.Visible = True
- BuyTXTPIC.Top += 7
- End Sub
- Private Sub BuyPIC_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles BuyPIC.MouseLeave
- BuyTXTPIC.Top -= 7
- End Sub
- Private Sub StorePIC_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles StorePIC.MouseEnter
- HideSubPic()
- StoreL0PIC.Visible = True
- StoreL1PIC.Visible = True
- StoreL2PIC.Visible = True
- StoreL3PIC.Visible = True
- StoreL4PIC.Visible = True
- StoreL5PIC.Visible = True
- StoreL0LBL.Visible = True
- StoreL1LBL.Visible = True
- StoreL2LBL.Visible = True
- StoreL3LBL.Visible = True
- StoreL4LBL.Visible = True
- StoreL5LBL.Visible = True
- StoreTXTPIC.Top += 7
- End Sub
- Private Sub StorePIC_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles StorePIC.MouseLeave
- StoreTXTPIC.Top -= 7
- End Sub
- Private Sub SellPIC_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellPIC.MouseEnter
- HideSubPic()
- SellL1PIC.Visible = True
- SellL2PIC.Visible = True
- SellL3PIC.Visible = True
- SellL1LBL.Visible = True
- SellL2LBL.Visible = True
- SellL3LBL.Visible = True
- SellTXTPIC.Top += 7
- End Sub
- Private Sub SellPIC_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles SellPIC.MouseLeave
- SellTXTPIC.Top -= 7
- End Sub
- Private Sub CustomerPIC_MouseEnter(ByVal sender As Object, ByVal e As System.EventArgs) Handles CustomerPIC.MouseEnter
- HideSubPic()
- CustomerL1PIC.Visible = True
- CustomerL2PIC.Visible = True
- CustomerL1LBL.Visible = True
- CustomerL2LBL.Visible = True
- CustomerTXTPIC.Top += 7
- End Sub
- Private Sub CustomerPIC_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles CustomerPIC.MouseLeave
- CustomerTXTPIC.Top -= 7
- End Sub
- Public Sub HideSubPic()
- VendorL1PIC.Visible = False
- VendorL2PIC.Visible = False
- VendorL1LBL.Visible = False
- VendorL2LBL.Visible = False
- '.........................
- BuyL1PIC.Visible = False
- BuyL2PIC.Visible = False
- BuyL1LBL.Visible = False
- BuyL2LBL.Visible = False
- '.........................
- StoreL0PIC.Visible = False
- StoreL1PIC.Visible = False
- StoreL2PIC.Visible = False
- StoreL3PIC.Visible = False
- StoreL4PIC.Visible = False
- StoreL5PIC.Visible = False
- StoreL0LBL.Visible = False
- StoreL1LBL.Visible = False
- StoreL2LBL.Visible = False
- StoreL3LBL.Visible = False
- StoreL4LBL.Visible = False
- StoreL5LBL.Visible = False
- '.........................
- SellL1PIC.Visible = False
- SellL2PIC.Visible = False
- SellL3PIC.Visible = False
- SellL1LBL.Visible = False
- SellL2LBL.Visible = False
- SellL3LBL.Visible = False
- '.........................
- CustomerL1PIC.Visible = False
- CustomerL2PIC.Visible = False
- CustomerL1LBL.Visible = False
- CustomerL2LBL.Visible = False
- End Sub
- Private Sub MainView_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick
- HideSubPic()
- End Sub
- Private Sub StoreL0LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL0LBL.Click
- StartUp.OpenNewTab(NewProduct.GetInstance)
- End Sub
- Private Sub StoreL2LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL2LBL.Click
- StartUp.OpenNewTab(ListProducts.GetInstance)
- End Sub
- Private Sub SellL3LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SellL3LBL.Click
- StartUp.OpenNewTab(NewSell.GetInstance)
- End Sub
- Private Sub SellL2LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SellL2LBL.Click
- StartUp.OpenNewTab(ListSell.GetInstance)
- End Sub
- Private Sub SellL1LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SellL1LBL.Click
- StartUp.OpenNewTab(Requests.GetInstance)
- End Sub
- Private Sub CustomerL2LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerL2LBL.Click
- StartUp.OpenNewTab(NewCustomer.GetInstance)
- End Sub
- Private Sub CustomerL1LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerL1LBL.Click
- StartUp.OpenNewTab(ListCustomers.GetInstance)
- End Sub
- Private Sub VendorL1LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VendorL1LBL.Click
- StartUp.OpenNewTab(ListMerchant.GetInstance)
- End Sub
- Private Sub VendorL2LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VendorL2LBL.Click
- StartUp.OpenNewTab(NewMerchant.GetInstance)
- End Sub
- Private Sub BuyL2LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BuyL2LBL.Click
- StartUp.OpenNewTab(NewBuy.GetInstance)
- End Sub
- Private Sub BuyL1LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BuyL1LBL.Click
- StartUp.OpenNewTab(ListBuy.GetInstance)
- End Sub
- Private Sub StoreL4LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL4LBL.Click
- StartUp.OpenNewTab(AdjustStore.GetInstance)
- End Sub
- Private Sub StoreL3LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL3LBL.Click
- StartUp.OpenNewTab(StoreCat.GetInstance)
- End Sub
- Private Sub StoreL1LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL1LBL.Click
- CreateNewStore()
- End Sub
- Private Sub StoreL1PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL1PIC.Click
- CreateNewStore()
- End Sub
- Private Sub StoreL5LBL_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL5LBL.Click
- CreateNewCat()
- End Sub
- Private Sub StoreL5PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL5PIC.Click
- CreateNewCat()
- End Sub
- Public Sub CreateNewStore()
- Dim SName As String = ""
- Dim SDesc As String = ""
- SName = InputBox("إسم المخزن الجديد الذي ترغب بإضافته :", "إضافة مخزن جديد", "")
- If SName <> Nothing And My.Computer.FileSystem.DirectoryExists(StoresPath & "\" & SName) = False Then
- SDesc = InputBox("وصف سريع لمخزن " & SName & " الجديد :", "وصف مخزن " & SName, "")
- If SDesc <> Nothing Then
- My.Computer.FileSystem.CreateDirectory(StoresPath & "\" & SName)
- My.Computer.FileSystem.WriteAllText(StoresPath & "\" & SName & ".dat", SDesc, False, System.Text.Encoding.GetEncoding(0))
- MsgBox("تم إنشاء مخزن " & SName & " بنجاح" & System.Environment.NewLine & "وصف مخزن " & SName & " : " & SDesc)
- If My.Computer.FileSystem.GetDirectories(StoresPath).Count = 1 Then My.Computer.FileSystem.WriteAllText(DataPath & "\defaultstore.dat", SName, False, System.Text.Encoding.GetEncoding(0))
- End If
- End If
- End Sub
- Public Sub CreateNewCat()
- Dim SName As String = ""
- SName = InputBox("إسم التصنيف الجديد الذي ترغب بإضافته :", "إضافة تصنيف جديد", "")
- If SName <> Nothing And My.Computer.FileSystem.FileExists(CatPath & "\" & SName & ".dat") = False Then
- My.Computer.FileSystem.WriteAllText(CatPath & "\" & SName & ".dat", "", False, System.Text.Encoding.GetEncoding(0))
- MsgBox("تم إنشاء تصنيف " & SName & " بنجاح")
- End If
- End Sub
- Private Sub VendorL2PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VendorL2PIC.Click
- StartUp.OpenNewTab(NewMerchant.GetInstance)
- End Sub
- Private Sub VendorL1PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles VendorL1PIC.Click
- StartUp.OpenNewTab(ListMerchant.GetInstance)
- End Sub
- Private Sub BuyL2PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BuyL2PIC.Click
- StartUp.OpenNewTab(NewBuy.GetInstance)
- End Sub
- Private Sub BuyL1PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BuyL1PIC.Click
- StartUp.OpenNewTab(ListBuy.GetInstance)
- End Sub
- Private Sub StoreL4PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL4PIC.Click
- StartUp.OpenNewTab(AdjustStore.GetInstance)
- End Sub
- Private Sub StoreL3PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL3PIC.Click
- StartUp.OpenNewTab(StoreCat.GetInstance)
- End Sub
- Private Sub StoreL2PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL2PIC.Click
- StartUp.OpenNewTab(ListProducts.GetInstance)
- End Sub
- Private Sub StoreL0PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StoreL0PIC.Click
- StartUp.OpenNewTab(NewProduct.GetInstance)
- End Sub
- Private Sub SellL3PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SellL3PIC.Click
- StartUp.OpenNewTab(NewSell.GetInstance)
- End Sub
- Private Sub SellL2PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SellL2PIC.Click
- StartUp.OpenNewTab(ListSell.GetInstance)
- End Sub
- Private Sub SellL1PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SellL1PIC.Click
- StartUp.OpenNewTab(Requests.GetInstance)
- End Sub
- Private Sub CustomerL2PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerL2PIC.Click
- StartUp.OpenNewTab(NewCustomer.GetInstance)
- End Sub
- Private Sub CustomerL1PIC_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerL1PIC.Click
- StartUp.OpenNewTab(ListCustomers.GetInstance)
- End Sub
- End Class