Index: PostgreSqlDotnetCore/Controllers/BlogController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/BlogController.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Controllers/BlogController.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -89,4 +89,6 @@
             }
             BlogPostConsultation blogClass = db.BlogPostControllerObj.Find(id);
+            UsersClass customerClass = await getCrrentUser();
+            ViewBag.isAuthenticated = customerClass;
             if (blogClass == null)
             {
@@ -102,4 +104,5 @@
             var blogAnswers = query.ToList();
             blogClass.BlogPostAnswers = blogAnswers;
+            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
             return View(blogClass);
         }
@@ -121,5 +124,7 @@
 
             // check for permission
-            UsersClass customerClass = await getCrrentUser();
+            //UsersClass customerClass = await checkAuthorizationAsync();
+           // ViewBag.isAuthenticated = await getCrrentUser();
+           UsersClass customerClass = await getCrrentUser();
             // set if is authenticated
             ViewBag.isAuthenticated = customerClass;
@@ -143,4 +148,6 @@
                     var user = await _userManager.GetUserAsync(User);
                     var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
+                   //dodadeno na 25.08
+                    ViewBag.isAuthenticated = await getCrrentUser();
                     if (customerClass != null)
                     {
@@ -184,7 +191,8 @@
             }
 
-            // check for permission
-            UsersClass customerClass = await checkAuthorizationAsync();
-            //dodadeno na 23.08
+            // izbriseno na 26.08
+           UsersClass customerClass = await checkAuthorizationAsync();
+            //dodadeno na 26.08
+           // UsersClass customerClass = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin);
             ViewBag.isAuthenticated = await getCrrentUser();
             if (customerClass == null)
@@ -204,4 +212,5 @@
             // no access for standard user
             ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
+            ViewBag.OnlyAdminManager1 = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
 
 
@@ -233,4 +242,6 @@
                 if (existingBlogClass != null)
                 {
+                    
+
                     // Запамтете ја старата вредност на users_id
                     blogClass.users_id = existingBlogClass.users_id;
@@ -247,4 +258,5 @@
 
         // GET: Customer/Delete/5
+        
         public async Task<ActionResult> DeleteAsync(int? id)
         {
@@ -286,4 +298,5 @@
         }
 
+
         // POST: Customer/Delete/5
 
@@ -298,4 +311,10 @@
             return RedirectToAction("Index");
         }
+        
+        // GET: Customer/Delete/5
+        // GET: Customer/Delete/5
+        // GET: Customer/Delete/5
+    
+
 
         protected override void Dispose(bool disposing)
Index: PostgreSqlDotnetCore/Controllers/BlogPostAnswersController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/BlogPostAnswersController.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Controllers/BlogPostAnswersController.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -14,12 +14,22 @@
 
         // GET: Customer
-        public ActionResult Index()
-        {
-            //return View(Enumerable.Empty<UsersClass>());
+        //public ActionResult Index()
+         public async Task<ActionResult> IndexAsync()
+         {
+             //return View(Enumerable.Empty<UsersClass>());
+             UsersClass customerClass = await getCrrentUser();
+
+             // set if is authenticated
+             ViewBag.isAuthenticated = customerClass;
+            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
             return View(db.BlogPostAnswersObj.ToList());
         }
 
+
+
+
         // GET: Customer/Details/5
-        public ActionResult Details(int? id)
+        // public ActionResult Details(int? id)
+        public async Task<ActionResult> Details(int? id)
         {
             if (id == null)
@@ -27,4 +37,6 @@
                 return RedirectToAction("NotExist", "Error");
             }
+            UsersClass customerClass = await getCrrentUser(); // Добијте ја тековната улога на корисникот
+            ViewBag.isAuthenticated = customerClass;
             BlogPostAnswers answerClass = db.BlogPostAnswersObj.Find(id);
             if (answerClass == null)
@@ -32,4 +44,15 @@
                 return RedirectToAction("NotExist", "Error");
             }
+
+
+            // query
+            var query = from st in db.BlogPostAnswersObj
+                        where st.parent_id == answerClass.id
+                        select st;
+            //elenaaa
+            var answersUnderA = query.Where(x => x.id != answerClass.id).ToList();
+
+            answerClass.blogPostAnswers = answersUnderA;
+            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
             return View(answerClass);
         }
@@ -46,8 +69,12 @@
             // check for permission
             UsersClass customerClass = await checkAuthorizationAsync();
+           // UsersClass customerClass = await getCrrentUser();
+            // set if is authenticated
+            ViewBag.isAuthenticated = customerClass;
             if (customerClass == null)
             {
                 return RedirectToAction("AccessDenied", "Error");
             }
