Click here to Skip to main content
16,006,845 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: sql and vb.net Pin
Vimalsoft(Pty) Ltd21-Jul-08 4:16
professionalVimalsoft(Pty) Ltd21-Jul-08 4:16 
Questionretail pharmacy management [modified] Pin
kofigyimah18-Jul-08 6:57
kofigyimah18-Jul-08 6:57 
AnswerRe: retail pharmacy management Pin
Paul Conrad18-Jul-08 8:04
professionalPaul Conrad18-Jul-08 8:04 
GeneralRe: retail pharmacy management Pin
kofigyimah18-Jul-08 8:35
kofigyimah18-Jul-08 8:35 
GeneralRe: retail pharmacy management Pin
Paul Conrad18-Jul-08 8:37
professionalPaul Conrad18-Jul-08 8:37 
GeneralRe: retail pharmacy management Pin
kofigyimah18-Jul-08 8:43
kofigyimah18-Jul-08 8:43 
GeneralRe: retail pharmacy management Pin
Paul Conrad18-Jul-08 8:58
professionalPaul Conrad18-Jul-08 8:58 
GeneralRe: retail pharmacy management Pin
kofigyimah18-Jul-08 9:47
kofigyimah18-Jul-08 9:47 
Imports System.Data
Imports System.Data.OracleClient
Public Class POSfrm
Dim lst As ListViewItem
Dim getRow As Integer 'prodDataGridView.CurrentRow.Index
Dim subT As Double
Dim grandT As Double
Dim cnt As Integer = 1
Dim lastitem As Boolean = False

Private Sub Exitbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim strAns As String

strAns = CStr(MsgBox("Are you sure you want to exit this program?", MsgBoxStyle.YesNo + MsgBoxStyle.Question + MsgBoxStyle.DefaultButton2, "Please Confirm"))
If strAns = CStr(MsgBoxResult.Yes) Then
login.Show()
Me.Close()
End If
End Sub

Private Sub POSfrm_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
My.Settings.myForm = Me.Name
End Sub
Private Sub POSfrm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim rpmscmd As New OracleCommand
Dim rpmsds As New DataSet
Dim rpmsda As New OracleDataAdapter

rpmscmd.Connection = rpmscon
rpmscmd.CommandType = CommandType.Text
rpmscmd.CommandText = "select * from products"

rpmsda = New OracleDataAdapter(rpmscmd)
rpmsda.Fill(rpmsds, "products")

prodDataGridView.AutoGenerateColumns = False
prodDataGridView.DataSource = rpmsds
prodDataGridView.DataMember = "products"

End Sub
Private Sub prodDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles prodDataGridView.CellContentClick

End Sub
Private Sub prodDataGridView_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles prodDataGridView.SelectionChanged

getRow = prodDataGridView.CurrentRow.Index
'Dim getindex As Integer = prodDataGridView.CurrentRow.Index
selItemlbl.Text = prodDataGridView.Rows(getRow).Cells.Item(0).Value
End Sub
Private Sub AddItemButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddItemButton.Click
'Dim getRow As Integer = prodDataGridView.CurrentRow.Index
Dim edate As Date = CDate(prodDataGridView.Rows(getRow).Cells.Item(4).Value)
subT = CDbl(prodDataGridView.Rows(getRow).Cells.Item(2).Value)

'Checks the timespan between the expiry date and NOW before it adds the one line of product to-be-sold to list and sales summary
If DetermineNumberofDays(prodDataGridView.Rows(getRow).Cells.Item(4).Value) > 0 Then
'numbers sales list
lst = salesListView.Items.Add(cnt)

'adds product to product column in sales list
lst.SubItems.Add(selItemlbl.Text)

'adds quantity to qty colum in sales list
lst.SubItems.Add(selQtytxb.Text)

'adds the product of selling_price and qty to the cost column in the sales list
lst.SubItems.Add((prodDataGridView.Rows(getRow).Cells.Item(2).Value) * (selQtytxb.Text))

'increases the subTotalLabel by the cost
subTotallbl.Text = CDbl(subTotallbl.Text) + subT
gTotallbl.Text = CDbl(gTotallbl.Text) + subT

