public ActionResult DeleteChoose(int id)
 {
     if (Session["Authentication"] != null)
     {
         try
         {
             var           ro = db.NTL_Room.Where(s => s.DiscountID == id).ToList();
             var           sv = db.NTL_Service.Where(s => s.DiscountID == id).ToList();
             Data.Discount di = new Data.Discount();
             di.room    = ro;
             di.service = sv;
             List <Data.Discount> lst = new List <Data.Discount>();
             lst.Add(di);
             return(View(lst));
         }
         catch (Exception ex)
         {
             return(RedirectToAction("FourOFour", "Error"));
         }
     }
     else
     {
         return(RedirectToAction("Login", "WebMaster"));
     }
 }
示例#2
0
        private void LoadChangeDiscount()
        {
            if (cboDiscountType.Text != null & cboDiscountType.Text != "")
            {
                Data.Discount        clsDiscount        = new Data.Discount();
                Data.DiscountDetails clsDiscountDetails = clsDiscount.Details(cboDiscountType.Text);
                clsDiscount.CommitAndDispose();

                //if (clsDiscountDetails.DiscountPrice == 0)
                //{
                //    mDiscountType = DiscountTypes.NotApplicable;
                //    lblHeader.Text = "Not Applicable";
                //    lblDiscountType.Visible = false;
                //}
                //else
                lblHeader.Text = mstHeader;
                if (clsDiscountDetails.InPercent)
                {
                    mDiscountType           = DiscountTypes.Percentage;
                    lblDiscountType.Visible = true;
                }
                else
                {
                    mDiscountType           = DiscountTypes.FixedValue;
                    lblDiscountType.Visible = false;
                }

                txtAmount.Text = clsDiscountDetails.DiscountPrice.ToString("#,##0.#0");
            }
        }
示例#3
0
        private void LoadOptions()
        {
            lblHeader.Text = mstHeader;

            if (mDiscountType == DiscountTypes.Percentage)
            {
                lblDiscountType.Visible = true;
            }
            else if (mDiscountType == DiscountTypes.FixedValue)
            {
                lblDiscountType.Visible = false;
            }
            else if (mDiscountType == DiscountTypes.NotApplicable)
            {
                lblDiscountType.Visible = false;
            }

            txtAmount.Text        = mdecDiscountAmount.ToString("#,##0.#0");
            lblBalanceAmount.Text = mdecBalanceAmount.ToString("#,##0.#0");

            lblDescription.Text = "Current Balance to be paid.";

            //string strTmp = "";
            cboDiscountType.Items.Clear();
            Data.Discount clsDiscount = new Data.Discount();
            foreach (System.Data.DataRow dr in clsDiscount.ListAsDataTable().Rows)
            {
                //if (mDisableVATExempt && dr["DiscountCode"].ToString() == TerminalDetails.SeniorCitizenDiscountCode)
                //    strTmp = "";
                //else if (mDisableVATExempt && dr["DiscountCode"].ToString() == TerminalDetails.PWDDiscountCode)
                //    strTmp = "";
                //else
                cboDiscountType.Items.Add(dr["DiscountCode"]);
            }
            clsDiscount.CommitAndDispose();

            if (mDiscountCode != null & mDiscountCode != "")
            {
                cboDiscountType.SelectedIndex = cboDiscountType.Items.IndexOf(mDiscountCode);
            }
            else
            {
                cboDiscountType.SelectedIndex = cboDiscountType.Items.Count - 1;
            }
            txtRemarks.Text = mRemarks;
            if (mbolIsDiscountEditable == true)
            {
                txtAmount.Enabled = true; txtAmount.Focus();
            }
        }
示例#4
0
        private void LoadChangeDiscount()
        {
            if (cboDiscountType.Text != null & cboDiscountType.Text != "")
            {
                Data.Discount clsDiscount = new Data.Discount();
                Data.DiscountDetails clsDiscountDetails = clsDiscount.Details(cboDiscountType.Text);
                clsDiscount.CommitAndDispose();

                //if (clsDiscountDetails.DiscountPrice == 0)
                //{
                //    mDiscountType = DiscountTypes.NotApplicable;
                //    lblHeader.Text = "Not Applicable";
                //    lblDiscountType.Visible = false;
                //}
                //else 
                lblHeader.Text = mstHeader;
                if (clsDiscountDetails.InPercent)
                {
                    mDiscountType = DiscountTypes.Percentage;
                    lblDiscountType.Visible = true;
                }
                else
                {
                    mDiscountType = DiscountTypes.FixedValue;
                    lblDiscountType.Visible = false;
                }

                txtAmount.Text = clsDiscountDetails.DiscountPrice.ToString("#,##0.#0");
            }
        }