+            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
             return View();
         }
@@ -90,4 +117,5 @@
                 return RedirectToAction("Details", "Blog", new { id });
             }
+            ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
 
             return View(answerClass);
@@ -139,4 +167,5 @@
         public async Task<ActionResult> DeleteAsync(int? id)
         {
+          
             if (id == null)
             {
@@ -159,5 +188,6 @@
                 }
             }
-            return View(answerClass);
+            // return View(answerClass);
+             return View(answerClass);
         }
 
Index: PostgreSqlDotnetCore/Controllers/HomeController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/HomeController.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Controllers/HomeController.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -1,4 +1,5 @@
 ﻿using Microsoft.AspNetCore.Identity;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
 using PostgreSqlDotnetCore.Data;
 using PostgreSqlDotnetCore.Models;
@@ -30,5 +31,5 @@
                 if (user != null)
                 {
-                    UsersClass customerClass = db.CustomerObj.SingleOrDefault(x=> x.email == user.Email);
+                    UsersClass customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
                     if (customerClass == null)
                     {
@@ -43,5 +44,7 @@
                                 lastName = nameLastName[0].Split('.')[1];
                             }
-                        } catch(Exception ex) { 
+                        }
+                        catch (Exception ex)
+                        {
                         }
                         db.CustomerObj.Add(new UsersClass(
@@ -65,5 +68,6 @@
                 }
 
-            } else
+            }
+            else
             {
                 ViewBag.isAuthenticated = null;
@@ -86,4 +90,9 @@
         public async Task<IActionResult> ContactAsync()
         {
+
+            //var query = db.Database.ExecuteSqlRaw("CALL get_pet_details()");
+            //var query = db.Database.ExecuteSqlRaw("SELECT * FROM get_pet_details()");
+
+
             // set if is authenticated
             ViewBag.isAuthenticated = await getCrrentUser();
Index: PostgreSqlDotnetCore/Controllers/PetCaresController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/PetCaresController.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Controllers/PetCaresController.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -36,4 +36,15 @@
             ViewBag.VetCenters = new SelectList(vetCenters, "id", "name");
 
+
+            // check if the user is authenticated so we can take only his pets
+            if (customerClass != null)
+            {
+                var queryPetsByUser = from st in db.PetsObj
+                                      where st.usersid == customerClass.id
+                                      select st;
+                var userPets = await queryPetsByUser.ToListAsync<PetsClass>();
+                ViewBag.Pets = new SelectList(userPets, "id", "name");
+
+            }
             return View();
         }
@@ -63,29 +74,8 @@
                             select st;
 
-                var userPets =
-                    //db.PetCaresObj.FromSql($"SELECT * FROM pets where usersid={customerClass.id}").ToListAsync();
+                var userPetCares =
                     await query.ToListAsync<Pet_CaresClass>();
 
-                return View(userPets);
-
-                PetCareAllData petCareAllData = new PetCareAllData();
-                petCareAllData.PetCares = userPets;
-
-
-                // query
-                var queryVetCenters = from kk in db.VetCentersObj
-                                      select kk;
-
-                // query
-                var queryUsers = from st in db.CustomerObj
-                                 select st;
-
-                var users = await queryUsers.ToListAsync<UsersClass>();
-                petCareAllData.Users = users;
-
-                //var vetCenters = await queryVetCenters.ToListAsync<VetCenter>();
-                //petCareAllData.VetCenters = vetCenters;
-
-                return View(petCareAllData);
+                return View(userPetCares);
             }
             else
@@ -133,5 +123,5 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public async Task<ActionResult> CreateAsync([Bind(include: "id,title,description,dateending, start_date, usersid, vetcentersid")] Pet_CaresClass peClass)
+        public async Task<ActionResult> CreateAsync([Bind(include: "id,title,description,dateending, start_date, usersid, vetcentersid, pet_id")] Pet_CaresClass peClass)
         {
             bool isAuthenticated = User.Identity.IsAuthenticated;
@@ -143,5 +133,5 @@
             // no access for standard user
             ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
-
+            UsersClass customerClass =  null;
             if (ModelState.IsValid)
             {
@@ -150,5 +140,5 @@
                 peClass.start_date = DateTime.SpecifyKind(peClass.start_date, DateTimeKind.Utc);
                 var user = await _userManager.GetUserAsync(User);
-                var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
+                customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
                 peClass.usersid = customerClass.id;
                 db.PetCaresObj.Add(peClass);
@@ -159,13 +149,14 @@
             ViewBag.VetCenters = new SelectList(vetCenters, "id", "name");
 
-            return View(peClass);
-        }
-
-
-
-
-
-
-
+
+            var queryPetsByUser = from st in db.PetsObj
+                                  where st.usersid == customerClass.id
+                                  select st;
+            var userPets =await queryPetsByUser.ToListAsync<PetsClass>();
+            ViewBag.Pets= new SelectList(userPets, "id", "name");
+
+
+            return View(peClass);
+        }
 
 
@@ -219,5 +210,16 @@
             ViewBag.VetCenters = new SelectList(vetCenters, "id", "name", peClass.vetcentersid);
             // dodadeno na 22.08
