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

            clsDetails.BranchID = Convert.ToInt32(lblBranchID.Text);
			clsDetails.TerminalID = Convert.ToInt32(lblTerminalID.Text);
			clsDetails.TerminalNo = txtTerminalNo.Text;
			clsDetails.TerminalCode = txtTerminalCode.Text;
			clsDetails.TerminalName = txtTerminalName.Text;
			clsDetails.Status = 0; 
			clsDetails.DateCreated = Convert.ToDateTime(txtDateCreated.Text);
			clsDetails.MachineSerialNo = txtMachineSerialNo.Text;
			clsDetails.AccreditationNo = txtAccreditationNo.Text;
			clsDetails.IsPrinterAutoCutter = Convert.ToBoolean(chkIsPrinterAutoCutter.Checked);
			clsDetails.AutoPrint = (PrintingPreference) Enum.Parse(typeof(PrintingPreference), cboAutoPrint.SelectedItem.Value);
			clsDetails.IsVATInclusive = Convert.ToBoolean(chkIsVATInclusive.Checked);
			clsDetails.PrinterName = txtPrinterName.Text;
			clsDetails.TurretName = txtTurretName.Text;
			clsDetails.CashDrawerName = txtCashDrawerName.Text;
			clsDetails.ItemVoidConfirmation = Convert.ToBoolean(chkItemVoidConfirmation.Checked);
			clsDetails.EnableEVAT = Convert.ToBoolean(chkEnableEVAT.Checked);
			clsDetails.MaxReceiptWidth = Convert.ToInt16(txtMaxReceiptWidth.Text);
			clsDetails.FORM_Behavior = cboFormBehaviour.SelectedItem.Value;
			clsDetails.MarqueeMessage = txtMarqueeMessage.Text;

            // Added May 6, 2009.
            clsDetails.VAT = Convert.ToDecimal(txtVAT.Text);
            clsDetails.EVAT = Convert.ToDecimal(txtEVAT.Text);
            clsDetails.LocalTax = Convert.ToDecimal(txtLocalTax.Text);
            clsDetails.ShowItemMoreThanZeroQty = chkShowItemMoreThanZeroQty.Checked;
            clsDetails.ShowOnlyPackedTransactions = chkShowOnlyPackedTransactions.Checked;
            clsDetails.ShowOneTerminalSuspendedTransactions = chkShowOneTerminalSuspendedTransactions.Checked;
            clsDetails.ReceiptType = (TerminalReceiptType)Enum.Parse(typeof(TerminalReceiptType), cboReceiptType.SelectedItem.Value);
            clsDetails.SalesInvoicePrinterName = txtSalesInvoicePrinterName.Text;
            clsDetails.CashCountBeforeReport = chkCashCountBeforeReport.Checked;
            clsDetails.PreviewTerminalReport = chkPreviewTerminalReport.Checked;

            // Added May 6, 2009.
            clsDetails.IsPrinterDotMatrix = chkIsPrinterDotmatrix.Checked;
            clsDetails.IsChargeEditable = chkIsChargeEditable.Checked;
            clsDetails.IsDiscountEditable = chkIsDiscountEditable.Checked;
            clsDetails.CheckCutOffTime = chkCheckCutOffTime.Checked;
            clsDetails.StartCutOffTime = txtStartCutOffTime.Text;
            clsDetails.EndCutOffTime = txtEndCutOffTime.Text;
            clsDetails.WithRestaurantFeatures = chkWithRestaurantFeatures.Checked;
            
            clsDetails.SeniorCitizenDiscountCode = cboDiscountCode.SelectedItem.Value;
            clsDetails.PWDDiscountCode = cboPWDDiscountCode.SelectedItem.Value;
            // Added May 21, 2009
            clsDetails.IsTouchScreen = chkIsTouchScreen.Checked;

            // Added June 1, 2010
            clsDetails.WillContinueSelectionVariation = chkWillContinueSelectionVariation.Checked;
            
            // Added June 15, 2010
            clsDetails.WillContinueSelectionProduct = chkWillContinueSelectionProduct.Checked;

            // Added Sep 21, 2010
            clsDetails.WillPrintGrandTotal = chkWillPrintGrandTotal.Checked;

            // Added Apr 12, 2011
            clsDetails.ReservedAndCommit = chkReservedAndCommit.Checked;

            // Added Oct 17, 2011
            clsDetails.ShowCustomerSelection = chkShowCustomerSelection.Checked;

            clsDetails.GroupChargeType = new ChargeTypeDetails()
            {
                ChargeTypeID = int.Parse(cboGroupChargeType.SelectedItem.Value),
                ChargeTypeCode = cboGroupChargeType.SelectedItem.Text
            };
            clsDetails.PersonalChargeType = new ChargeTypeDetails()
            {
                ChargeTypeID = int.Parse(cboPersonalChargeType.SelectedItem.Value),
                ChargeTypeCode = cboPersonalChargeType.SelectedItem.Text
            };

            // Added Sep 24, 2014
            clsDetails.DefaultTransactionChargeCode = cboDefaultTransactionChargeCode.SelectedItem.Value;
            clsDetails.DineInChargeCode = cboDineInChargeCode.SelectedItem.Value;
            clsDetails.TakeOutChargeCode = cboTakeOutChargeCode.SelectedItem.Value;
            clsDetails.DeliveryChargeCode = cboDeliveryChargeCode.SelectedItem.Value;

			Terminal clsTerminal = new Terminal();
			clsTerminal.Update(clsDetails);
			clsTerminal.CommitAndDispose();
		}
