Пример #1
0
        public ActionResult change_password([Bind(Include = "Password")] ResturantOwner resturantOwner)
        {
            ResturantOwner resturantOwnerUpdate = (ResturantOwner)Session["user"];


            if (Request["currentPassword"] == resturantOwnerUpdate.Password)
            {
                if (resturantOwner.Password == Request["confirmPassword"])
                {
                    resturantOwnerUpdate.Password = resturantOwner.Password;

                    _context.Entry(resturantOwnerUpdate).State = EntityState.Modified;
                    _context.SaveChanges();

                    ViewBag.message = "Password Changed";
                    return(View());
                }
                else
                {
                    ViewBag.message = "New Password and Confirm Password do not match";
                    return(View());
                }
            }
            else
            {
                ViewBag.message = "Password incorret";
                return(View());
            }
        }
Пример #2
0
        public ActionResult addNewResturant([Bind(Include = "ResturantOwnerName,ResturantName,Email,Phone,Address,Role,ResturantStatus,JoinDate,AreaId,Password")] ResturantOwner resturant)
        {
            //System.Diagnostics.Debug.WriteLine(resturant.AreaId);
            //System.Diagnostics.Debug.WriteLine(resturant.Password);


            _context.ResturantOwners.Add(resturant);
            _context.SaveChanges();
            ViewBag.messege = "Resturant Owner Created";

            return(RedirectToAction("addNewResturant", "Admins"));
        }
Пример #3
0
        public ActionResult edit_resturantowner_profile([Bind(Include = "ResturantOwnerName,ResturantName,Email,Address,Phone")] ResturantOwner owner)
        {
            ResturantOwner ownerUpdate = (ResturantOwner)Session["user"];

            ownerUpdate.ResturantOwnerName = owner.ResturantOwnerName;
            ownerUpdate.ResturantName      = owner.ResturantName;
            ownerUpdate.Email   = owner.Email;
            ownerUpdate.Address = owner.Address;
            ownerUpdate.Phone   = owner.Phone;
            Session["user"]     = ownerUpdate;
            _context.Entry(ownerUpdate).State = EntityState.Modified;
            _context.SaveChanges();

            ViewBag.message = "Profile Changed";
            return(View(owner));
        }
Пример #4
0
        //get request
        public ActionResult orders_resturantOwner()
        {
            ResturantOwner customer = (ResturantOwner)Session["user"];

            IEnumerable <Order>            orders           = _context.Orders.Where(o => o.ResturantName == customer.ResturantName);
            IEnumerable <OrderedMenuItems> orderedMenuItems = _context.OrderedMenuItems;
            IEnumerable <ResturantOwner>   resturantOwners  = _context.ResturantOwners;
            IEnumerable <ResturantMenu>    resturantMenu    = _context.ResturantMenus;

            var resturants = from order in orders
                             join orderedMenuItem in orderedMenuItems on order.Id equals orderedMenuItem.OrderId
                             join resturantMenus in resturantMenu on orderedMenuItem.Id equals resturantMenus.Id
                             join resturantOwner in resturantOwners on resturantMenus.Id equals resturantOwner.Id
                             select resturantOwner;



            CustomerOrdersViewModels viewModel = new CustomerOrdersViewModels();

            viewModel.Orders           = orders;
            viewModel.OrderedMenuItems = orderedMenuItems;
            viewModel.ResturantOwner   = resturants;
            return(View(viewModel));
        }
Пример #5
0
        public ActionResult edit_resturantowner_profile()
        {
            ResturantOwner owner = (ResturantOwner)Session["user"];

            return(View(owner));
        }
Пример #6
0
        public ActionResult ResturantOwner_profile()
        {
            ResturantOwner customer = (ResturantOwner)Session["user"];

            return(View(customer));
        }
Пример #7
0
        // GET: Resturant_owner
        public ActionResult Dashboard()
        {
            ResturantOwner customer = (ResturantOwner)Session["user"];

            return(View(customer));
        }