Ejemplo n.º 1
0
 public IActionResult GetInformation() => View((from i in _securityInformationService.GetAll()
                                                select new SecurityInformationModel
 {
     Id = i.Id,
     AdversitingRule = i.AdversitingRule,
     FAQ = i.FAQ,
     PrivacyPolicy = i.PrivacyPolicy,
     TermsOfUse = i.TermsOfUse
 }));
Ejemplo n.º 2
0
        public IActionResult GetAllProductDetails(int id)
        {
            #region Product Web Site Rules

            var security = _securityInformationService.GetAll();
            ViewBag.Information = security;

            #endregion

            ViewBag.AnimalsProduct = _productService.GetAll();

            List <string> category = new List <string>();
            ViewBag.ProductsMultipleImages = _multipleProductImagesService.GetByIdMultiImages(id); //ürünle ilişkili çoklu resim getir
            var response = _productService.GetById(id);

            var entitys = _productService.GetByIdWithCategories((int)id);

            foreach (var item in entitys.ProductCategories)
            {
                category.Add(item.Category.Name);
            }

            ViewBag.CategoriesWith       = category;
            ViewBag.GetAllProductDetails = response;

            var entity = new ProductModel()
            {
                AnimalAge         = response.AnimalAge,
                AnnouncementDate  = response.AnnouncementDate,
                City              = response.City,
                Country           = response.Country,
                Description       = response.Description,
                FarmerDeclareType = response.FarmerDeclareType,
                Gender            = response.Gender,
                Guarantee         = response.Guarantee,
                Id               = response.Id,
                ImageURL         = response.ImageUrl,
                Name             = response.Name,
                Neighborhood     = response.Neighborhood,
                PermissionToSell = response.PermissionToSell,
                Price            = response.Price,
                Situation        = response.Situation,
                StockQty         = response.StockQty,
                Swap             = response.Swap,
                Title            = response.Title,
                UserEMail        = response.UserEMail,
                UserId           = response.UserId,
                UserName         = response.UserName,
                UserPhoneNumber  = response.UserPhoneNumber,
                UserSurname      = response.UserSurname,
                ProductComments  = response.ProductComments != null ?
                                   (from pc in response.ProductComments
                                    select new ProductComment
                {
                    Comment = pc.Comment,
                    CommentDate = pc.CommentDate,
                    Email = pc.Email,
                    Name = pc.Name,
                    Id = pc.Id,
                    ProductId = response.Id,
                    Surname = pc.Surname,
                    UserId = pc.UserId,
                    WebSite = pc.WebSite
                }).ToList():null
            };

            return(View(entity));
        }
Ejemplo n.º 3
0
 public IActionResult GetAllSecurityInformation() => Ok(_mapper.Map <List <FarmerSecurityInformationDTO> >(_securityInformationService.GetAll()));