Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Point of sale datagridview help

Status
Not open for further replies.

MrRami

Programmer
Mar 13, 2023
2
JO
Dear Brothers

I designed vb.net points of sale software + sql server
I want a way to check the quantities in the data grid for Promotion items
Example :
If you buy one quantity, the price of the item will be at its normal price. But if you buy three pieces of the same item the price of the three pieces will be at the offer price.
According to the offer related to the item
please help

Thank you very much and for your cooperation

like this : Item Normal Price : 1 Dollar offer qty : 3 offer price : 2
if you buy one total is 1 dollar
if 2 total 2 dollar
if 3 total 1 dollar
 
This should be relatively straight forward in code.

Something along the lines of :

If count(Prd_items) >= 3 then
' ensure this refers to same item and not all items on grid.​
price = prom_price
else
prd_price = normal_price
endif

 
thanks ken01 my code like this
If maindgv.Rows(i).Cells("isoffer").Value = 0 Then
If ListOfOffersBarcodes.Contains(maindgv.Rows(i).Cells("barcode").Value) Then
Dim dtOffer As DataTable = Main_CLS.GetQuery($" Select
IsNull(tbl_OfferMaster.OfferType, -1), IsNull(tbl_OfferMaster.OfferID,-1) ,
IsNull(tbl_OfferMaster.PackQty, 0),Isnull(tbl_OfferMaster.OfferDesc ,'') ,
Isnull(tbl_OfferMaster.PackPrice, 0),
IsNull(tbl_itemmaster.tax, 0),
IsNull(TBl_ITeMmaster.item_number,'')
, TBL_itemBarcode.item_barcode, TBL_OfferDetails.ItemPriceAfter
from tbl_OfferDetails
inner join tbl_OfferMaster On tbl_OfferMaster.OfferID = tbl_OfferDetails.OfferID
and OfferStatus =1 and '{Main_CLS.dobDate.ToString("MM-dd-yyyy")}' between FromDate And todate
inner join TBl_itemBARCODE On TBl_itemBARCODE.item_barcode = ItemBarcode
Inner join TBl_ITeMmaster on TBl_itemBARCODE.item_number = TBl_Itemmaster.item_number
where ItemBarcode = '{maindgv.Rows(i).Cells("barcode").Value }'", Nothing)
Dim OfferType As Integer = dtOffer.Rows(0)(0)
Dim OfferID As Int64 = dtOffer.Rows(0)(1)
Dim OfferQty As Double = dtOffer.Rows(0)(2)
Dim OfferDesc As String = dtOffer.Rows(0)(3)
Dim OfferPrice As Double = dtOffer.Rows(0)(4)
Dim ItemTax As Double = dtOffer.Rows(0)(5)
Dim itemNumber As String = dtOffer.Rows(0)(6).ToString()
Dim itembarcode As String = dtOffer.Rows(0)(7).ToString()
Dim itempriceafter As String = dtOffer.Rows(0)(8).ToString
Dim totaltax As Double = (OfferPrice) - (OfferPrice / (1 + (ItemTax / 100)))


If OfferQty = Convert.ToDouble(maindgv.Rows(i).Cells("itemqty").Value) Then
maindgv.Rows.Add(dtOffer(0)(6).ToString(), dtOffer(0)(3), dtOffer(0)(7), dtOffer(0)(8), OfferQty, dtOffer(0)(4), dtOffer(0)(5), totaltax, 1, dtOffer(0)(1))


ElseIf OfferQty < Convert.ToDouble(maindgv.Rows(i).Cells("itemqty").Value) Then




End If
End If
End If
Next
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top