Ejemplo 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();
		}