Beispiel #1
0
        private void LoadRecord()
        {
            Int32 iID = Convert.ToInt32(Common.Decrypt(Request.QueryString["id"], Session.SessionID));
            ChargeType clsChargeType = new ChargeType();
            ChargeTypeDetails clsDetails = clsChargeType.Details(iID);
            clsChargeType.CommitAndDispose();

            lblChargeTypeID.Text = clsDetails.ChargeTypeID.ToString();
            txtChargeTypeCode.Text = clsDetails.ChargeTypeCode;
            txtChargeType.Text = clsDetails.ChargeType;
            txtChargeAmount.Text = clsDetails.ChargeAmount.ToString("#,##0.#0");
            chkInPercent.Checked = Convert.ToBoolean(clsDetails.InPercent);
        }
Beispiel #2
0
		private Int32 SaveRecord()
		{
			ChargeType clsChargeType = new ChargeType();
			ChargeTypeDetails clsDetails = new ChargeTypeDetails();

            clsDetails.ChargeTypeCode = txtChargeTypeCode.Text;
            clsDetails.ChargeType = txtChargeType.Text;
            clsDetails.ChargeAmount = Convert.ToDecimal(txtChargeAmount.Text);
            clsDetails.InPercent = chkInPercent.Checked;
		
			Int32 id = clsChargeType.Insert(clsDetails);
			
			clsChargeType.CommitAndDispose();

			return id;
		}
Beispiel #3
0
        private void SaveRecord()
        {
            ChargeType clsChargeType = new ChargeType();
            ChargeTypeDetails clsDetails = new ChargeTypeDetails();

            clsDetails.ChargeTypeCode = txtChargeTypeCode.Text;
            clsDetails.ChargeType = txtChargeType.Text;
            clsDetails.ChargeAmount = Convert.ToDecimal(txtChargeAmount.Text);
            clsDetails.InPercent = chkInPercent.Checked;
            clsDetails.ChargeTypeID = Convert.ToInt32(lblChargeTypeID.Text);

            clsChargeType.Update(clsDetails);
            clsChargeType.CommitAndDispose();
        }
Beispiel #4
0
		protected void cboChargeType_SelectedIndexChanged(object sender, System.EventArgs e)
		{
			if (cboChargeType.Items.Count != 0)
			{
				ChargeType clsChargeType = new ChargeType();
				ChargeTypeDetails clsDetails = clsChargeType.Details(Convert.ToInt32(cboChargeType.SelectedItem.Value));
				clsChargeType.CommitAndDispose();

				txtChargeAmount.Text = clsDetails.ChargeAmount.ToString("#,##0.#0");
				chkInPercent.Checked = Convert.ToBoolean(clsDetails.InPercent);
			}
		}
Beispiel #5
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;
        }
