示例#1
0
		public RegistrationType IsDemoExpired(out string SerialNumber)
		{
			SerialNumber = null;
			try
			{
				RegistrationType regIsDemoExpired = RegistrationType.DEMO_Unexpired;

                SerialNumber = GetHDSerialNo();

                if (SerialNumber == "W50SJSHQ" || SerialNumber == "K834T9A2BJNB" || SerialNumber == "K10HT77258WN" || SerialNumber == "587OCI98T" || SerialNumber == "MRG3W9KKH9S45H" || SerialNumber == "9546305796063968058" || SerialNumber == "9VP7QL84")
                {
                    // K10HT77258WN - Lemuel
                    // 587OCI98T - Darius
                    // MRG3W9KKH9S45H - Rico
                    // 9546305796063968058 - Grace
                    // 9VP7QL84 - Lemuel
                    // WD-WXTY08TPJ153
                    return RegistrationType.Registered;
                }

				try
				{
                    Data.Terminal clsTerminal = new Data.Terminal();
                    string cipherText = clsTerminal.getTerminalKey(SerialNumber);
                    clsTerminal.CommitAndDispose();

                    if (cipherText != string.Empty)
                    {
                        string plainText = CompanyDetails.CompanyCode + SerialNumber.ToString().Trim();    // original plaintext
                        //string  cipherText = System.Configuration.ConfigurationManager.AppSettings["RegistrationKey"].ToString();	// encrypted text
                        string passPhrase = CompanyDetails.TIN; // can be any string
                        string initVector = "%@skmelaT3rsh1t!"; // must be 16 bytes

                        // Before encrypting data, we will append plain text to a random
                        // salt value, which will be between 4 and 8 bytes long (implicitly
                        // used defaults).
                        AceSoft.Cryptor clsCryptor = new AceSoft.Cryptor(passPhrase, initVector);

                        if (plainText == clsCryptor.Decrypt(cipherText))
                        {
                            return RegistrationType.Registered;
                        }
                    }
				}
                catch { }

				Data.TerminalReport clsTerminalReport = new Data.TerminalReport();
                string EndingTransactionNo = clsTerminalReport.EndingTransactioNo(Constants.TerminalBranchID, CompanyDetails.TerminalNo);
				clsTerminalReport.CommitAndDispose();

				if (Convert.ToInt64(EndingTransactionNo) > 1000)
					regIsDemoExpired = RegistrationType.DEMO_Expired;

				return regIsDemoExpired;
			}
			catch (Exception ex)	
			{	
				SerialNumber = ex.ToString();
				return RegistrationType.Error;	}
		}
示例#2
0
		protected void Page_Load(object sender, System.EventArgs e)
		{
			const string defaultHeading = "Login";
			const string defaultTitle = "RetailPlus System";
			const SearchCategoryID defaultAllSourcesIndex = SearchCategoryID.AllSources;
			
			LargeHeading.Text = defaultHeading;

			SiteTitle.Title = defaultTitle;

			HorizontalNavBar.PageNavigatorid = HorizontalNavID.Home;

			RightBodySectionSearch.SearchIDSelectedItem = defaultAllSourcesIndex;

			PageLevelError.Visible = false;	

//			Data.TerminalReport clsTerminalReport = new Data.TerminalReport();
//			Data.TerminalReportDetails details = clsTerminalReport.Details(CompanyDetails.TerminalNo);
//			clsTerminalReport.CommitAndDispose();
//
//			if (Convert.ToInt64(details.EndingTransactionNo) >= 50)
//			{
//				Session["ErrorCurrentExecutionFilePath"] = Request.CurrentExecutionFilePath;
//				Session["ErrMessage"] = Constants.DEMO_EXPIRED_MESSAGE;
//				Session["ErrorMessage"] = Constants.DEMO_EXPIRED_MESSAGE;
//				Session["ErrorSource"] = Constants.DEMO_EXPIRED_HEADER;
//				Session["ErrorExceptionType"] = null;
//				Session["ErrorStackTrace"] = null;
//
//				Response.Redirect("/RetailPlus/GenericError.aspx");
//			}
//			else
//			{
				//Check if a user is currently login

				if (Session["UID"] != null)
				{
					Login.AssignUserSession(Convert.ToInt16(Session["UID"]));
                    Response.Redirect(Constants.ROOT_DIRECTORY + "/Home/Default.aspx");
				}
				else
				{	HorizontalNavBar.Visible = false;
					RightBodySectionSearch.Visible = false;

                    Data.Terminal clsTerminal = new Data.Terminal();
                    clsTerminal.UpdateBEVersion("2.0.1.5");
                    clsTerminal.CommitAndDispose();
				}
//			}
			
		}