If DetermineNumberofDays(prodDataGridView.Rows(getRow).Cells.Item(4).Value) < 30 Then
MsgBox(prodDataGridView.Rows(getRow).Cells.Item(0).Value & " expires on " & edate.ToShortDateString())
End If
cnt = cnt + 1
ElseIf DetermineNumberofDays(prodDataGridView.Rows(getRow).Cells.Item(4).Value) < 0 Then
MsgBox("BEWARE! " & prodDataGridView.Rows(getRow).Cells.Item(0).Value & " expired on " & edate.ToShortDateString() & ". You are not allow to sell it.")
End If
selQtytxb.Text = "1"

End Sub
Private Sub LinkLabel2_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel2.LinkClicked
login.Show()
Me.Close()
End Sub

Private Sub RemoveItemBtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RemoveItemBtn.Click

'If lst.ListView.SelectedItems(0).Index = lst.ListView.Items.Count - 1 Then
' MsgBox("its equal")
' lastitem = True
'End If

For Each lst As ListViewItem In salesListView.SelectedItems
lst.Remove()
cnt = cnt - 1
'subTotallbl.Text = CDbl(subTotallbl.Text) - salesListView.SelectedItems.ToString
Next
Try
'If lastitem = False Then
Dim i As Integer
If cnt > 1 Then

Dim numlist As New ListView
numlist = salesListView
For i = 0 To numlist.Items.Count - 1
numlist.Items(i).Text = i + 1
Next
End If
Catch ex As SystemException
MsgBox(ex.Message)
End Try
'Else
''to reset after last item is deleted
'lastitem = False
'End If

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click



End Sub

Private Sub unPOS_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs)


End Sub

Private Sub unPOS_LinkClicked_1(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles unPOS.LinkClicked
userDetails.Show()
Me.Close()
End Sub
End Class

Kofi

GeneralRe: retail pharmacy management Pin
Paul Conrad18-Jul-08 9:53
professionalPaul Conrad18-Jul-08 9:53 
QuestionHow....!!! Pin
Member 374662918-Jul-08 6:21
Member 374662918-Jul-08 6:21 
AnswerRe: How....!!! Pin
Parwej Ahamad18-Jul-08 6:28
professionalParwej Ahamad18-Jul-08 6:28 
AnswerRe: How....!!! Pin
Paul Conrad18-Jul-08 6:52
professionalPaul Conrad18-Jul-08 6:52 
AnswerRe: How....!!! Pin
darkelv18-Jul-08 7:25
darkelv18-Jul-08 7:25 
GeneralRe: How....!!! Pin
Jon_Boy18-Jul-08 7:35
Jon_Boy18-Jul-08 7:35 
Answerdee Pin
Luc Pattyn18-Jul-08 8:10
sitebuilderLuc Pattyn18-Jul-08 8:10 
QuestionConverting logic that references vb6.mscomm control to use System.IO.SerialPort instead Pin
Jon_Boy18-Jul-08 6:06
Jon_Boy18-Jul-08 6:06 
QuestionAccess to Query Based Distribution Groups Pin
Brian Docherty18-Jul-08 2:40
Brian Docherty18-Jul-08 2:40 
QuestionCheck whether SQL server is installed or not Pin
Rupsaa18-Jul-08 1:33
Rupsaa18-Jul-08 1:33 
AnswerRe: Check whether SQL server is installed or not Pin
CPallini18-Jul-08 1:42
mveCPallini18-Jul-08 1:42 
JokeRe: Check whether SQL server is installed or not Pin
MBCDC20-Jul-08 6:42
MBCDC20-Jul-08 6:42 
AnswerRe: Check whether SQL server is installed or not Pin
jzonthemtn18-Jul-08 2:22
jzonthemtn18-Jul-08 2:22 
AnswerRe: Check whether SQL server is installed or not Pin
Jamal Abdul Nasir18-Jul-08 10:37
Jamal Abdul Nasir18-Jul-08 10:37 
QuestionDriving a Logitech QuickCam Express Pin
taffy_design17-Jul-08 23:04
taffy_design17-Jul-08 23:04 
AnswerRe: Driving a Logitech QuickCam Express Pin
jzonthemtn18-Jul-08 2:32
jzonthemtn18-Jul-08 2:32 
QuestionWord Automation Help Pls using vb6 on client and apsx, vb.net on server 2003 Pin
grasshopper417-Jul-08 21:48
grasshopper417-Jul-08 21:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.