Ejemplo n.º 1
0
    public void populateMenus()
    {
        HotelMenu clsHotelMenu = new HotelMenu();

        try
        {
        }
        finally
        {
            clsHotelMenu = null;
        }
    }
Ejemplo n.º 2
0
    public void populateMenus(string sMenuType)
    {
        HotelMenu clsHotelMenu = new HotelMenu();

        try
        {
            dlMenuItems.DataSource = clsHotelMenu.getMenuItemsByType(sMenuType);
            dlMenuItems.DataBind();
        }
        finally
        {
            clsHotelMenu = null;
        }
    }
Ejemplo n.º 3
0
    protected void populateRecipe()
    {
        HotelMenu clsHotelMenu = new HotelMenu();

        try
        {
            grdMenus.DataSource = null;
            grdMenus.DataSource = clsHotelMenu.getMenuForMgmt();
            grdMenus.DataBind();
        }
        finally
        {
            clsHotelMenu = null;
        }
    }
Ejemplo n.º 4
0
    public void populateMenus()
    {
        HotelMenu clsHotelMenu = new HotelMenu();

        try
        {
            dlMenuItems.Items.Clear();
            dlMenuItems.DataSource = clsHotelMenu.getMenuItemsForRecipe();
            dlMenuItems.DataBind();
        }
        finally
        {
            clsHotelMenu = null;
        }
    }
Ejemplo n.º 5
0
    protected void populateRecipe()
    {
        HotelMenu clsHotelMenu = new HotelMenu();

        try
        {
            grdRecipe.DataSource = null;
            grdRecipe.DataSource = clsHotelMenu.getRecipeForMenu(Convert.ToInt16(dlMenuItems.SelectedValue.ToString()));
            grdRecipe.DataBind();
        }
        finally
        {
            clsHotelMenu = null;
        }
    }
Ejemplo n.º 6
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {

            HotelMenu objHotelMenu = new HotelMenu();
            try
            {
                //validate
                if (txtMenuName.Text != "" && txtCost.Text !="")
                {
                    objHotelMenu.insertNewMenuItem(
                        Convert.ToInt16(dlMenuType.SelectedValue),
                        txtMenuName.Text.Trim(),
                        Convert.ToDecimal(txtCost.Text),
                        Convert.ToInt16(Session[Constants.SVAR_USER_ID]),
                        int.Parse(Session[Constants.SVAR_HOTEL_ID].ToString()),
                        selectedIndexesOfCheckBoxList(chkTaxMaster)) ;
                    txtCost.Text = "";
                    chkTaxMaster.ClearSelection();
                    //show success
                    lblValidation.Text = "Save Success";
                    lblValidation.ForeColor = System.Drawing.Color.Green;
                    lblValidation.Font.Bold = true;

                }
                else {
                    lblValidation.Text = "You must provide menu name, cost and tax code associated with it.";
                    lblValidation.ForeColor = System.Drawing.Color.Red;
                    lblValidation.Font.Bold = true;
                }
            }
            catch (Exception ex)
            {
                Response.Redirect("~/Web/error.aspx?msg=" + Server.UrlEncode(ex.Message.ToString()).ToString(), false);
            }
            finally
            {

            }

        }
}