Esempio n. 2
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. 3
0
        /// <summary>
        /// Sep 4, 2014 Remove coz this is redundant
        /// </summary>
        /// <param name="Details"></param>
        /// <returns></returns>
        //public Int16 Insert(TerminalDetails Details)
        //{
        //    try
        //    {
        //        string SQL="INSERT INTO tblTerminal(" +
        //                        "BranchID, " +
        //                        "TerminalNo, " +
        //                        "TerminalCode, " +
        //                        "TerminalName, " +
        //                        "Status, " +
        //                        "DateCreated, " +
        //                        "MachineSerialNo, " +
        //                        "AccreditationNo " +
        //                    ")VALUES(" +
        //                        "@BranchID, " +
        //                        "@TerminalNo, " +
        //                        "@TerminalCode, " +
        //                        "@TerminalName, " +
        //                        "@Status, " +
        //                        "NOW(), " +
        //                        "@MachineSerialNo, " +
        //                        "@AccreditationNo" +
        //                    ");";
				
	 			
        //        MySqlCommand cmd = new MySqlCommand();
        //        cmd.CommandType = System.Data.CommandType.Text;
        //        cmd.CommandText = SQL;

        //        MySqlParameter prmBranchID = new MySqlParameter("@BranchID",MySqlDbType.Int32);
        //        prmBranchID.Value = Details.BranchID;
        //        cmd.Parameters.Add(prmBranchID);

        //        MySqlParameter prmTerminalNo = new MySqlParameter("@TerminalNo",MySqlDbType.String);			
        //        prmTerminalNo.Value = Details.TerminalNo;
        //        cmd.Parameters.Add(prmTerminalNo);

        //        MySqlParameter prmTerminalCode = new MySqlParameter("@TerminalCode",MySqlDbType.String);			
        //        prmTerminalCode.Value = Details.TerminalCode;
        //        cmd.Parameters.Add(prmTerminalCode);

        //        MySqlParameter prmTerminalName = new MySqlParameter("@TerminalName",MySqlDbType.String);			
        //        prmTerminalName.Value = Details.TerminalName;
        //        cmd.Parameters.Add(prmTerminalName);
				
        //        MySqlParameter prmStatus = new MySqlParameter("@Status",MySqlDbType.Int16);
        //        prmStatus.Value = Details.Status.ToString("d");
        //        cmd.Parameters.Add(prmStatus);

        //        MySqlParameter prmDateCreated = new MySqlParameter("@DateCreated",MySqlDbType.DateTime);
        //        prmDateCreated.Value = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
        //        cmd.Parameters.Add(prmDateCreated);

        //        MySqlParameter prmMachineSerialNo = new MySqlParameter("@MachineSerialNo",MySqlDbType.String);			
        //        prmMachineSerialNo.Value = Details.MachineSerialNo;
        //        cmd.Parameters.Add(prmMachineSerialNo);

        //        MySqlParameter prmAccreditationNo = new MySqlParameter("@AccreditationNo",MySqlDbType.String);			
        //        prmAccreditationNo.Value = Details.AccreditationNo;
        //        cmd.Parameters.Add(prmAccreditationNo);

        //        base.ExecuteNonQuery(cmd);

        //        SQL = "SELECT LAST_INSERT_ID();";
				
        //        cmd.Parameters.Clear(); 
        //        cmd.CommandText = SQL;

        //        System.Data.DataTable dt = new System.Data.DataTable("LAST_INSERT_ID");
        //        base.MySqlDataAdapterFill(cmd, dt);
                

        //        Int16 iID = 0;
        //        foreach (System.Data.DataRow dr in dt.Rows)
        //        {
        //            iID = Int16.Parse(dr[0].ToString());
        //        }

        //        TerminalReport clsTerminalReport = new TerminalReport(base.Connection, base.Transaction);
        //        clsTerminalReport.Insert(Details.BranchID, iID, CompanyDetails.TerminalNo);

        //        return iID;
        //    }

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

		public void Update(TerminalDetails Details)
		{
			try 
			{
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "CALL procTerminalUpdate(@BranchID, @TerminalID, " +
                                                    "@IsPrinterAutoCutter, " +
                                                    "@AutoPrint, " +
                                                    "@IsVATInclusive, " +
                                                    "@PrinterName, " +
                                                    "@TurretName, " +
                                                    "@CashDrawerName, " +
                                                    "@ItemVoidConfirmation, " +
                                                    "@EnableEVAT, " +
                                                    "@MaxReceiptWidth, " +
                                                    "@FORM_Behavior, " +
                                                    "@MarqueeMessage, " +
                                                    "@MachineSerialNo, " +
                                                    "@AccreditationNo, " +
                                                    "@VAT, " +
                                                    "@EVAT, " +
                                                    "@LocalTax, " +
                                                    "@ShowItemMoreThanZeroQty, " +
                                                    "@ShowOnlyPackedTransactions, " +
                                                    "@ShowOneTerminalSuspendedTransactions, " +
                                                    "@ReceiptType, " +
                                                    "@SalesInvoicePrinterName, " +
                                                    "@CashCountBeforeReport, " +
                                                    "@PreviewTerminalReport, " +
                                                    "@IsPrinterDotMatrix, " +
                                                    "@IsChargeEditable, " +
                                                    "@IsDiscountEditable, " +
                                                    "@CheckCutOffTime, " +
                                                    "@StartCutOffTime, " +
                                                    "@EndCutOffTime, " +
                                                    "@WithRestaurantFeatures, " +
                                                    "@SeniorCitizenDiscountCode, " +
                                                    "@PWDDiscountCode, " +
                                                    "@GroupChargeType, " +
                                                    "@PersonalChargeType, " +
                                                    "@DefaultTransactionChargeCode, " +
                                                    "@DineInChargeCode, " +
                                                    "@TakeOutChargeCode, " +
                                                    "@DeliveryChargeCode, " +
                                                    "@IsTouchScreen," +
                                                    "@WillContinueSelectionVariation," +
                                                    "@WillContinueSelectionProduct," +
                                                    "@WillPrintGrandTotal," +
                                                    "@ReservedAndCommit," +
                                                    "@ShowCustomerSelection);";
				  
				cmd.Parameters.AddWithValue("BranchID", Details.BranchID);
                cmd.Parameters.AddWithValue("TerminalID", Details.TerminalID);
                cmd.Parameters.AddWithValue("IsPrinterAutoCutter", Details.IsPrinterAutoCutter);
                cmd.Parameters.AddWithValue("AutoPrint", Details.AutoPrint.ToString("d"));
                cmd.Parameters.AddWithValue("IsVATInclusive", Details.IsVATInclusive);
                cmd.Parameters.AddWithValue("PrinterName", Details.PrinterName);
                cmd.Parameters.AddWithValue("TurretName", Details.TurretName);
                cmd.Parameters.AddWithValue("CashDrawerName", Details.CashDrawerName);
                cmd.Parameters.AddWithValue("MaxReceiptWidth", Details.MaxReceiptWidth);
                cmd.Parameters.AddWithValue("ItemVoidConfirmation", Details.ItemVoidConfirmation);
				cmd.Parameters.AddWithValue("EnableEVAT", Details.EnableEVAT);
                cmd.Parameters.AddWithValue("FORM_Behavior", Details.FORM_Behavior);
                cmd.Parameters.AddWithValue("MarqueeMessage", Details.MarqueeMessage);
                cmd.Parameters.AddWithValue("MachineSerialNo", Details.MachineSerialNo);
                cmd.Parameters.AddWithValue("AccreditationNo", Details.AccreditationNo);
                cmd.Parameters.AddWithValue("VAT", Details.VAT);
                cmd.Parameters.AddWithValue("EVAT", Details.EVAT);
                cmd.Parameters.AddWithValue("LocalTax", Details.LocalTax);
                cmd.Parameters.AddWithValue("ShowItemMoreThanZeroQty", Details.ShowItemMoreThanZeroQty);
                cmd.Parameters.AddWithValue("ShowOnlyPackedTransactions", Details.ShowOnlyPackedTransactions);
                cmd.Parameters.AddWithValue("ShowOneTerminalSuspendedTransactions", Details.ShowOneTerminalSuspendedTransactions);
                cmd.Parameters.AddWithValue("ReceiptType", Details.ReceiptType.ToString("d"));
                cmd.Parameters.AddWithValue("SalesInvoicePrinterName", Details.SalesInvoicePrinterName);
                cmd.Parameters.AddWithValue("CashCountBeforeReport", Details.CashCountBeforeReport);
                cmd.Parameters.AddWithValue("PreviewTerminalReport", Details.PreviewTerminalReport);
                cmd.Parameters.AddWithValue("IsPrinterDotMatrix", Details.IsPrinterDotMatrix);
                cmd.Parameters.AddWithValue("IsChargeEditable", Details.IsChargeEditable);
                cmd.Parameters.AddWithValue("IsDiscountEditable", Details.IsDiscountEditable);
                cmd.Parameters.AddWithValue("CheckCutOffTime", Details.CheckCutOffTime);
                cmd.Parameters.AddWithValue("StartCutOffTime", Details.StartCutOffTime);
                cmd.Parameters.AddWithValue("EndCutOffTime", Details.EndCutOffTime);
                cmd.Parameters.AddWithValue("WithRestaurantFeatures", Details.WithRestaurantFeatures);
                cmd.Parameters.AddWithValue("SeniorCitizenDiscountCode", Details.SeniorCitizenDiscountCode);
                cmd.Parameters.AddWithValue("PWDDiscountCode", Details.PWDDiscountCode);
                cmd.Parameters.AddWithValue("GroupChargeType", Details.GroupChargeType.ChargeTypeID);
                cmd.Parameters.AddWithValue("PersonalChargeType", Details.PersonalChargeType.ChargeTypeID);
                cmd.Parameters.AddWithValue("DefaultTransactionChargeCode", Details.DefaultTransactionChargeCode);
                cmd.Parameters.AddWithValue("DineInChargeCode", Details.DineInChargeCode);
                cmd.Parameters.AddWithValue("TakeOutChargeCode", Details.TakeOutChargeCode);
                cmd.Parameters.AddWithValue("DeliveryChargeCode", Details.DeliveryChargeCode);
                cmd.Parameters.AddWithValue("IsTouchScreen", Details.IsTouchScreen);
                cmd.Parameters.AddWithValue("WillContinueSelectionVariation", Details.WillContinueSelectionVariation);
                cmd.Parameters.AddWithValue("WillContinueSelectionProduct", Details.WillContinueSelectionProduct);
                cmd.Parameters.AddWithValue("WillPrintGrandTotal", Details.WillPrintGrandTotal);
                cmd.Parameters.AddWithValue("ReservedAndCommit", Details.ReservedAndCommit);
                cmd.Parameters.AddWithValue("ShowCustomerSelection", Details.ShowCustomerSelection);

                cmd.CommandText = SQL;
                base.ExecuteNonQuery(cmd);
			}

			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}