示例#3
0
		private void LoadList()
		{	
			Terminal clsTerminal = new Terminal();

			string SortField = "TerminalNo";
			if (Request.QueryString["sortfield"]!=null)
			{	SortField = Common.Decrypt(Request.QueryString["sortfield"].ToString(), Session.SessionID);	}
			
			SortOption sortoption = SortOption.Ascending;
			if (Request.QueryString["sortoption"]!=null)
			{	sortoption = (SortOption) Enum.Parse(typeof(SortOption), Common.Decrypt(Request.QueryString["sortoption"], Session.SessionID), true);	}

            string SearchKey = "";
			if (Request.QueryString["Search"]!=null)
			{   SearchKey = Common.Decrypt((string)Request.QueryString["search"],Session.SessionID);    }
            PageData.DataSource = clsTerminal.ListAsDataTable(SearchKey, SortField, sortoption).DefaultView;
			clsTerminal.CommitAndDispose();

			int iPageSize = Convert.ToInt16(Session["PageSize"]) ;
			
			PageData.AllowPaging = true;
			PageData.PageSize = iPageSize;
			try
			{
				PageData.CurrentPageIndex = Convert.ToInt16(cboCurrentPage.SelectedItem.Value) - 1;				
				lstItem.DataSource = PageData;
				lstItem.DataBind();
			}
			catch
			{
				PageData.CurrentPageIndex = 1;
				lstItem.DataSource = PageData;
				lstItem.DataBind();
			}			
			
			cboCurrentPage.Items.Clear();
			for (int i=0; i < PageData.PageCount;i++)
			{
				int iValue = i + 1;
				cboCurrentPage.Items.Add(new ListItem(iValue.ToString(),iValue.ToString()));
				if (PageData.CurrentPageIndex == i)
				{	cboCurrentPage.Items[i].Selected = true;}
				else
				{	cboCurrentPage.Items[i].Selected = false;}
			}
			lblDataCount.Text = " of " + " " + PageData.PageCount;
		}
示例#4
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();
		}
