Esempio n. 1
0
		private void SaveRecord()
		{
            RewardPointsDetails clsDetails = new RewardPointsDetails();

            clsDetails.EnableRewardPoints = chkEnableRewardPoints.Checked;
            clsDetails.RoundDownRewardPoints = chkRoundDownRewardPoints.Checked;
            clsDetails.RewardPointsMinimum = Convert.ToDecimal(txtRewardPointsMinimum.Text);
            clsDetails.RewardPointsEvery = Convert.ToDecimal(txtRewardPointsEvery.Text);
            clsDetails.RewardPoints = Convert.ToDecimal(txtRewardPoints.Text);

            clsDetails.EnableRewardPointsAsPayment = chkEnableRewardPointsAsPayment.Checked;
            clsDetails.RewardPointsMaxPercentageForPayment = Convert.ToDecimal(txtRewardPointsMaxPercentageForPayment.Text);
            clsDetails.RewardPointsPaymentValue = Convert.ToDecimal(txtRewardPointsPaymentValue.Text);
            clsDetails.RewardPointsPaymentCashEquivalent = Convert.ToDecimal(txtRewardPointsPaymentCashEquivalent.Text);

			Terminal clsTerminal = new Terminal();
			clsTerminal.UpdateRewardPointSystem(clsDetails);
			clsTerminal.CommitAndDispose();
		}