-            ViewBag.isAuthenticated = await getCrrentUser();
+            UsersClass customerClass = await getCrrentUser();
+            // check if the user is authenticated so we can take only his pets
+            if (customerClass != null)
+            {
+                var queryPetsByUser = from st in db.PetsObj
+                                      where st.usersid == customerClass.id
+                                      select st;
+                var userPets = await queryPetsByUser.ToListAsync<PetsClass>();
+                ViewBag.Pets = new SelectList(userPets, "id", "name");
+
+            }
+            ViewBag.isAuthenticated = customerClass;
             return View(peClass);
         }
@@ -230,5 +232,5 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public async Task<ActionResult> EditAsync([Bind(include: "id,title,description,dateending, vetcentersid")] Pet_CaresClass peClass)
+        public async Task<ActionResult> EditAsync([Bind(include: "id,title,description,dateending, vetcentersid, pet_id")] Pet_CaresClass peClass)
         {
             bool isAuthenticated = User.Identity.IsAuthenticated;
Index: PostgreSqlDotnetCore/Controllers/PetDiagnosticsControler.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/PetDiagnosticsControler.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
+++ PostgreSqlDotnetCore/Controllers/PetDiagnosticsControler.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -0,0 +1,94 @@
+﻿namespace PostgreSqlDotnetCore.Controllers
+{
+    using Microsoft.AspNetCore.Http;
+    using Microsoft.AspNetCore.Identity;
+    using Microsoft.AspNetCore.Mvc;
+    using Microsoft.Data.SqlClient;
+    using Microsoft.EntityFrameworkCore;
+    using PostgreSqlDotnetCore.Models;
+    using System.Threading.Tasks;
+
+    public class PetDiagnosticsControler : BaseController
+    {
+        public PetDiagnosticsControler(UserManager<IdentityUser> userManager) : base(userManager)
+        {
+
+        }
+        // GET: PetDiagnostics
+        public async Task<ActionResult> IndexAsync()
+        {
+            var query = await db.PetDetailsProcedureObj.ToListAsync();
+
+            return View();
+        }
+
+        // GET: PetDiagnostics/Details/5
+        public ActionResult Details(int id)
+        {
+            return View();
+        }
+
+        // GET: PetDiagnostics/Create
+        public ActionResult Create()
+        {
+            return View();
+        }
+
+        // POST: PetDiagnostics/Create
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Create(IFormCollection collection)
+        {
+            try
+            {
+                return RedirectToAction(nameof(IndexAsync));
+            }
+            catch
+            {
+                return View();
+            }
+        }
+
+        // GET: PetDiagnostics/Edit/5
+        public ActionResult Edit(int id)
+        {
+            return View();
+        }
+
+        // POST: PetDiagnostics/Edit/5
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Edit(int id, IFormCollection collection)
+        {
+            try
+            {
+                return RedirectToAction(nameof(IndexAsync));
+            }
+            catch
+            {
+                return View();
+            }
+        }
+
+        // GET: PetDiagnostics/Delete/5
+        public ActionResult Delete(int id)
+        {
+            return View();
+        }
+
+        // POST: PetDiagnostics/Delete/5
+        [HttpPost]
+        [ValidateAntiForgeryToken]
+        public ActionResult Delete(int id, IFormCollection collection)
+        {
+            try
+            {
+                return RedirectToAction(nameof(IndexAsync));
+            }
+            catch
+            {
+                return View();
+            }
+        }
+    }
+}
Index: PostgreSqlDotnetCore/Controllers/PetsController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/PetsController.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Controllers/PetsController.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -31,5 +31,5 @@
             if (customerClass.role_id == RoleConstants.Standard)
             {
-                // kco
+                // filter user pets by UserID
                 var query = from st in db.PetsObj
                             where st.usersid == customerClass.id
Index: PostgreSqlDotnetCore/Controllers/ProductsController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/ProductsController.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Controllers/ProductsController.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -48,4 +48,6 @@
         }
 
+        
+
         // GET: Customer/Details/5
         public async Task<ActionResult> Details(int? id)
@@ -55,5 +57,10 @@
                 return RedirectToAction("NotExist", "Error");
             }
