Beispiel #1
0
        public CResult InsertDepositUsed(CDepositUsed inDepositUsed)
        {
            try
            {
                m_oResult = Database.Instance.Deposit.InsertDepositUsed(inDepositUsed);

                m_oResult.Message = "Data Inserted Successfully";

            }
            catch (Exception ex)
            {
                System.Console.WriteLine("Exception occuer at InsertDepositUsed() : " + ex.Message);

                m_oResult.Action = EERRORNAME.EXCEPTION_OCCURE;
                //m_oResult.SetParams(ex.Message);

                m_oResult.Message = ex.Message;
                Logger.Write("Exception : " + ex + " in InsertDepositUsed()", LogLevel.Error, "CDepositManager");
            }
            return m_oResult;
        }
Beispiel #2
0
        public CPaymentForm(Int64 inOrderID, Double inTotalAmount, String inTableType, DataTable inItemList, decimal inDiscount, int drinksIndex, string terminalName, string operatorName, string serviceCharge,decimal inMembershipdiscount)
        {
            eFTCardManager = new EFTCardManager();

            if (!isVatEnabled)
            {
                vat = 0.00;
            }

            InitializeComponent();

            g_BalaceLabel.Text = Program.currency + "0.00";
            g_BillTotalLabel.Text = Program.currency + "0.00";
            g_CashLabel.Text = Program.currency + "0.00";
            g_ChequeLabel.Text = Program.currency + "0.00";
            g_DiscountLabel.Text = Program.currency + "0.00";
            g_EFTLabel.Text = Program.currency + "0.00";
            g_SplitAmountLabel.Text = Program.currency + "0.00";
            g_ServiceChargeLabel.Text = Program.currency + "0.00";
            g_VoucherLabel.Text = Program.currency + "0.00";
            g_AccountLabel.Text = Program.currency + "0.00";
            g_DepositUsedLabel.Text = Program.currency + "0.00";
            g_InputTextBox.Text = Program.currency + "0.00";
            membershipdiscountlabel.Text = Program.currency + "0.00";
            g_InputTextBox.MaxLength = 20;

            currencyKeyPad1.CurrencySign = Program.currency;

            m_OperatorName = operatorName;
            m_TerminalName = terminalName;

            m_cCommonConstants = ConfigManager.GetConfig<CCommonConstants>();
            String ConnectionString = m_cCommonConstants.DBConnection;
            SqlDataAdapter daCategory3 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category3GetAll), ConnectionString);
            daCategory3.Fill(dsCategory3, "Category3");
            daCategory3.Dispose();

            SqlDataAdapter daCategory4 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category4GetAll), ConnectionString);
            daCategory4.Fill(dsCategory4, "Category4");
            daCategory4.Dispose();

            SqlDataAdapter tempSqlDataAdapter5 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category2GetAll), ConnectionString);
            tempSqlDataAdapter5.Fill(dsCategory2, "Category2");
            tempSqlDataAdapter5.Dispose();

            m_oDepositUsed = new CDepositUsed();
            m_oDeposit = new CDeposit();
            m_iOrderID = inOrderID;

            m_dTotalAmount = inTotalAmount;
            membershipdiscount = inMembershipdiscount;

            m_dBalance = inTotalAmount + Convert.ToDouble("0" + serviceCharge);
            m_sTableType = inTableType;
            m_dtItemList = inItemList;
            m_iDrinksIndex = drinksIndex;
            m_dServiceAmount = Convert.ToDouble("0" + serviceCharge);

            g_BalaceLabel.Text = String.Format("Balace Due {0}" + (inTotalAmount + Convert.ToDouble("0" + serviceCharge)).ToString("F02"), Program.currency);
            g_BillTotalLabel.Text = Program.currency + m_dBalance.ToString("F02");
            m_tobePaid = inTotalAmount; //Total without service charge

            g_DiscountLabel.Text = Program.currency + inDiscount.ToString();
            g_ServiceChargeLabel.Text = Program.currency + Convert.ToDouble("0" + serviceCharge).ToString("F02");
            membershipdiscountlabel.Text = Program.currency + inMembershipdiscount.ToString();

            // double grand = m_dTotalAmount + Convert.ToDouble(inDiscount);

            //Vat Claculation
            DataTable dt = inItemList;
            for (int i = 0; i < dt.Rows.Count;i++ )
            {
                vatTotalAmount += Convert.ToDouble( dt.Rows[i]["Vat"].ToString());
            }
            lblVat.Text = Program.currency + vatTotalAmount.ToString("F02");

            //   vatTotalAmount = ((m_dTotalAmount + Convert.ToDouble(inDiscount)) * (vat / 100)) / (1 + (vat / 100));
              //  lblVat.Text = Program.currency + vatTotalAmount.ToString("F02");

            //String CashButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Cash'")[0]["color"].ToString();
            //g_CashButton.BackColor = Color.FromArgb(Int32.Parse(CashButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(CashButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(CashButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String ChequeButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Cheque'")[0]["color"].ToString();
            //g_ChequeButton.BackColor = Color.FromArgb(Int32.Parse(ChequeButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(ChequeButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(ChequeButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String EFTButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'EFT'")[0]["color"].ToString();
            //g_EFTButton.BackColor = Color.FromArgb(Int32.Parse(EFTButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(EFTButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(EFTButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String VoucherButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Voucher'")[0]["color"].ToString();
            //g_VoucherButton.BackColor = Color.FromArgb(Int32.Parse(VoucherButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(VoucherButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(VoucherButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String AccountButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Account'")[0]["color"].ToString();
            //g_AccountButton.BackColor = Color.FromArgb(Int32.Parse(AccountButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(AccountButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(AccountButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String LoyaltiCardButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Loyalty Card'")[0]["color"].ToString();
            //g_LoyaltiCardButton.BackColor = Color.FromArgb(Int32.Parse(LoyaltiCardButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(LoyaltiCardButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(LoyaltiCardButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String DiscountColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Discount'")[0]["color"].ToString();
            //g_DiscountButton.BackColor = Color.FromArgb(Int32.Parse(DiscountColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(DiscountColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(DiscountColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            LoadPrintOffButton();
            LoadStatusBar(inOrderID);
        }
