コード例 #1
0
ファイル: POS.cs プロジェクト: kimykunjun/test
        //end jackie 04/03
        public POSEntries NewReceiptEntry(string strCode, int nCategID, string strDes,
			int nQty, decimal unitPrice, string referenceNo)
        {
            DataRow newEntries = myReceiptItemsTable.NewRow();
            newEntries["strCode"] = strCode;
            if (NCategoryID == 22)
                newEntries["nCategoryID"] = myStaffPurchaseCategoryID;

            if (NCategoryID == 0)
            {
                //Derek Instalment Plan
                MTotalAmount = decimal.Round(unitPrice, 2);
                newEntries["mUnitPrice"] = unitPrice / (1 + myGSTRate);

            }
            else
            {
                newEntries["mUnitPrice"] = unitPrice;
            }

            if(NoCredit != 0)
                newEntries["OldCreditPackge"] = NoCredit;

            newEntries["strDescription"] = strDes;
            //newEntries["strParentReceiptNo"] = strDes;
            newEntries["nQuantity"] = nQty;

            newEntries["strReferenceNo"] = referenceNo;
            newEntries["strReceiptNo"] = this.StrReceiptNo;
            myReceiptItemsTable.Rows.Add(newEntries);
            newEntries["nTempEntryID"] = newEntries["nEntryID"];

            if (NCategoryID == 12)
            {
                if (this.NThisMonthBirthday==1)
                {
                    DialogResult result1 = MessageBox.Show("Member is having birthday this months and having 30% discount. Do you want to utilies?", "Warning",
                    MessageBoxButtons.YesNo);

                    if (result1 == DialogResult.Yes)
                        newEntries["strDiscountCode"] = "090018SPD";
                }
            }

            CalculateSubTotal(newEntries);
            RecalculateAll();

            POSEntries posEntries = new POSEntries(newEntries);
            return posEntries;
        }
コード例 #2
0
ファイル: POS.cs プロジェクト: kimykunjun/test
        public POSEntries NewReceiptEntry(string strCode, int nCategID, string strDes,
			int nQty, decimal unitPrice, string referenceNo,string _strCardHolder,string _strTypeCard
			,string _nCreditCardNo)
        {
            DataRow newEntries = myReceiptItemsTable.NewRow();
            newEntries["strCode"] = strCode;
            if (NCategoryID == 22)
                newEntries["nCategoryID"] = myStaffPurchaseCategoryID;
            newEntries["strDescription"] = strDes;
            newEntries["nQuantity"] = nQty;
            newEntries["mUnitPrice"] = unitPrice;
            newEntries["strReferenceNo"] = referenceNo;
            newEntries["strReceiptNo"] = this.StrReceiptNo;

            myReceiptItemsTable.Rows.Add(newEntries);
            newEntries["nTempEntryID"] = newEntries["nEntryID"];
            CalculateSubTotal(newEntries);
            RecalculateAll();
            POSEntries posEntries = new POSEntries(newEntries);

            if ((NCategoryID == 2) || (NCategoryID == 34))
            {
                DataRow newGiroEntry = myGiroTable.NewRow();
                newGiroEntry["strCardHolderName"] = _strCardHolder;
                newGiroEntry["strTypeofCard"] = _strTypeCard;
                newGiroEntry["nCreditCard"] = _nCreditCardNo;
                //newGiroEntry["dtCreditCardExpired"] = _dtCardExpiration;
                newGiroEntry["strVerificationNo"] = "-";

                int nEntryID = posEntries.NEntryID;
                newGiroEntry["nEntryID"] = nEntryID;
                myGiroTable.Rows.Add(newGiroEntry);

            }
            return posEntries;
        }
コード例 #3
0
ファイル: POS.cs プロジェクト: kimykunjun/test
        public void EditItemFreebieAndDiscount(DataRow freeBieEntryRow, 
			DataRow[] rowsToAddToReceiptItemsFreebieTable,  
			string promotionCode, string discountPromotionCode, bool isPackage)
        {
            // myReceiptItemsTable.Clear();
            int nEntryID = ACMS.Convert.ToInt32(freeBieEntryRow["nEntryID"]);

            if (rowsToAddToReceiptItemsFreebieTable != null &&
                rowsToAddToReceiptItemsFreebieTable.Length > 0 )
            {
                DataRow[] rowsToDelete1 = myReceiptItemsFreebieTable.Select("nEntryID = "+ nEntryID.ToString(), "", DataViewRowState.CurrentRows);
                if (rowsToDelete1.Length > 0)
                {
                    //foreach (DataRow r in rowsToDelete1)
                        //r.Delete();
                }

                DataRow[] rowsToDelete2 = myReceiptItemsPackageTable.Select("nEntryID = "+nEntryID.ToString(), "", DataViewRowState.CurrentRows);
                if (rowsToDelete2.Length > 0)
                {
                    //foreach (DataRow r in rowsToDelete2)
                        //r.Delete();
                }

                foreach (DataRow r in rowsToAddToReceiptItemsFreebieTable)
                {
                    if (isPackage)
                    {
                        for (int i = 0; i < Convert.ToInt16(r["nQuantity"]); i++)
                        {
                            NewItemReceiptFreebies(nEntryID, r["strPackageCode"].ToString(), promotionCode, isPackage);
                        }
                    }
                    else
                    {
                        for (int i = 0; i < Convert.ToInt16(r["nQuantity"]); i++)
                        {
                            NewItemReceiptFreebies(nEntryID, r["strProductCode"].ToString(), promotionCode, isPackage);
                        }
                    }

                }
            }

            POSEntries posEntries = new POSEntries(freeBieEntryRow);
            if (promotionCode != "")
                posEntries.StrFreebieCode = promotionCode;
            if (discountPromotionCode != "")
                posEntries.StrDiscountCode = discountPromotionCode;
        }