-            UsersClass customerClass = await getCrrentUser(); 
+            // додано на 28.08
+         
+
+
+
+          UsersClass customerClass = await getCrrentUser(); 
             ViewBag.isAuthenticated = customerClass;
             ProductsClass prodClass = db.ProductObj.Find(id);
Index: PostgreSqlDotnetCore/Controllers/VetCenterController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/VetCenterController.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Controllers/VetCenterController.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -5,4 +5,6 @@
 using Microsoft.AspNetCore.Mvc.Rendering;
 using System.Threading.Tasks;
+using Npgsql;
+using PostgreSqlDotnetCore.Data;
 
 namespace PostgreSqlDotnetCore.Controllers
@@ -10,6 +12,14 @@
     public class VetCenterController : BaseController
     {
-        public VetCenterController(UserManager<IdentityUser> userManager) : base(userManager)
-        {
+        /*  
+         public VetCenterController(UserManager<IdentityUser> userManager) : base(userManager)
+           {
+           }
+        */
+        private readonly ApplicationDbContext db;
+
+        public VetCenterController(UserManager<IdentityUser> userManager, ApplicationDbContext context) : base(userManager)
+        {
+            db = context ?? throw new ArgumentNullException(nameof(context)); 
         }
 
@@ -45,14 +55,29 @@
              return View(vetCenters);
          }*/
+        /* public async Task<ActionResult> Index()
+         {
+             var vetCenters = await db.VetCentersObj.ToListAsync();
+             ViewBag.isAuthenticated = User.Identity.IsAuthenticated;
+             // no access for standard user
+             ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
+
+             // Проверете дали корисникот е администратор или менаџер
+             UsersClass customerClass = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin);
+             // ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
+
+             ViewBag.hasAccess = customerClass != null;
+
+             return View(vetCenters);
+         }
+     */
         public async Task<ActionResult> Index()
         {
-            var vetCenters = await db.VetCentersObj.ToListAsync();
+            var vetCenters = await db.VetCentersWithCity.ToListAsync(); 
             ViewBag.isAuthenticated = User.Identity.IsAuthenticated;
             // no access for standard user
             ViewBag.OnlyAdminManager = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin) ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
 
-            // Проверете дали корисникот е администратор или менаџер
+            
             UsersClass customerClass = await checkAuthorizationSpecificRoleAsync(RoleConstants.Admin);
-               // ?? await checkAuthorizationSpecificRoleAsync(RoleConstants.Manager);
 
             ViewBag.hasAccess = customerClass != null;
@@ -62,5 +87,6 @@
 
 
-        public async Task<ActionResult> Details(int? id)
+
+        /*public async Task<ActionResult> Details(int? id)
         {
             if (id == null)
@@ -82,4 +108,44 @@
         }
 
+
+       */
+        public async Task<IActionResult> Details(int? id)
+        {
+            if (id == null)
+            {
+                return RedirectToAction("NotExist", "Error");
+            }
+
+            // Логирајте го ID-то за дебугирање
+            Console.WriteLine($"ID: {id}");
+
+            // Обидете се да најдете запис во view
+            VetCenterWithCity vetClass = await db.VetCentersWithCity
+                                                 .Where(v => v.id == id) 
+                                                 .FirstOrDefaultAsync();
+            if (vetClass == null)
+            {
+                return RedirectToAction("NotExist", "Error");
+            }
+
+            
+            UsersClass customerClass = await getCrrentUser();
+            ViewBag.isAuthenticated = customerClass;
+
+           
+            return View(vetClass);
+        }
+
+
+
+
+
+
+
+
+
+
+
+
         [HttpPost]
         [ValidateAntiForgeryToken]
@@ -99,4 +165,46 @@
             return View(vetClass);
         }
+
+   
+
+         /*public async Task<ActionResult> Create([Bind(include: "id,name,adress,description,workinghours,phonenumber,latitude,longitude,citiesid")] VetCenter vetClass)
+         {
+             // Логирање на параметрите
+             Console.WriteLine($"Parameters: {vetClass.name}, {vetClass.adress}, {vetClass.description}, {vetClass.workinghours}, {vetClass.phonenumber}, {vetClass.latitude}, {vetClass.longitude}, {vetClass.citiesid}");
+
+             if (ModelState.IsValid)
+             {
+                 // Повик на складираната процедура
+                 var parameters = new[]
+                 {
+             new NpgsqlParameter("@name", vetClass.name),
+             new NpgsqlParameter("@adress", vetClass.adress),
+             new NpgsqlParameter("@description", vetClass.description),
+             new NpgsqlParameter("@workinghours", vetClass.workinghours),
+             new NpgsqlParameter("@phonenumber", vetClass.phonenumber),
+             new NpgsqlParameter("@latitude", (decimal)vetClass.latitude),
+             new NpgsqlParameter("@longitude", (decimal)vetClass.longitude),
+             new NpgsqlParameter("@citiesid", vetClass.citiesid)
+         };
+
+                 await db.Database.ExecuteSqlRawAsync("CALL project.AddVetCenter(@name, @adress, @description, @workinghours, @phonenumber, @latitude, @longitude, @citiesid)", parameters);
+
+                 return RedirectToAction("Index");
+             }
+
+             // Ако моделот не е валиден, повторно пополнете ги градовите за паѓачкиот мени
+             var citiess = await db.CitiesObj.ToListAsync();
+             ViewBag.Citiess = new SelectList(citiess, "id", "name", vetClass.citiesid);
+
+             return View(vetClass);
+         }
+
+         
+
+
+        */
+
+
+
 
         public async Task<ActionResult> Edit(int? id)
@@ -149,9 +257,10 @@
         }
 
-        public async Task<ActionResult> Delete(int? id) { 
-             UsersClass customerClass = await checkAuthorizationAsync();
-        
-        ViewBag.isAuthenticated = await getCrrentUser();
-        
+        public async Task<ActionResult> Delete(int? id)
+        {
+            UsersClass customerClass = await checkAuthorizationAsync();
+
+            ViewBag.isAuthenticated = await getCrrentUser();
+
             if (id == null)
             {
Index: PostgreSqlDotnetCore/Data/ApplicationDbContext.cs
===================================================================
--- PostgreSqlDotnetCore/Data/ApplicationDbContext.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Data/ApplicationDbContext.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -50,8 +50,12 @@
             modelBuilder.Entity<Pet_GaleryClass>().Metadata.SetIsTableExcludedFromMigrations(true);
             modelBuilder.Entity<BlogPostAnswers>().Metadata.SetIsTableExcludedFromMigrations(true);
+
+            modelBuilder.Entity<PetDetailsProcedure>().Metadata.SetIsTableExcludedFromMigrations(true);
             //modelBuilder.Entity<PetCareAllData>().Metadata.SetIsTableExcludedFromMigrations(true);
-           
 
-
+            // додадени следните два реда на 28.08
+            // modelBuilder.Entity<VetCenterWithCity>().HasNoKey(); // Дефинирајте дека VIEW-от нема примарен клуч
+            // modelBuilder.Entity<VetCenterWithCity>().ToView("vet_centers_with_city"); // Поставете го името на VIEW-от
+            modelBuilder.Entity<VetCenterWithCity>().HasNoKey().ToView("vet_centers_with_city");
             base.OnModelCreating(modelBuilder);
 
@@ -65,4 +69,8 @@
         public virtual DbSet<UsersClass> CustomerObj { get; set; }
         public virtual DbSet<VetCenter> VetCentersObj { get; set; }
+        
+        // додадено на 28.08
+        public virtual DbSet<VetCenterWithCity> VetCentersWithCity { get; set; }
+
         public virtual DbSet<BlogPostConsultation> BlogPostControllerObj { get; set; }
         public virtual DbSet<RolesClass> RoleControllerObj { get; set; }
@@ -83,4 +91,9 @@
         public virtual DbSet<TherapyClass> theraObj { get; set; }
         public virtual DbSet<Type_Of_PetsClass> typeofObj { get; set; }
+        
+        public virtual DbSet<PetDetailsProcedure> PetDetailsProcedureObj { get; set; }
+
+        //public virtual DbSet<PetDetailsProcedure> AddVetCenter { get; set; }
+
     }
 }
Index: PostgreSqlDotnetCore/Models/BlogPostAnswers.cs
===================================================================
--- PostgreSqlDotnetCore/Models/BlogPostAnswers.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Models/BlogPostAnswers.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -19,4 +19,7 @@
 
         public int usersid { get; set; }
+
+        [NotMapped]
+        public List<BlogPostAnswers> blogPostAnswers{ get; set; }
     }
 }