Beispiel #6
0
		private void ChangeOrderType()
		{
            if (mclsTerminalDetails.AutoPrint == PrintingPreference.Auto && mboIsInTransaction)
            {
                MessageBox.Show("Sorry you cannot change Order Type if Auto-print is ON an item is already purchased.", "RetailPlus", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            DialogResult loginresult = GetWriteAccessAndLogin(mclsSalesTransactionDetails.CashierID, AccessTypes.ChangeOrderType);

            if (loginresult == DialogResult.OK)
            {
                try
                {
                    clsEvent.AddEvent("[" + lblCashier.Text + "] Changing order type of trans. no. " + lblTransNo.Text);

                    OrderTypeWnd clsOrderTypeWnd = new OrderTypeWnd();
                    clsOrderTypeWnd.TerminalDetails = mclsTerminalDetails;
                    clsOrderTypeWnd.ShowDialog(this);
                    DialogResult result = clsOrderTypeWnd.Result;
                    OrderTypes clsOrderType = clsOrderTypeWnd.orderType;
                    clsOrderTypeWnd.Close();
                    clsOrderTypeWnd.Dispose();

                    if (result == DialogResult.OK)
                    {
                        Cursor.Current = Cursors.WaitCursor;
                        if (!mboIsInTransaction)
                        {
                            this.LoadOptions();
                            if (!this.CreateTransaction()) return;
                        }

                        mclsSalesTransactionDetails.OrderType = clsOrderType;

                        Data.SalesTransactions clsSalesTransactions = new Data.SalesTransactions(mConnection, mTransaction);
                        mConnection = clsSalesTransactions.Connection; mTransaction = clsSalesTransactions.Transaction;

                        clsSalesTransactions.UpdateOrderType(mclsSalesTransactionDetails.TransactionID, mclsSalesTransactionDetails.TransactionDate, mclsSalesTransactionDetails.OrderType);
                        InsertAuditLog(AccessTypes.ChargeType, "Change order type to " + mclsSalesTransactionDetails.OrderType.ToString("G") + ". Tran. #".PadRight(15) + ":" + lblTransNo.Text + " @ Branch: " + mclsTerminalDetails.BranchDetails.BranchCode);
                        clsEvent.AddEventLn("Done!", true);

                        if (clsOrderType != OrderTypes.DineIn && mclsSalesTransactionDetails.CustomerID == Constants.C_RETAILPLUS_CUSTOMERID)
                        {
                            Int64 iOldContactID = mclsSalesTransactionDetails.CustomerID;

                            SelectContact(AceSoft.RetailPlus.Data.ContactGroupCategory.CUSTOMER);

                            if (iOldContactID != mclsSalesTransactionDetails.CustomerID)
                            {
                                Data.Contacts clsContacts = new Data.Contacts(mConnection, mTransaction);
                                mConnection = clsContacts.Connection; mTransaction = clsContacts.Transaction;
                                clsContacts.UpdateLastCheckInDate(iOldContactID, Constants.C_DATE_MIN_VALUE);
                                clsContacts.UpdateLastCheckInDate(mclsSalesTransactionDetails.CustomerID, mclsSalesTransactionDetails.TransactionDate);
                                clsContacts.CommitAndDispose();
                            }
                        }
                        if (mclsSalesTransactionDetails.CustomerID == Constants.C_RETAILPLUS_CUSTOMERID)
                        {
                            mclsSalesTransactionDetails.OrderType = OrderTypes.DineIn;

                            clsSalesTransactions = new Data.SalesTransactions(mConnection, mTransaction);
                            mConnection = clsSalesTransactions.Connection; mTransaction = clsSalesTransactions.Transaction;

                            clsSalesTransactions.UpdateOrderType(mclsSalesTransactionDetails.TransactionID, mclsSalesTransactionDetails.TransactionDate, mclsSalesTransactionDetails.OrderType);
                            InsertAuditLog(AccessTypes.ChargeType, "System override order type to " + mclsSalesTransactionDetails.OrderType.ToString("G") + ". Tran. #".PadRight(15) + ":" + lblTransNo.Text + " @ Branch: " + mclsTerminalDetails.BranchDetails.BranchCode);
                        
                        }

                        clsSalesTransactions.CommitAndDispose();

                        lblOrderType.Text = mclsSalesTransactionDetails.OrderType.ToString("G").ToUpper();

                        // [09/24/2014] apply the default charge if changed to dine in

                        Data.ChargeType clsChargeType = new ChargeType(mConnection, mTransaction);
                        mConnection = clsChargeType.Connection; mTransaction = clsChargeType.Transaction;

                        Data.ChargeTypeDetails clsChargeTypeDetails = new ChargeTypeDetails();
                        if (mclsSalesTransactionDetails.OrderType == OrderTypes.DineIn && !string.IsNullOrEmpty(mclsTerminalDetails.DineInChargeCode))
                        {
                            clsChargeTypeDetails = clsChargeType.Details(mclsTerminalDetails.DineInChargeCode);
                            setTransCharge(clsChargeTypeDetails, "Change Order Type to Dine-In. Charge Code:" + mclsTerminalDetails.DineInChargeCode);
                        }
                        else if (mclsSalesTransactionDetails.OrderType == OrderTypes.TakeOut && !string.IsNullOrEmpty(mclsTerminalDetails.TakeOutChargeCode))
                        {
                            clsChargeTypeDetails = clsChargeType.Details(mclsTerminalDetails.TakeOutChargeCode);
                            setTransCharge(clsChargeTypeDetails, "Change Order Type to Take-Out. Charge Code:" + mclsTerminalDetails.TakeOutChargeCode);
                        }
                        else if (mclsSalesTransactionDetails.OrderType == OrderTypes.Delivery && !string.IsNullOrEmpty(mclsTerminalDetails.DeliveryChargeCode))
                        {
                            clsChargeTypeDetails = clsChargeType.Details(mclsTerminalDetails.DeliveryChargeCode);
                            setTransCharge(clsChargeTypeDetails, "Change Order Type to Delivery. Charge Code:" + mclsTerminalDetails.DeliveryChargeCode);
                        }
                        else
                        {
                            ApplyTransZeroCharge();
                        }

                        clsChargeType.CommitAndDispose();
                    }
                    else { clsEvent.AddEventLn("Cancelled!"); }
                }
                catch (Exception ex)
                {
                    InsertErrorLogToFile(ex, "ERROR!!! Changing order type.");
                }
                Cursor.Current = Cursors.Default;
            }
		}
Beispiel #7
0
		private bool Delete()
		{
			bool boRetValue = false;
			string stIDs = "";

			foreach(DataListItem item in lstItem.Items)
			{
				HtmlInputCheckBox chkList = (HtmlInputCheckBox) item.FindControl("chkList");
				if (chkList!=null)
				{
					if (chkList.Checked == true)
					{
						stIDs += chkList.Value + ",";		
						boRetValue = true;
					}
				}
			}
			if (boRetValue)
			{
				ChargeType clsChargeType = new ChargeType();
				clsChargeType.Delete( stIDs.Substring(0,stIDs.Length-1));
				clsChargeType.CommitAndDispose();
			}

			return boRetValue;
		}
Beispiel #8
0
		private void LoadList()
		{	
			ChargeType clsChargeType = new ChargeType();
			DataClass clsDataClass = new DataClass();

			string SortField = "ChargeTypeID";
			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 = clsChargeType.ListAsDataTable(SearchKey, SortField, sortoption).DefaultView;
			clsChargeType.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;
		}
Beispiel #9
0
        protected void lstItem_ItemCommand(object sender, DataListCommandEventArgs e)
        {
            HtmlInputCheckBox chkList = (HtmlInputCheckBox)e.Item.FindControl("chkList");
            string stParam = string.Empty;
            switch (e.CommandName)
            {
                case "imgItemDelete":
                    ChargeType clsChargeType = new ChargeType();
                    clsChargeType.Delete(chkList.Value);
                    clsChargeType.CommitAndDispose();

                    LoadList();
                    break;
                case "imgItemEdit":
                    stParam = "?task=" + Common.Encrypt("edit", Session.SessionID) + "&id=" + Common.Encrypt(chkList.Value, Session.SessionID);
                    Response.Redirect("Default.aspx" + stParam);
                    break;
            }
        }