Esempio n. 4
0
        public Int32 Save(TerminalDetails Details)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "CALL procSaveTerminal(@TerminalID, @TerminalNo, @TerminalCode, @TerminalName, @Status, @DateCreated, " +
                                "@IsPrinterAutoCutter, @MaxReceiptWidth, @TransactionNoLength, @AutoPrint, @PrinterName, " +
                                "@TurretName, @CashDrawerName, @MachineSerialNo, @AccreditationNo, @ItemVoidConfirmation, " +
                                "@EnableEVAT, @FORM_Behavior, @MarqueeMessage, @TrustFund, @IsVATInclusive, @VAT, @EVAT, " +
                                "@LocalTax, @ShowItemMoreThanZeroQty, @ShowOneTerminalSuspendedTransactions, " +
                                "@ShowOnlyPackedTransactions, @TerminalReceiptType, @SalesInvoicePrinterName, " +
                                "@CashCountBeforeReport, @PreviewTerminalReport, @OrderSlipPrinter, @DBVersion, @FEVersion, " +
                                "@BEVersion, @IsPrinterDotmatrix, @IsChargeEditable, @IsDiscountEditable, @CheckCutOffTime, " +
                                "@StartCutOffTime, @EndCutOffTime, @WithRestaurantFeatures, @SeniorCitizenDiscountCode, " +
                                "@IsTouchScreen, @WillContinueSelectionVariation, @WillContinueSelectionProduct, " +
                                "@RETPriceMarkUp, @WSPriceMarkUp, @WillPrintGrandTotal, @ReservedAndCommit, " +
                                "@ShowCustomerSelection, @EnableRewardPoints, @RewardPointsMinimum, @RewardPointsEvery, " +
                                "@RewardPoints, @RoundDownRewardPoints, @AutoGenerateRewardCardNo,  " +
                                "@EnableRewardPointsAsPayment, @RewardPointsMaxPercentageForPayment, " +
                                "@RewardPointsPaymentValue, @RewardPointsPaymentCashEquivalent, @RewardsPermitNo, " +
                                "@IsFineDining, " +
                                //"@InHouseIndividualCreditPermitNo, @InHouseGroupCreditPermitNo, @IsFineDining, " +
                                "@PersonalChargeTypeID, @GroupChargeTypeID, @BranchID, @ProductSearchType, " +
                                "@IncludeCreditChargeAgreement, @IsParkingTerminal, @WillPrintChargeSlip, @WillPrintVoidItem, " +
                                "@IncludeTermsAndConditions, @PWDDiscountCode, @DefaultTransactionChargeCode, @DineInChargeCode, " +
                                "@TakeOutChargeCode, @DeliveryChargeCode, @CreatedOn, @LastModified);";

                cmd.Parameters.AddWithValue("TerminalID", Details.TerminalID);
                cmd.Parameters.AddWithValue("TerminalNo", Details.TerminalNo);
                cmd.Parameters.AddWithValue("TerminalCode", Details.TerminalCode);
                cmd.Parameters.AddWithValue("TerminalName", Details.TerminalName);
                cmd.Parameters.AddWithValue("Status", Details.Status);
                cmd.Parameters.AddWithValue("DateCreated", Details.DateCreated);
                cmd.Parameters.AddWithValue("IsPrinterAutoCutter", Details.IsPrinterAutoCutter);
                cmd.Parameters.AddWithValue("MaxReceiptWidth", Details.MaxReceiptWidth);
                cmd.Parameters.AddWithValue("TransactionNoLength", Details.TransactionNoLength);
                cmd.Parameters.AddWithValue("AutoPrint", Details.AutoPrint);
                cmd.Parameters.AddWithValue("PrinterName", Details.PrinterName);
                cmd.Parameters.AddWithValue("TurretName", Details.TurretName);
                cmd.Parameters.AddWithValue("CashDrawerName", Details.CashDrawerName);
                cmd.Parameters.AddWithValue("MachineSerialNo", Details.MachineSerialNo);
                cmd.Parameters.AddWithValue("AccreditationNo", Details.AccreditationNo);
                cmd.Parameters.AddWithValue("ItemVoidConfirmation", Details.ItemVoidConfirmation);
                cmd.Parameters.AddWithValue("EnableEVAT", Details.EnableEVAT);
                cmd.Parameters.AddWithValue("FORM_Behavior", Details.FORM_Behavior);
                cmd.Parameters.AddWithValue("MarqueeMessage", Details.MarqueeMessage);
                cmd.Parameters.AddWithValue("TrustFund", Details.TrustFund);
                cmd.Parameters.AddWithValue("IsVATInclusive", Details.IsVATInclusive);
                cmd.Parameters.AddWithValue("VAT", Details.VAT);
                cmd.Parameters.AddWithValue("EVAT", Details.EVAT);
                cmd.Parameters.AddWithValue("LocalTax", Details.LocalTax);
                cmd.Parameters.AddWithValue("ShowItemMoreThanZeroQty", Details.ShowItemMoreThanZeroQty);
                cmd.Parameters.AddWithValue("ShowOneTerminalSuspendedTransactions", Details.ShowOneTerminalSuspendedTransactions);
                cmd.Parameters.AddWithValue("ShowOnlyPackedTransactions", Details.ShowOnlyPackedTransactions);
                cmd.Parameters.AddWithValue("TerminalReceiptType", Details.ReceiptType.ToString("d"));
                cmd.Parameters.AddWithValue("SalesInvoicePrinterName", Details.SalesInvoicePrinterName);
                cmd.Parameters.AddWithValue("CashCountBeforeReport", Details.CashCountBeforeReport);
                cmd.Parameters.AddWithValue("PreviewTerminalReport", Details.PreviewTerminalReport);
                cmd.Parameters.AddWithValue("OrderSlipPrinter", Details.OrderSlipPrinter.ToString("d"));
                cmd.Parameters.AddWithValue("DBVersion", Details.DBVersion);
                cmd.Parameters.AddWithValue("FEVersion", Details.FEVersion);
                cmd.Parameters.AddWithValue("BEVersion", Details.BEVersion);
                cmd.Parameters.AddWithValue("IsPrinterDotMatrix", Details.IsPrinterDotMatrix);
                cmd.Parameters.AddWithValue("IsChargeEditable", Details.IsChargeEditable);
                cmd.Parameters.AddWithValue("IsDiscountEditable", Details.IsDiscountEditable);
                cmd.Parameters.AddWithValue("CheckCutOffTime", Details.CheckCutOffTime);
                cmd.Parameters.AddWithValue("StartCutOffTime", Details.StartCutOffTime);
                cmd.Parameters.AddWithValue("EndCutOffTime", Details.EndCutOffTime);
                cmd.Parameters.AddWithValue("WithRestaurantFeatures", Details.WithRestaurantFeatures);
                cmd.Parameters.AddWithValue("SeniorCitizenDiscountCode", Details.SeniorCitizenDiscountCode);
                cmd.Parameters.AddWithValue("IsTouchScreen", Details.IsTouchScreen);
                cmd.Parameters.AddWithValue("WillContinueSelectionVariation", Details.WillContinueSelectionVariation);
                cmd.Parameters.AddWithValue("WillContinueSelectionProduct", Details.WillContinueSelectionProduct);
                cmd.Parameters.AddWithValue("RETPriceMarkUp", Details.RETPriceMarkUp);
                cmd.Parameters.AddWithValue("WSPriceMarkUp", Details.WSPriceMarkUp);
                cmd.Parameters.AddWithValue("WillPrintGrandTotal", Details.WillPrintGrandTotal);
                cmd.Parameters.AddWithValue("ReservedAndCommit", Details.ReservedAndCommit);
                cmd.Parameters.AddWithValue("ShowCustomerSelection", Details.ShowCustomerSelection);
                cmd.Parameters.AddWithValue("EnableRewardPoints", Details.RewardPointsDetails.EnableRewardPoints);
                cmd.Parameters.AddWithValue("RewardPointsMinimum", Details.RewardPointsDetails.RewardPointsMinimum);
                cmd.Parameters.AddWithValue("RewardPointsEvery", Details.RewardPointsDetails.RewardPointsEvery);
                cmd.Parameters.AddWithValue("RewardPoints", Details.RewardPointsDetails.RewardPoints);
                cmd.Parameters.AddWithValue("RoundDownRewardPoints", Details.RewardPointsDetails.RoundDownRewardPoints);
                cmd.Parameters.AddWithValue("AutoGenerateRewardCardNo", Details.AutoGenerateRewardCardNo);
                cmd.Parameters.AddWithValue("EnableRewardPointsAsPayment", Details.RewardPointsDetails.EnableRewardPointsAsPayment);
                cmd.Parameters.AddWithValue("RewardPointsMaxPercentageForPayment", Details.RewardPointsDetails.RewardPointsMaxPercentageForPayment);
                cmd.Parameters.AddWithValue("RewardPointsPaymentValue", Details.RewardPointsDetails.RewardPointsPaymentValue);
                cmd.Parameters.AddWithValue("RewardPointsPaymentCashEquivalent", Details.RewardPointsDetails.RewardPointsPaymentCashEquivalent);
                cmd.Parameters.AddWithValue("RewardsPermitNo", Details.RewardPointsDetails.RewardsPermitNo);
                //cmd.Parameters.AddWithValue("InHouseIndividualCreditPermitNo", Details.InHouseIndividualCreditPermitNo);
                //cmd.Parameters.AddWithValue("InHouseGroupCreditPermitNo", Details.InHouseGroupCreditPermitNo);
                cmd.Parameters.AddWithValue("IsFineDining", Details.IsFineDining);
                cmd.Parameters.AddWithValue("PersonalChargeTypeID", Details.PersonalChargeType.ChargeTypeID);
                cmd.Parameters.AddWithValue("GroupChargeTypeID", Details.GroupChargeType.ChargeTypeID);
                cmd.Parameters.AddWithValue("BranchID", Details.BranchID);
                cmd.Parameters.AddWithValue("ProductSearchType", Details.ProductSearchType);
                cmd.Parameters.AddWithValue("IncludeCreditChargeAgreement", Details.IncludeCreditChargeAgreement);
                cmd.Parameters.AddWithValue("IsParkingTerminal", Details.IsParkingTerminal);
                cmd.Parameters.AddWithValue("WillPrintChargeSlip", Details.WillPrintChargeSlip);
                cmd.Parameters.AddWithValue("WillPrintVoidItem", Details.WillPrintVoidItem);
                cmd.Parameters.AddWithValue("IncludeTermsAndConditions", Details.IncludeTermsAndConditions);
                cmd.Parameters.AddWithValue("PWDDiscountCode", Details.PWDDiscountCode);
                cmd.Parameters.AddWithValue("DefaultTransactionChargeCode", Details.DefaultTransactionChargeCode);
                cmd.Parameters.AddWithValue("DineInChargeCode", Details.DineInChargeCode);
                cmd.Parameters.AddWithValue("TakeOutChargeCode", Details.TakeOutChargeCode);
                cmd.Parameters.AddWithValue("DeliveryChargeCode", Details.DeliveryChargeCode);
                cmd.Parameters.AddWithValue("CreatedOn", Details.CreatedOn == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.CreatedOn);
                cmd.Parameters.AddWithValue("LastModified", Details.LastModified == DateTime.MinValue ? Constants.C_DATE_MIN_VALUE : Details.LastModified);

                cmd.CommandText = SQL;
                return base.ExecuteNonQuery(cmd);
            }

            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Esempio n. 5
0
        public bool IsExist(Int32 BranchID, string TerminalNo, out TerminalDetails OutDetails)
		{
			try
			{
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

				bool boRetValue = false;

				string SQL=	SQLSelect() + "WHERE BranchID = @BranchID AND TerminalNo = @TerminalNo;";

                cmd.Parameters.AddWithValue("@BranchID", BranchID);
                cmd.Parameters.AddWithValue("@TerminalNo", TerminalNo);

                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);

                OutDetails = SetDetails(dt);

                if (OutDetails.TerminalID != 0) boRetValue = true;

				return boRetValue;
			}

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