Index: PostgreSqlDotnetCore/Models/PetDetailsProcedure.cs
===================================================================
--- PostgreSqlDotnetCore/Models/PetDetailsProcedure.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
+++ PostgreSqlDotnetCore/Models/PetDetailsProcedure.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -0,0 +1,16 @@
+﻿namespace PostgreSqlDotnetCore.Models
+{
+    using System.ComponentModel.DataAnnotations;
+
+    public class PetDetailsProcedure
+    {
+        [Key]
+        public int pet_id { get; set; }
+        public string pet_name { get; set; }
+        public string diagnosis_description { get; set; }
+        public string medicine_name { get; set; }
+        public string medicine_description { get; set; }
+        public string therapy_description { get; set; }
+        public DateTime therapy_date { get; set; }
+    }
+}
Index: PostgreSqlDotnetCore/Models/Pet_CaresClass.cs
===================================================================
--- PostgreSqlDotnetCore/Models/Pet_CaresClass.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Models/Pet_CaresClass.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -22,4 +22,10 @@
         public DateTime start_date { get; set; }
 
+        // [ForeignKey("PetsClass")]
+        // [Column("petid")]
+        public int pet_id { get; set; }
+        //public PetsClass PetsClass { get; set; }
+
+
         public void SetDatesToUtc()
         {
Index: PostgreSqlDotnetCore/Models/VetCenter.cs
===================================================================
--- PostgreSqlDotnetCore/Models/VetCenter.cs	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Models/VetCenter.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -9,8 +9,8 @@
 namespace PostgreSqlDotnetCore.Models
 {
-    [Table("vet_centers", Schema = "project")]
+    [Table("vet_centers_with_city", Schema = "project")]
     public class VetCenter
     {
-        [Key]
+       // [Key]
         public int id { get; set; }
 
Index: PostgreSqlDotnetCore/Models/VetCenterWithCity.cs
===================================================================
--- PostgreSqlDotnetCore/Models/VetCenterWithCity.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
+++ PostgreSqlDotnetCore/Models/VetCenterWithCity.cs	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -0,0 +1,17 @@
+﻿// File: Models/VetCenterWithCity.cs
+
+namespace PostgreSqlDotnetCore.Models
+{
+    public class VetCenterWithCity
+    {
+        public int id { get; set; }
+        public string vet_center_name { get; set; }
+        public string adress { get; set; }
+        public string city_name { get; set; } // Додајте име на градот
+        public string description { get; set; }
+        public string workinghours { get; set; }
+        public float latitude { get; set; }
+        public float longitude { get; set; }
+        public string phonenumber { get; set; }
+    }
+}
Index: PostgreSqlDotnetCore/PostgreSqlDotnetCore.csproj
===================================================================
--- PostgreSqlDotnetCore/PostgreSqlDotnetCore.csproj	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/PostgreSqlDotnetCore.csproj	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -70,5 +70,5 @@
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
-    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.11" />
+    <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.12" />
     <PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="7.0.1" />
   </ItemGroup>
Index: PostgreSqlDotnetCore/Views/Blog/Index.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/Blog/Index.cshtml	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Views/Blog/Index.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -57,4 +57,5 @@
 
             @if (item.users_id == ViewBag.CurrentUserId)
+                
             {
                 <td>
@@ -64,5 +65,6 @@
                 </td>
             }
-
+            
+          
 
             @if (item.users_id == ViewBag.CurrentUserId || item.users_id != ViewBag.CurrentUserId)
Index: PostgreSqlDotnetCore/Views/BlogPostAnswers/Details.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/BlogPostAnswers/Details.cshtml	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Views/BlogPostAnswers/Details.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -29,4 +29,36 @@
     </dl>
 </div>
+<br/>
+@{
+    if(Model.blogPostAnswers.Count > 0)
+    {
+
+        <h4>Replay under Answers</h4>
+        <hr />
+        foreach (BlogPostAnswers item in Model.blogPostAnswers)
+        {
+
+            <dl class="dl-horizontal">
+                <dt>
+                    @Html.DisplayNameFor(model => item.parent_id)
+                </dt>
+
+                <dd>
+                    @Html.DisplayFor(model => item.parent_id)
+                </dd>
+
+                <dt>
+                    @Html.DisplayNameFor(model => item.reply)
+                </dt>
+                <dd>
+                    @Html.DisplayFor(model => item.reply)
+                </dd>
+
+
+            </dl>
+        }
+        <hr />
+    }
+}
 <p>
     @Html.ActionLink("Edit", "Edit", new { id = Model.id }) |
Index: PostgreSqlDotnetCore/Views/PetCares/Create.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/PetCares/Create.cshtml	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Views/PetCares/Create.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -74,4 +74,11 @@
         </div>
 
+        <div class="form-group">
+            <label class="control-label col-md-2" for="pet_id">UserPet:</label>
+            <div class="col-md-10">
+                @Html.DropDownList("pet_id", (SelectList)ViewBag.Pets, "Select Pets", new { @class = "form-control" })
+            </div>
+        </div>
+
 
     <div class="form-group">
Index: PostgreSqlDotnetCore/Views/PetDiagnostics/Index.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/PetDiagnostics/Index.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
+++ PostgreSqlDotnetCore/Views/PetDiagnostics/Index.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -0,0 +1,7 @@
+﻿@model IEnumerable<PostgreSqlDotnetCore.Models.PetDetailsProcedure>
+
+@{
+    ViewBag.Title = "PetDetailsProcedure";
+}
+
+<h2>PetDetailsProcedure</h2>
Index: PostgreSqlDotnetCore/Views/PetDiagnostics/PetDiagnostics.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/PetDiagnostics/PetDiagnostics.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
+++ PostgreSqlDotnetCore/Views/PetDiagnostics/PetDiagnostics.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -0,0 +1,71 @@
+﻿@model IEnumerable<PostgreSqlDotnetCore.Models.PetDetailsProcedure>
+
+@{
+    ViewData["Title"] = "PetDiagnostics";
+}
+
+<h2>PetDiagnostics</h2>
+
+<p>
+    <a asp-action="Create">Create New</a>
+</p>
+<table class="table">
+    <thead>
+        <tr>
+            <th>
+                @Html.DisplayNameFor(model => model.pet_id)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.pet_name)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.diagnosis_description)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.medicine_name)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.medicine_description)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.therapy_description)
+            </th>
+            <th>
+                @Html.DisplayNameFor(model => model.therapy_date)
+            </th>
+            <th></th>
+        </tr>
+    </thead>
+    <tbody>
+@foreach (var item in Model) {
+        <tr>
+            <td>
+                @Html.DisplayFor(modelItem => item.pet_id)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.pet_name)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.diagnosis_description)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.medicine_name)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.medicine_description)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.therapy_description)
+            </td>
+            <td>
+                @Html.DisplayFor(modelItem => item.therapy_date)
+            </td>
+            <td>
+                @Html.ActionLink("Edit", "Edit", new { /* id=item.PrimaryKey */ }) |
+                @Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) |
+                @Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ })
+            </td>
+        </tr>
+}
+    </tbody>
+</table>
Index: PostgreSqlDotnetCore/Views/Products/Index.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/Products/Index.cshtml	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Views/Products/Index.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -108,4 +108,5 @@
                                     @Html.ActionLink("Details", "Details", new { id = item.id }) |
                                     @Html.ActionLink("Delete", "Delete", new { id = item.id })