Esempio n. 2
0
        public RewardPointsDetails RewardPointsDetails()
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "SELECT " +
                                "EnableRewardPoints, " +
                                "RoundDownRewardPoints, " +
                                "RewardPointsMinimum, " +
                                "RewardPointsEvery, " +
                                "RewardPoints, " +
                                "EnableRewardPointsAsPayment, " +
                                "RewardPointsMaxPercentageForPayment, " +
                                "RewardPointsPaymentValue, " +
                                "RewardPointsPaymentCashEquivalent, " +
                                "RewardsPermitNo " +
						    "FROM tblTerminal LIMIT 1 ";

                cmd.CommandText = SQL;
                string strDataTableName = "tbl" + this.GetType().FullName.Split(new Char[] { '.' })[this.GetType().FullName.Split(new Char[] { '.' }).Length - 1]; System.Data.DataTable dt = new System.Data.DataTable(strDataTableName);
                base.MySqlDataAdapterFill(cmd, dt);

                RewardPointsDetails clsRewardPointsDetails = new RewardPointsDetails();
                foreach(System.Data.DataRow dr in dt.Rows)
                {
                    clsRewardPointsDetails.EnableRewardPoints = bool.Parse(dr["EnableRewardPoints"].ToString());
                    clsRewardPointsDetails.RoundDownRewardPoints = bool.Parse(dr["RoundDownRewardPoints"].ToString());
                    clsRewardPointsDetails.RewardPointsMinimum = decimal.Parse(dr["RewardPointsMinimum"].ToString());
                    clsRewardPointsDetails.RewardPointsEvery = decimal.Parse(dr["RewardPointsEvery"].ToString());
                    clsRewardPointsDetails.RewardPoints = decimal.Parse(dr["RewardPoints"].ToString());
                    clsRewardPointsDetails.EnableRewardPointsAsPayment = bool.Parse(dr["EnableRewardPointsAsPayment"].ToString());
                    clsRewardPointsDetails.RewardPointsMaxPercentageForPayment = decimal.Parse(dr["RewardPointsMaxPercentageForPayment"].ToString());
                    clsRewardPointsDetails.RewardPointsPaymentValue = decimal.Parse(dr["RewardPointsPaymentValue"].ToString());
                    clsRewardPointsDetails.RewardPointsPaymentCashEquivalent = decimal.Parse(dr["RewardPointsPaymentCashEquivalent"].ToString());
                    clsRewardPointsDetails.RewardsPermitNo = dr["RewardsPermitNo"].ToString();
                }

                return clsRewardPointsDetails;
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Esempio n. 3
0
        private TerminalDetails SetDetails(System.Data.DataTable dt)
        {
            int iPersonalChargeTypeID = 0;
            int iGroupChargeTypeID = 0;

            TerminalDetails Details = new TerminalDetails();

            foreach(System.Data.DataRow dr in dt.Rows)
            {
                Details.BranchID = Int32.Parse(dr["BranchID"].ToString());
                Details.TerminalID = Int32.Parse(dr["TerminalID"].ToString());
                Details.TerminalNo = dr["TerminalNo"].ToString();
                Details.TerminalCode = dr["TerminalCode"].ToString();
                Details.TerminalName = dr["TerminalName"].ToString();
                Details.Status = (TerminalStatus)Enum.Parse(typeof(TerminalStatus), dr["Status"].ToString());
                Details.DateCreated = DateTime.Parse(dr["DateCreated"].ToString());
                Details.IsPrinterAutoCutter = bool.Parse(dr["IsPrinterAutoCutter"].ToString());
                Details.MaxReceiptWidth = Int16.Parse(dr["MaxReceiptWidth"].ToString());
                Details.TransactionNoLength = Int16.Parse(dr["TransactionNoLength"].ToString());
                Details.AutoPrint = (PrintingPreference)Enum.Parse(typeof(PrintingPreference), dr["AutoPrint"].ToString());
                Details.IsVATInclusive = bool.Parse(dr["IsVATInclusive"].ToString());
                Details.PrinterName = dr["PrinterName"].ToString();
                Details.TurretName = dr["TurretName"].ToString();
                Details.CashDrawerName = dr["CashDrawerName"].ToString();
                Details.MachineSerialNo = dr["MachineSerialNo"].ToString();
                Details.AccreditationNo = dr["AccreditationNo"].ToString();
                Details.ItemVoidConfirmation = bool.Parse(dr["ItemVoidConfirmation"].ToString());
                Details.EnableEVAT = bool.Parse(dr["EnableEVAT"].ToString());
                Details.FORM_Behavior = dr["FORM_Behavior"].ToString();
                Details.MarqueeMessage = dr["MarqueeMessage"].ToString();
                Details.TrustFund = decimal.Parse(dr["TrustFund"].ToString());
                Details.VAT = decimal.Parse(dr["VAT"].ToString());
                Details.EVAT = decimal.Parse(dr["EVAT"].ToString());
                Details.LocalTax = decimal.Parse(dr["LocalTax"].ToString());
                Details.ShowItemMoreThanZeroQty = bool.Parse(dr["ShowItemMoreThanZeroQty"].ToString());
                Details.ShowOnlyPackedTransactions = bool.Parse(dr["ShowOnlyPackedTransactions"].ToString());
                Details.ShowOneTerminalSuspendedTransactions = bool.Parse(dr["ShowOneTerminalSuspendedTransactions"].ToString());
                Details.ReceiptType = (TerminalReceiptType)Enum.Parse(typeof(TerminalReceiptType), dr["TerminalReceiptType"].ToString());
                Details.SalesInvoicePrinterName = dr["SalesInvoicePrinterName"].ToString();
                Details.CashCountBeforeReport = bool.Parse(dr["CashCountBeforeReport"].ToString());
                Details.PreviewTerminalReport = bool.Parse(dr["PreviewTerminalReport"].ToString());
                
                // Added May 5, 2009
                Details.IsPrinterDotMatrix = bool.Parse(dr["IsPrinterDotMatrix"].ToString());
                Details.IsChargeEditable = bool.Parse(dr["IsChargeEditable"].ToString());
                Details.IsDiscountEditable = bool.Parse(dr["IsDiscountEditable"].ToString());
                Details.CheckCutOffTime = bool.Parse(dr["CheckCutOffTime"].ToString());
                Details.StartCutOffTime = dr["StartCutOffTime"].ToString();
                Details.EndCutOffTime = dr["EndCutOffTime"].ToString();
                Details.WithRestaurantFeatures = bool.Parse(dr["WithRestaurantFeatures"].ToString());

                // Added Nov 8, 2011
                Details.IsFineDining = bool.Parse(dr["IsFineDIning"].ToString());

                // -- end
                
                Details.SeniorCitizenDiscountCode = dr["SeniorCitizenDiscountCode"].ToString();
                Details.PWDDiscountCode = dr["PWDDiscountCode"].ToString();

                // Added May 21, 2009
                Details.IsTouchScreen = bool.Parse(dr["IsTouchScreen"].ToString());

                // Added June 1, 2010
                Details.WillContinueSelectionVariation = bool.Parse(dr["WillContinueSelectionVariation"].ToString());
                Details.WillContinueSelectionProduct = bool.Parse(dr["WillContinueSelectionProduct"].ToString());

                // Added July 9, 2010
                Details.WSPriceMarkUp = decimal.Parse(dr["WSPriceMarkUp"].ToString());
                Details.RETPriceMarkUp = decimal.Parse(dr["RETPriceMarkUp"].ToString());

                // Added Sep 21, 2010
                Details.WillPrintGrandTotal = bool.Parse(dr["WillPrintGrandTotal"].ToString());

                // Added Apr 12, 2011
                Details.ReservedAndCommit = bool.Parse(dr["ReservedAndCommit"].ToString());       
         
                // Added Sep 10, 2011
                Details.DBVersion = dr["DBVersion"].ToString();

                // Added Oct 17, 2011
                Details.ShowCustomerSelection = bool.Parse(dr["ShowCustomerSelection"].ToString());
                Details.AutoGenerateRewardCardNo = bool.Parse(dr["AutoGenerateRewardCardNo"].ToString());

                // Added Oct 17, 2011 
                RewardPointsDetails clsRewardPointsDetails = new RewardPointsDetails();
                clsRewardPointsDetails.EnableRewardPoints = bool.Parse(dr["EnableRewardPoints"].ToString());
                clsRewardPointsDetails.RoundDownRewardPoints = bool.Parse(dr["RoundDownRewardPoints"].ToString());
                clsRewardPointsDetails.RewardPointsMinimum = decimal.Parse(dr["RewardPointsMinimum"].ToString());
                clsRewardPointsDetails.RewardPointsEvery = decimal.Parse(dr["RewardPointsEvery"].ToString());
                clsRewardPointsDetails.RewardPoints = decimal.Parse(dr["RewardPoints"].ToString());
                // Added Nov 4, 2011 :  For use as payment
                clsRewardPointsDetails.EnableRewardPointsAsPayment = bool.Parse(dr["EnableRewardPointsAsPayment"].ToString());
                clsRewardPointsDetails.RewardPointsMaxPercentageForPayment = decimal.Parse(dr["RewardPointsMaxPercentageForPayment"].ToString());
                clsRewardPointsDetails.RewardPointsPaymentValue = decimal.Parse(dr["RewardPointsPaymentValue"].ToString());
                clsRewardPointsDetails.RewardPointsPaymentCashEquivalent = decimal.Parse(dr["RewardPointsPaymentCashEquivalent"].ToString());
                clsRewardPointsDetails.RewardsPermitNo = dr["RewardsPermitNo"].ToString();

                Details.RewardPointsDetails = clsRewardPointsDetails;

                //Details.InHouseIndividualCreditPermitNo = dr["InHouseIndividualCreditPermitNo"].ToString();
                //Details.InHouseGroupCreditPermitNo = dr["InHouseGroupCreditPermitNo"].ToString();

                iPersonalChargeTypeID = Int32.Parse(dr["PersonalChargeTypeID"].ToString());
                iGroupChargeTypeID = Int32.Parse(dr["GroupChargeTypeID"].ToString());

                // Added Mar 18, 2012
                Details.ProductSearchType = (ProductSearchType)Enum.Parse(typeof(ProductSearchType), dr["ProductSearchType"].ToString());
                
                // Added Apr 29, 2013
                Details.IncludeCreditChargeAgreement = bool.Parse(dr["IncludeCreditChargeAgreement"].ToString());

                // Added Jun 30, 2013
                Details.IsParkingTerminal = bool.Parse(dr["IsParkingTerminal"].ToString());

                Details.WillPrintChargeSlip = bool.Parse(dr["WillPrintChargeSlip"].ToString());
                Details.WillPrintVoidItem = bool.Parse(dr["WillPrintVoidItem"].ToString());

                // Added Oct 20, 2013
                Details.IncludeTermsAndConditions = bool.Parse(dr["IncludeTermsAndConditions"].ToString());

                Details.DefaultTransactionChargeCode = dr["DefaultTransactionChargeCode"].ToString();
                Details.DineInChargeCode = dr["DineInChargeCode"].ToString();
                Details.TakeOutChargeCode = dr["TakeOutChargeCode"].ToString();
                Details.DeliveryChargeCode = dr["DeliveryChargeCode"].ToString();
                Details.ORSeriesBranchID = Int32.Parse(dr["ORSeriesBranchID"].ToString());
                Details.ORSeriesTerminalNo = dr["ORSeriesTerminalNo"].ToString();

                // Added Jul 4, 2015
                Details.MultiInstanceEnabled = bool.Parse(dr["MultiInstanceEnabled"].ToString());
                Details.MaskProductSearch = dr["MaskProductSearch"].ToString().Replace('*', '%');
            }

            Branch clsBranch = new Branch(base.Connection, base.Transaction);
            Details.BranchDetails = clsBranch.Details(Convert.ToInt16(Details.BranchID));

            ChargeType clsChargeType = new ChargeType(base.Connection, base.Transaction);
            if (iPersonalChargeTypeID != 0)
            { Details.PersonalChargeType = clsChargeType.Details(iPersonalChargeTypeID); }

            if (iGroupChargeTypeID != 0)
            { Details.GroupChargeType = clsChargeType.Details(iGroupChargeTypeID); }

            return Details;
        }