示例#5
0
		private void LoadOptions() 
		{
            lblHeader.Text = mstHeader;

            if (mDiscountType == DiscountTypes.Percentage)
            {
                lblDiscountType.Visible = true;
            }
            else if (mDiscountType == DiscountTypes.FixedValue)
            {
                lblDiscountType.Visible = false;
            }
            else if (mDiscountType == DiscountTypes.NotApplicable)
            {
                lblDiscountType.Visible = false;
            }

			txtAmount.Text = mdecDiscountAmount.ToString("#,##0.#0");
			lblBalanceAmount.Text = mdecBalanceAmount.ToString("#,##0.#0");
			
			lblDescription.Text = "Current Balance to be paid.";

            //string strTmp = "";
            cboDiscountType.Items.Clear();
            Data.Discount clsDiscount = new Data.Discount();
            foreach (System.Data.DataRow dr in clsDiscount.ListAsDataTable().Rows)
            {
                //if (mDisableVATExempt && dr["DiscountCode"].ToString() == TerminalDetails.SeniorCitizenDiscountCode)
                //    strTmp = "";
                //else if (mDisableVATExempt && dr["DiscountCode"].ToString() == TerminalDetails.PWDDiscountCode)
                //    strTmp = "";
                //else
                    cboDiscountType.Items.Add(dr["DiscountCode"]);
            }
			clsDiscount.CommitAndDispose();

			if (mDiscountCode != null & mDiscountCode != "")
				cboDiscountType.SelectedIndex = cboDiscountType.Items.IndexOf(mDiscountCode);
			else 
			{
				cboDiscountType.SelectedIndex = cboDiscountType.Items.Count - 1;
			}
			txtRemarks.Text = mRemarks;
            if (mbolIsDiscountEditable == true) { txtAmount.Enabled = true; txtAmount.Focus(); }
		}
示例#6
0
		private void LoadOptions()
		{
            foreach (string strEnum in Enum.GetNames(typeof(TerminalReceiptType)))
            {
                TerminalReceiptType itemTerminalReceiptType = (TerminalReceiptType)Enum.Parse(typeof(TerminalReceiptType), strEnum);
                cboReceiptType.Items.Add(new ListItem(strEnum, itemTerminalReceiptType.ToString("d")));
            }
			
            Data.Discount clsDiscount = new Data.Discount();
            cboDiscountCode.DataTextField = "DiscountType";
            cboDiscountCode.DataValueField = "DiscountCode";
            cboDiscountCode.DataSource = clsDiscount.ListAsDataTable().DefaultView;
            cboDiscountCode.DataBind();
            cboDiscountCode.SelectedIndex = cboDiscountCode.Items.Count - 1;

            cboPWDDiscountCode.DataTextField = "DiscountType";
            cboPWDDiscountCode.DataValueField = "DiscountCode";
            cboPWDDiscountCode.DataSource = clsDiscount.ListAsDataTable().DefaultView;
            cboPWDDiscountCode.DataBind();
            cboPWDDiscountCode.SelectedIndex = cboDiscountCode.Items.Count - 1;

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

            cboGroupChargeType.DataTextField = "ChargeTypeCode";
            cboGroupChargeType.DataValueField = "ChargeTypeID";
            cboGroupChargeType.DataSource = clsChargeType.ListAsDataTable().DefaultView;
            cboGroupChargeType.DataBind();
            cboGroupChargeType.Items.Insert(0, new ListItem("", "0"));
            cboGroupChargeType.SelectedIndex = 0;

            cboPersonalChargeType.DataTextField = "ChargeTypeCode";
            cboPersonalChargeType.DataValueField = "ChargeTypeID";
            cboPersonalChargeType.DataSource = clsChargeType.ListAsDataTable().DefaultView;
            cboPersonalChargeType.DataBind();
            cboPersonalChargeType.Items.Insert(0, new ListItem("", "0"));
            cboPersonalChargeType.SelectedIndex = 0;

            cboDefaultTransactionChargeCode.DataTextField = "ChargeTypeCode";
            cboDefaultTransactionChargeCode.DataValueField = "ChargeTypeCode";
            cboDefaultTransactionChargeCode.DataSource = clsChargeType.ListAsDataTable().DefaultView;
            cboDefaultTransactionChargeCode.DataBind();
            cboDefaultTransactionChargeCode.Items.Insert(0, new ListItem("", ""));
            cboDefaultTransactionChargeCode.SelectedIndex = 0;

            cboDineInChargeCode.DataTextField = "ChargeTypeCode";
            cboDineInChargeCode.DataValueField = "ChargeTypeCode";
            cboDineInChargeCode.DataSource = clsChargeType.ListAsDataTable().DefaultView;
            cboDineInChargeCode.DataBind();
            cboDineInChargeCode.Items.Insert(0, new ListItem("", ""));
            cboDineInChargeCode.SelectedIndex = 0;

            cboTakeOutChargeCode.DataTextField = "ChargeTypeCode";
            cboTakeOutChargeCode.DataValueField = "ChargeTypeCode";
            cboTakeOutChargeCode.DataSource = clsChargeType.ListAsDataTable().DefaultView;
            cboTakeOutChargeCode.DataBind();
            cboTakeOutChargeCode.Items.Insert(0, new ListItem("", ""));
            cboTakeOutChargeCode.SelectedIndex = 0;

            cboDeliveryChargeCode.DataTextField = "ChargeTypeCode";
            cboDeliveryChargeCode.DataValueField = "ChargeTypeCode";
            cboDeliveryChargeCode.DataSource = clsChargeType.ListAsDataTable().DefaultView;
            cboDeliveryChargeCode.DataBind();
            cboDeliveryChargeCode.Items.Insert(0, new ListItem("", ""));
            cboDeliveryChargeCode.SelectedIndex = 0;

            clsDiscount.CommitAndDispose();
		}
示例#7
0
        private void LoadOptions()
        {
            foreach (string strEnum in Enum.GetNames(typeof(TerminalReceiptType)))
            {
                TerminalReceiptType itemTerminalReceiptType = (TerminalReceiptType)Enum.Parse(typeof(TerminalReceiptType), strEnum);
                cboReceiptType.Items.Add(new ListItem(strEnum, itemTerminalReceiptType.ToString("d")));
            }

            Data.Discount clsDiscount = new Data.Discount();
            cboDiscountCode.DataTextField  = "DiscountType";
            cboDiscountCode.DataValueField = "DiscountCode";
            cboDiscountCode.DataSource     = clsDiscount.ListAsDataTable().DefaultView;
            cboDiscountCode.DataBind();
            cboDiscountCode.SelectedIndex = cboDiscountCode.Items.Count - 1;

            cboPWDDiscountCode.DataTextField  = "DiscountType";
            cboPWDDiscountCode.DataValueField = "DiscountCode";
            cboPWDDiscountCode.DataSource     = clsDiscount.ListAsDataTable().DefaultView;
            cboPWDDiscountCode.DataBind();
            cboPWDDiscountCode.SelectedIndex = cboDiscountCode.Items.Count - 1;

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

            cboGroupChargeType.DataTextField  = "ChargeTypeCode";
            cboGroupChargeType.DataValueField = "ChargeTypeID";
            cboGroupChargeType.DataSource     = clsChargeType.ListAsDataTable().DefaultView;
            cboGroupChargeType.DataBind();
            cboGroupChargeType.Items.Insert(0, new ListItem("", "0"));
            cboGroupChargeType.SelectedIndex = 0;

            cboPersonalChargeType.DataTextField  = "ChargeTypeCode";
            cboPersonalChargeType.DataValueField = "ChargeTypeID";
            cboPersonalChargeType.DataSource     = clsChargeType.ListAsDataTable().DefaultView;
            cboPersonalChargeType.DataBind();
            cboPersonalChargeType.Items.Insert(0, new ListItem("", "0"));
            cboPersonalChargeType.SelectedIndex = 0;

            cboDefaultTransactionChargeCode.DataTextField  = "ChargeTypeCode";
            cboDefaultTransactionChargeCode.DataValueField = "ChargeTypeCode";
            cboDefaultTransactionChargeCode.DataSource     = clsChargeType.ListAsDataTable().DefaultView;
            cboDefaultTransactionChargeCode.DataBind();
            cboDefaultTransactionChargeCode.Items.Insert(0, new ListItem("", ""));
            cboDefaultTransactionChargeCode.SelectedIndex = 0;

            cboDineInChargeCode.DataTextField  = "ChargeTypeCode";
            cboDineInChargeCode.DataValueField = "ChargeTypeCode";
            cboDineInChargeCode.DataSource     = clsChargeType.ListAsDataTable().DefaultView;
            cboDineInChargeCode.DataBind();
            cboDineInChargeCode.Items.Insert(0, new ListItem("", ""));
            cboDineInChargeCode.SelectedIndex = 0;

            cboTakeOutChargeCode.DataTextField  = "ChargeTypeCode";
            cboTakeOutChargeCode.DataValueField = "ChargeTypeCode";
            cboTakeOutChargeCode.DataSource     = clsChargeType.ListAsDataTable().DefaultView;
            cboTakeOutChargeCode.DataBind();
            cboTakeOutChargeCode.Items.Insert(0, new ListItem("", ""));
            cboTakeOutChargeCode.SelectedIndex = 0;

            cboDeliveryChargeCode.DataTextField  = "ChargeTypeCode";
            cboDeliveryChargeCode.DataValueField = "ChargeTypeCode";
            cboDeliveryChargeCode.DataSource     = clsChargeType.ListAsDataTable().DefaultView;
            cboDeliveryChargeCode.DataBind();
            cboDeliveryChargeCode.Items.Insert(0, new ListItem("", ""));
            cboDeliveryChargeCode.SelectedIndex = 0;

            clsDiscount.CommitAndDispose();
        }