示例#5
0
		private void LoadRecord()
		{

			Int32 TerminalID = Convert.ToInt32(Common.Decrypt(Request.QueryString["id"],Session.SessionID));
			Terminal clsTerminal = new Terminal();
            TerminalDetails clsDetails = clsTerminal.Details(TerminalID);
			clsTerminal.CommitAndDispose();

            lblBranchID.Text = clsDetails.BranchID.ToString();
			lblTerminalID.Text = clsDetails.TerminalID.ToString();
			txtTerminalNo.Text = clsDetails.TerminalNo;
			txtTerminalCode.Text = clsDetails.TerminalCode;
			txtTerminalName.Text = clsDetails.TerminalName;
			txtStatus.Text = clsDetails.Status.ToString("G");
			txtDateCreated.Text = clsDetails.DateCreated.ToString("yyyy-MM-dd HH:mm");
			txtMachineSerialNo.Text = clsDetails.MachineSerialNo;
			txtAccreditationNo.Text = clsDetails.AccreditationNo;

			chkIsPrinterAutoCutter.Checked = clsDetails.IsPrinterAutoCutter;
			cboAutoPrint.SelectedIndex = cboAutoPrint.Items.IndexOf(cboAutoPrint.Items.FindByValue(clsDetails.AutoPrint.ToString("d")));
			chkIsVATInclusive.Checked = clsDetails.IsVATInclusive;

			txtPrinterName.Text = clsDetails.PrinterName;
			txtTurretName.Text = clsDetails.TurretName;
			txtCashDrawerName.Text = clsDetails.CashDrawerName;

			chkItemVoidConfirmation.Checked = clsDetails.ItemVoidConfirmation;
			chkEnableEVAT.Checked = clsDetails.EnableEVAT;
			txtMaxReceiptWidth.Text = clsDetails.MaxReceiptWidth.ToString();

			cboFormBehaviour.SelectedIndex = cboFormBehaviour.Items.IndexOf(cboFormBehaviour.Items.FindByValue(clsDetails.FORM_Behavior));

			txtMarqueeMessage.Text = clsDetails.MarqueeMessage;
			
			if (Session["UserName"].ToString().ToLower() == "admin")
			{
				txtMachineSerialNo.ReadOnly = false;
				txtAccreditationNo.ReadOnly = false;
			}

            // Added May 6, 2009.
            txtVAT.Text = clsDetails.VAT.ToString("##.#0");
            txtEVAT.Text = clsDetails.EVAT.ToString("##.#0");
            txtLocalTax.Text = clsDetails.LocalTax.ToString("##.#0");
            chkShowItemMoreThanZeroQty.Checked = clsDetails.ShowItemMoreThanZeroQty;
            chkShowOnlyPackedTransactions.Checked = clsDetails.ShowOnlyPackedTransactions;
            chkShowOneTerminalSuspendedTransactions.Checked = clsDetails.ShowOneTerminalSuspendedTransactions;
            cboReceiptType.SelectedIndex = cboReceiptType.Items.IndexOf(cboReceiptType.Items.FindByValue(clsDetails.ReceiptType.ToString("d")));
            txtSalesInvoicePrinterName.Text = clsDetails.SalesInvoicePrinterName;
            chkCashCountBeforeReport.Checked = clsDetails.CashCountBeforeReport;
            chkPreviewTerminalReport.Checked = clsDetails.PreviewTerminalReport;

            // Added May 6, 2009.
            chkIsPrinterDotmatrix.Checked = clsDetails.IsPrinterDotMatrix;
            chkIsChargeEditable.Checked = clsDetails.IsChargeEditable;
            chkIsDiscountEditable.Checked = clsDetails.IsDiscountEditable;
            chkCheckCutOffTime.Checked = clsDetails.CheckCutOffTime;
            txtStartCutOffTime.Text = clsDetails.StartCutOffTime;
            txtEndCutOffTime.Text = clsDetails.EndCutOffTime;
            chkWithRestaurantFeatures.Checked = clsDetails.WithRestaurantFeatures;
            cboDiscountCode.SelectedIndex = cboDiscountCode.Items.IndexOf(cboDiscountCode.Items.FindByValue(clsDetails.SeniorCitizenDiscountCode));
            cboPWDDiscountCode.SelectedIndex = cboPWDDiscountCode.Items.IndexOf(cboPWDDiscountCode.Items.FindByValue(clsDetails.PWDDiscountCode));
            chkIsTouchScreen.Checked = clsDetails.IsTouchScreen;
            chkWillContinueSelectionVariation.Checked = clsDetails.WillContinueSelectionVariation;
            chkWillContinueSelectionProduct.Checked = clsDetails.WillContinueSelectionProduct;
            chkWillPrintGrandTotal.Checked = clsDetails.WillPrintGrandTotal;
            chkReservedAndCommit.Checked = clsDetails.ReservedAndCommit;

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

            cboGroupChargeType.SelectedIndex = cboGroupChargeType.Items.IndexOf(cboGroupChargeType.Items.FindByValue(clsDetails.GroupChargeType.ChargeTypeID.ToString()));
            cboPersonalChargeType.SelectedIndex = cboPersonalChargeType.Items.IndexOf(cboPersonalChargeType.Items.FindByValue(clsDetails.PersonalChargeType.ChargeTypeID.ToString()));

            // Added Sep 24, 2014
            cboDefaultTransactionChargeCode.SelectedIndex = cboDefaultTransactionChargeCode.Items.IndexOf(cboDefaultTransactionChargeCode.Items.FindByValue(clsDetails.DefaultTransactionChargeCode));
            cboDineInChargeCode.SelectedIndex = cboDineInChargeCode.Items.IndexOf(cboDineInChargeCode.Items.FindByValue(clsDetails.DineInChargeCode));
            cboTakeOutChargeCode.SelectedIndex = cboTakeOutChargeCode.Items.IndexOf(cboTakeOutChargeCode.Items.FindByValue(clsDetails.TakeOutChargeCode));
            cboDeliveryChargeCode.SelectedIndex = cboDeliveryChargeCode.Items.IndexOf(cboDeliveryChargeCode.Items.FindByValue(clsDetails.DeliveryChargeCode));
		}
		private void LoadRecord()
		{
			Terminal clsTerminal = new Terminal();
            RewardPointsDetails clsDetails = clsTerminal.RewardPointsDetails();
			clsTerminal.CommitAndDispose();

            chkEnableRewardPoints.Checked = clsDetails.EnableRewardPoints;
            chkRoundDownRewardPoints.Checked = clsDetails.RoundDownRewardPoints;
            txtRewardPointsMinimum.Text = clsDetails.RewardPointsMinimum.ToString("##0.#0");
            txtRewardPointsEvery.Text = clsDetails.RewardPointsEvery.ToString("##0.#0");
            txtRewardPoints.Text = clsDetails.RewardPoints.ToString("##0.#0");

            chkEnableRewardPointsAsPayment.Checked = clsDetails.EnableRewardPointsAsPayment;
            txtRewardPointsMaxPercentageForPayment.Text = clsDetails.RewardPointsMaxPercentageForPayment.ToString("##0.#0");
            txtRewardPointsPaymentValue.Text = clsDetails.RewardPointsPaymentValue.ToString("##0.#0");
            txtRewardPointsPaymentCashEquivalent.Text = clsDetails.RewardPointsPaymentCashEquivalent.ToString("##0.#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();
		}