Esempio n. 4
0
        public void UpdateRewardPointSystem(RewardPointsDetails Details)
        {
            try
            {
                string SQL = "CALL procTerminalUpdateRewardPointSystem(@EnableRewardPoints, " +
                                                    "@RoundDownRewardPoints, " +
                                                    "@RewardPointsMinimum," +
                                                    "@RewardPointsEvery," +
                                                    "@RewardPoints," +
                                                    "@EnableRewardPointsAsPayment," +
                                                    "@RewardPointsMaxPercentageForPayment," +
                                                    "@RewardPointsPaymentValue," +
                                                    "@RewardPointsPaymentCashEquivalent);";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@EnableRewardPoints", Convert.ToInt16(Details.EnableRewardPoints));
                cmd.Parameters.AddWithValue("@RoundDownRewardPoints", Convert.ToInt16(Details.RoundDownRewardPoints));
                cmd.Parameters.AddWithValue("@RewardPointsMinimum", Details.RewardPointsMinimum);
                cmd.Parameters.AddWithValue("@RewardPointsEvery", Details.RewardPointsEvery);
                cmd.Parameters.AddWithValue("@RewardPoints", Details.RewardPoints);
                cmd.Parameters.AddWithValue("@EnableRewardPointsAsPayment", Convert.ToInt16(Details.EnableRewardPointsAsPayment));
                cmd.Parameters.AddWithValue("@RewardPointsMaxPercentageForPayment", Details.RewardPointsMaxPercentageForPayment);
                cmd.Parameters.AddWithValue("@RewardPointsPaymentValue", Details.RewardPointsPaymentValue);
                cmd.Parameters.AddWithValue("@RewardPointsPaymentCashEquivalent", Details.RewardPointsPaymentCashEquivalent);

                base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }