public IActionResult Details()
        {
            id = int.Parse(HttpContext.Session.GetString("User_ID"));
            OrderList    itemVM = new OrderList();
            User         user   = _servise.GetByID(id);
            List <Order> orders = _order.GetAll(x => x.UserID == id);

            itemVM                   = PopulateOrdersInformation(itemVM, orders);
            itemVM.CurrentUser       = PopulateUserInformation(itemVM.CurrentUser, user);
            itemVM.Product           = PopulateProductINformation(itemVM.Product, orders);
            itemVM.QuantityOrderList = Populatequntity(itemVM.QuantityOrderList, orders);

            return(View(itemVM));
        }
示例#2
0
        private User PopulateUser(Order order)
        {
            User            entity   = new User();
            UserServise     _user    = new UserServise();
            EncriptServises _encript = new EncriptServises();
            var             model    = _user.GetByID(order.UserID);

            entity.Name       = _encript.DencryptData(model.Name);
            entity.SecondName = _encript.DencryptData(model.SecondName);
            entity.City       = _encript.DencryptData(model.City);
            entity.Adress     = _encript.DencryptData(model.Adress);
            entity.Telephone  = _encript.DencryptData(model.Telephone);

            return(entity);
        }
示例#3
0
        public ActionResult MakeOrder()
        {
            RegistrationVM model  = new RegistrationVM();
            string         userID = Session["User_ID"].ToString();

            if (userID != null)
            {
                UserServise     _login   = new UserServise();
                EncriptServises _encript = new EncriptServises();
                User            user     = new User();
                user                    = _login.GetByID(int.Parse(userID));
                model.FirstName         = _encript.DencryptData(user.Name);
                model.SecondName        = _encript.DencryptData(user.SecondName);
                model.City              = _encript.DencryptData(user.City);
                model.Adress            = _encript.DencryptData(user.Adress);
                model.Telephone         = _encript.DencryptData(user.Telephone);
                ViewData["Information"] = "Вие имате регистрация в нашия  сайт! Моля натиснете бътона 'Поръчай', за да направите поръчката си!";
            }
            else
            {
                ViewData["Information"] = "Моля въведете информацията която се изисква за да направите вашата поръчка!";
            }
            return(View(model));
        }