Beispiel #1
0
        public ActionResult Detail(int Id = 0)
        {
            ViewBag.Height = (int)(Request.Browser.ScreenPixelsHeight * 0.85);
            TB_SERVICES d = Services_Service.GetById(Id);

            List <TB_TYPE_DETAILS> types = Types_Service.GetAllDetails(d.ServiceTypeCode);

            ViewBag.Types = types;
            List <TB_SERVICE_DETAILS> details = Services_Service.GetAllDetails(Id);

            ViewBag.Details = details;

            List <TB_FILES> file     = Files_Service.GetByRefecense("" + Id).Where(x => x.FileType == "SERVICE").ToList();
            List <TB_TYPES> listType = Types_Service.GetAll();

            ViewBag.Files    = file;
            ViewBag.ListType = listType;

            List <TB_MENUS> listMenu = new List <TB_MENUS>();

            listMenu      = Menu_Service.GetByServiceId(Id);
            ViewBag.Menus = listMenu;

            return(View(d));
        }
Beispiel #2
0
        public PartialViewResult _MenuDetail(int menuId)
        {
            List <V_Group_Menu> listMenuDetails = new List <V_Group_Menu>();

            try
            {
                listMenuDetails = Menu_Service.GetAllDetails(menuId);
            }
            catch (Exception)
            {
            }
            ViewBag.Details = listMenuDetails;

            return(PartialView());
        }
Beispiel #3
0
        public JsonResult GetPrice(int serviceId, int serviceNum, string code = "", int menuId = 0, int num = 0)
        {
            AjaxResultModel Result = new AjaxResultModel();

            Result.Result = 0;

            try
            {
                TB_SERVICES s = Services_Service.GetById(serviceId);
                decimal     p = s.ServicePrice * serviceNum;

                if (!string.IsNullOrEmpty(code))
                {
                    TB_VOUCHERS v = Voucher_Service.GetByCode(code);
                    if (v != null && v.VoucherDateExpired.Date >= DateTime.Now.Date && v.VoucherState == "A")
                    {
                        if (v.VoucherType == "M")//Giảm tiền
                        {
                            p = p - v.VoucherNum;
                        }
                        else if (v.VoucherType == "P")//Giảm phần trăm
                        {
                            p = p * (100 - v.VoucherNum) / 100;
                        }
                    }
                }

                if (num > 0 && menuId > 0)
                {
                    TB_MENUS m = Menu_Service.GetById(menuId);
                    if (m != null)
                    {
                        p += m.MenuPrice * num;
                    }
                }

                Result.Code   = 000;
                Result.Result = string.Format("{0:N0}", p);
            }
            catch (Exception Ex)
            {
                Result.Code   = 2000;
                Result.Result = 0;
                CORE.Helpers.IOHelper.WriteLog(StartUpPath, IpAddress, "UpdatePassword :", Ex.Message, Ex.ToString());
            }

            return(Json(Result));
        }
Beispiel #4
0
        public PartialViewResult _MenuGroup(int serviceId)
        {
            List <TB_MENUS> listMenu = new List <TB_MENUS>();

            try
            {
                listMenu = Menu_Service.GetByServiceId(serviceId);

                ViewBag.Height = (int)(Request.Browser.ScreenPixelsHeight * 0.85);
            }
            catch (Exception)
            {
            }
            ViewBag.Menus = listMenu;

            return(PartialView());
        }
Beispiel #5
0
        //Laden van menuitems per kaart in listview
        private void GetMenus()
        {
            int amount = 0;

            menuList = new List <MenuItem>();

            listviewMenu.Items.Clear();

            //Drank kaart
            if (sort == "Drinks")
            {
                mlblSoortBestelling.Text = "Dranken";
                Menu_Service menuService = new Menu_Service();
                menuList = menuService.GetDrinks();

                //Lunch kaart
            }
            else if (sort == "Lunch")
            {
                mlblSoortBestelling.Text = "Lunch";
                Menu_Service menuService = new Menu_Service();
                menuList = menuService.GetLunch();

                //Diner kaart
            }
            else if (sort == "Diner")
            {
                mlblSoortBestelling.Text = "Diner";
                Menu_Service menuService = new Menu_Service();
                menuList = menuService.GetDiner();
            }

            foreach (MenuItem m in menuList)
            {
                ListViewItem li = new ListViewItem(m.naam);
                li.SubItems.Add(amount.ToString());
                listviewMenu.Items.Add(li);
            }
            listviewMenu.View = View.Details;
            listviewMenu.Columns.Add("Naam");
            listviewMenu.Columns.Add("Aantal");
        }
Beispiel #6
0
        //Laden van menuitems per kaart in listview
        private void GetMenus()
        {
            menuList = new List <MenuItem>();
            listviewMenu.Items.Clear();

            //Drank kaart
            if (sort == "Drinks")
            {
                mlblSoortBestelling.Text = "Dranken";
                Menu_Service menuService = new Menu_Service();
                menuList = menuService.GetDrinks();

                //Lunch kaart
            }
            else if (sort == "Lunch")
            {
                mlblSoortBestelling.Text = "Lunch";
                Menu_Service menuService = new Menu_Service();
                menuList = menuService.GetLunch();

                //Diner kaart
            }
            else if (sort == "Diner")
            {
                mlblSoortBestelling.Text = "Diner";
                Menu_Service menuService = new Menu_Service();
                menuList = menuService.GetDiner();
            }

            foreach (MenuItem m in menuList)
            {
                ListViewItem li = new ListViewItem(m.naam);
                listviewMenu.Items.Add(li);
                li.Tag         = m;
                li.ToolTipText = m.naam;
            }
            listviewMenu.View = View.Details;
            listviewMenu.Columns.Add("Naam");
            listviewMenu.AutoResizeColumns(ColumnHeaderAutoResizeStyle.ColumnContent);
        }
        /*
         * Menu Main
         */
        private void PopulateMenu()
        {
            if (flowLayoutPanelMenu.Controls.Count == 0)
            {
                Menu_Service menu_service = new Menu_Service();

                // Get all menu items from the database
                List <MainMenu> menuList = menu_service.GetFullMenu();

                foreach (MainMenu menu in menuList)
                {
                    // Create a custom usercontrol with the data from the 'Drinks, Dinner, and Lunch' menu, for the windows forms app.
                    MenuLinkItem menuLink = new MenuLinkItem(menu.MenuName);

                    // Add a custom eventHandler to show the categories corresponding with the clicked menu
                    menuLink.MenuLinkItemClick += (sender, EventArgs) => {
                        MenuLinkItem_Click(menu.MenuCategories);
                        lbl_ActiveMenu.Text = menu.MenuName + " Menu";
                    };

                    flowLayoutPanelMenu.Controls.Add(menuLink);
                }
            }
        }