Beispiel #3
0
        public CResult InsertDepositUsed(CDepositUsed inDepositUsed)
        {
            CResult oResult = new CResult();

            try
            {

                this.OpenConnection();
                string sSql = String.Format(SqlQueries.GetQuery(Query.InsertDepositUsed), inDepositUsed.DepositID, inDepositUsed.UsedAmount);
                this.ExecuteNonQuery(sSql);

                sSql = SqlQueries.GetQuery(Query.ScopeIdentity);

                IDataReader oReader = this.ExecuteReader(sSql);
                if (oReader != null)
                {
                    bool bIsRead = oReader.Read();
                    if (bIsRead)
                    {

                        inDepositUsed.DepositUseID = Int64.Parse(oReader[0].ToString());
                    }
                    oReader.Close();
                }

                oResult.Data = inDepositUsed;
                oResult.IsSuccess = true;
            }

            catch (Exception ex)
            {
                Logger.Write("Exception : " + ex + " in InsertDepositUsed()", LogLevel.Error, "Database");

                //throw new Exception("Exception occure at OrderDetailsInsert()", ex);
                oResult.IsException = true;
            }
            finally
            {
                this.CloseConnection();
            }

            return oResult;
        }
Beispiel #4
0
        public CPaymentForm(Int64 inOrderID, Double inTotalAmount, String inTableType, DataTable inItemList, Double inDiscount, int drinksIndex, string serviceCharge)
        {
            InitializeComponent();

            m_cCommonConstants = ConfigManager.GetConfig<CCommonConstants>();
            String ConnectionString = m_cCommonConstants.DBConnection;
            SqlDataAdapter daCategory3 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category3GetAll), ConnectionString);
            daCategory3.Fill(dsCategory3, "Category3");
            daCategory3.Dispose();

            SqlDataAdapter daCategory4 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category4GetAll), ConnectionString);
            daCategory4.Fill(dsCategory4, "Category4");
            daCategory4.Dispose();

            SqlDataAdapter tempSqlDataAdapter5 = new SqlDataAdapter(SqlQueries.GetQuery(Query.Category2GetAll), ConnectionString);
            tempSqlDataAdapter5.Fill(dsCategory2, "Category2");
            tempSqlDataAdapter5.Dispose();

            m_oDepositUsed = new CDepositUsed();
            m_oDeposit = new CDeposit();
            m_iOrderID = inOrderID;

            m_dTotalAmount = inTotalAmount;

            m_dBalance = inTotalAmount + Convert.ToDouble("0" + serviceCharge);
            m_sTableType = inTableType;
            m_dtItemList = inItemList;
            m_iDrinksIndex = drinksIndex;
            m_dServiceAmount = Convert.ToDouble("0" + serviceCharge);

            g_BalaceLabel.Text = String.Format("Balace Due {0}" + (inTotalAmount + Convert.ToDouble("0" + serviceCharge)).ToString("F02"), Program.currency);
            g_BillTotalLabel.Text = Program.currency + inTotalAmount.ToString("F02");
            m_tobePaid = inTotalAmount; //Total without service charge

            g_DiscountLabel.Text = Program.currency + inDiscount.ToString("F02");
            g_ServiceChargeLabel.Text = Program.currency + Convert.ToDouble("0" + serviceCharge).ToString("F02");

            //String CashButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Cash'")[0]["color"].ToString();
            //g_CashButton.BackColor = Color.FromArgb(Int32.Parse(CashButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(CashButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(CashButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String ChequeButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Cheque'")[0]["color"].ToString();
            //g_ChequeButton.BackColor = Color.FromArgb(Int32.Parse(ChequeButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(ChequeButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(ChequeButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String EFTButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'EFT'")[0]["color"].ToString();
            //g_EFTButton.BackColor = Color.FromArgb(Int32.Parse(EFTButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(EFTButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(EFTButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String VoucherButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Voucher'")[0]["color"].ToString();
            //g_VoucherButton.BackColor = Color.FromArgb(Int32.Parse(VoucherButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(VoucherButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(VoucherButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String AccountButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Account'")[0]["color"].ToString();
            //g_AccountButton.BackColor = Color.FromArgb(Int32.Parse(AccountButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(AccountButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(AccountButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String LoyaltiCardButtonColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Loyalty Card'")[0]["color"].ToString();
            //g_LoyaltiCardButton.BackColor = Color.FromArgb(Int32.Parse(LoyaltiCardButtonColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(LoyaltiCardButtonColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(LoyaltiCardButtonColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            //String DiscountColorString = Program.initDataSet.Tables["ButtonColor"].Select("name = 'Discount'")[0]["color"].ToString();
            //g_DiscountButton.BackColor = Color.FromArgb(Int32.Parse(DiscountColorString.Substring(1, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(DiscountColorString.Substring(3, 2), System.Globalization.NumberStyles.HexNumber),
            //        Int32.Parse(DiscountColorString.Substring(5, 2), System.Globalization.NumberStyles.HexNumber));

            LoadPrintOffButton();
            LoadStatusBar(inOrderID);
        }