+                                    @Html.ActionLink("Procedure", "Procedure", new { id = item.id })
                                 </div>
                             }
Index: PostgreSqlDotnetCore/Views/VetCenter/Details.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/VetCenter/Details.cshtml	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Views/VetCenter/Details.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -1,3 +1,3 @@
-﻿@model PostgreSqlDotnetCore.Models.VetCenter
+﻿@model PostgreSqlDotnetCore.Models.VetCenterWithCity
 
 @{
@@ -5,73 +5,50 @@
 }
 
-<h2>Details</h2>
+<h2>Details for @Model.vet_center_name</h2>
 
-<div>
-    <h4>VetCenter</h4>
-    <hr />
-    <dl class="dl-horizontal">
-        <dt>
-            @Html.DisplayNameFor(model => model.name)
-        </dt>
+<table class="table">
+    <tr>
+        <th>@Html.DisplayNameFor(model => model.vet_center_name)</th>
+        <td>@Html.DisplayFor(model => model.vet_center_name)</td>
+    </tr>
+    <tr>
+        <th>@Html.DisplayNameFor(model => model.adress)</th>
+        <td>@Html.DisplayFor(model => model.adress)</td>
+    </tr>
+    <tr>
+        <th>@Html.DisplayNameFor(model => model.workinghours)</th>
+        <td>@Html.DisplayFor(model => model.workinghours)</td>
+    </tr>
+    <tr>
+        <th>@Html.DisplayNameFor(model => model.description)</th>
+        <td>@Html.DisplayFor(model => model.description)</td>
+    </tr>
+    <tr>
+        <th>@Html.DisplayNameFor(model => model.phonenumber)</th>
+        <td>@Html.DisplayFor(model => model.phonenumber)</td>
+    </tr>
+    <tr>
+        <th>@Html.DisplayNameFor(model => model.latitude)</th>
+        <td>@Html.DisplayFor(model => model.latitude)</td>
+    </tr>
+    <tr>
+        <th>@Html.DisplayNameFor(model => model.longitude)</th>
+        <td>@Html.DisplayFor(model => model.longitude)</td>
+    </tr>
+    <tr>
+        <th>@Html.DisplayNameFor(model => model.city_name)</th>
+        <td>@Html.DisplayFor(model => model.city_name)</td>
+    </tr>
+</table>
 
-        <dd>
-            @Html.DisplayFor(model => model.name)
-        </dd>
+@if (ViewBag.hasAccess != null && ViewBag.hasAccess == true)
+{
+    <p>
+        @Html.ActionLink("Edit", "Edit", new { id = Model.id }) |
+        @Html.ActionLink("Delete", "Delete", new { id = Model.id })
+    </p>
+}
 
-        <dt>
-            @Html.DisplayNameFor(model => model.adress)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.adress)
-        </dd>
-        <dt>
-            @Html.DisplayNameFor(model => model.description)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.description)
-        </dd>
-        <dt>
-            @Html.DisplayNameFor(model => model.workinghours)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.workinghours)
-        </dd>
-        <dt>
-            @Html.DisplayNameFor(model => model.phonenumber)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.phonenumber)
-        </dd>
-        <dt>
-            @Html.DisplayNameFor(model => model.latitude)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.latitude)
-        </dd>
-        <dt>
-            @Html.DisplayNameFor(model => model.longitude)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.longitude)
-        </dd>
-        <dt>
-            @Html.DisplayNameFor(model => model.citiesid)
-        </dt>
-
-        <dd>
-            @Html.DisplayFor(model => model.citiesid)
-        </dd>
-
-
-    </dl>
-</div>
 <p>
-    @Html.ActionLink("Edit", "Edit", new { id = Model.id }) |
     @Html.ActionLink("Back to List", "Index")
 </p>
Index: PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml
===================================================================
--- PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml	(revision 118e414d91bed6d2f18476304a58e95728403f8c)
+++ PostgreSqlDotnetCore/Views/VetCenter/Index.cshtml	(revision e9bb9d13e39b1e74f76562e3471e4189febd2a22)
@@ -1,5 +1,7 @@
 ﻿@using Microsoft.AspNetCore.Identity
 @inject SignInManager<IdentityUser> SignInManager
-@model IEnumerable<PostgreSqlDotnetCore.Models.VetCenter>
+@* IEnumerable<PostgreSqlDotnetCore.Models.VetCenter>*@
+@model IEnumerable<PostgreSqlDotnetCore.Models.VetCenterWithCity>
+
 
 @{
@@ -23,5 +25,5 @@
     <tr>
         <th>
-            @Html.DisplayNameFor(model => model.name)
+            @Html.DisplayNameFor(model => model.vet_center_name)
         </th>
         <th>
@@ -45,5 +47,5 @@
         </th>
         <th>
-            @Html.DisplayNameFor(model => model.citiesid)
+            @Html.DisplayNameFor(model => model.city_name)
         </th>
         <th></th>
@@ -54,5 +56,5 @@
         <tr>
             <td>
-                @Html.DisplayFor(modelItem => item.name)
+                @Html.DisplayFor(modelItem => item.vet_center_name)
             </td>
             <td>
@@ -76,5 +78,5 @@
             </td>
             <td>
-                @Html.DisplayFor(modelItem => item.citiesid)
+                @Html.DisplayFor(modelItem => item.city_name)
             </td>
             <td>
@@ -85,17 +87,17 @@
             </td>
 
-            
 
-         @*   @if ((SignInManager.IsSignedIn(User)))
-            {
-                <td>
 
-                    @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
-                    @Html.ActionLink("Details", "Details", new { id = item.id }) |
-                    @Html.ActionLink("Delete", "Delete", new { id = item.id })
+            @*   @if ((SignInManager.IsSignedIn(User)))
+        {
+        <td>
 
-                </td>
-            }
-           *@
+        @Html.ActionLink("Edit", "Edit", new { id = item.id }) |
+        @Html.ActionLink("Details", "Details", new { id = item.id }) |
+        @Html.ActionLink("Delete", "Delete", new { id = item.id })
+
+        </td>
+        }
+        *@
 
             @* Додадете условие за проверка на улогите *@
