Index: PostgreSqlDotnetCore/Controllers/BlogController.cs
===================================================================
--- PostgreSqlDotnetCore/Controllers/BlogController.cs	(revision 57fc40271dfe03c973365d9799d1dbf2d4360b8f)
+++ PostgreSqlDotnetCore/Controllers/BlogController.cs	(revision 72b1da27c6dadc5f1ae45e91e7c4f60289917575)
@@ -30,22 +30,51 @@
         */
 
-        public async Task<ActionResult> Index()
-        {
-            // Проверка за автентикација
-            bool isAuthenticated = User.Identity.IsAuthenticated;
-
-            if (!isAuthenticated)
-            {
-                return RedirectToAction("AccessDenied", "Error");
-            }
-
-            // Список на блог постови
-            var blogPosts = await db.BlogPostControllerObj.ToListAsync();
-
-            // Предавање на ViewBag за проверка на автентикација
-            ViewBag.isAuthenticated = isAuthenticated;
-
-            return View(blogPosts);
-        }
+        /* public async Task<ActionResult> Index()
+         {
+             // Проверка за автентикација
+             bool isAuthenticated = User.Identity.IsAuthenticated;
+
+             if (!isAuthenticated)
+             {
+                 return RedirectToAction("AccessDenied", "Error");
+             }
+
+             // Список на блог постови
+             var blogPosts = await db.BlogPostControllerObj.ToListAsync();
+
+             // Предавање на ViewBag за проверка на автентикација
+             ViewBag.isAuthenticated = isAuthenticated;
+
+             return View(blogPosts);
+         }*/
+
+          public async Task<ActionResult> Index()
+          {
+              // Проверка за автентикација
+              bool isAuthenticated = User.Identity.IsAuthenticated;
+
+              if (!isAuthenticated)
+              {
+                  return RedirectToAction("AccessDenied", "Error");
+              }
+
+              // Список на блог постови
+              var blogPosts = await db.BlogPostControllerObj.ToListAsync();
+
+              // Вземи тековниот корисник
+              var currentUser = await _userManager.GetUserAsync(User);
+              var customerClass = await db.CustomerObj.SingleOrDefaultAsync(x => x.email == currentUser.Email);
+
+              // Предавање на ViewBag за проверка на автентикација и корисничкиот ID
+              ViewBag.isAuthenticated = isAuthenticated;
+              ViewBag.CurrentUserId = customerClass?.id;
+
+              return View(blogPosts);
+          }
+        
+
+        
+
+
         // GET: Customer/Details/5
         public async Task<ActionResult> DetailsAsync(int? id)
@@ -100,36 +129,37 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-         public async Task<ActionResult> CreateAsync([Bind(include: "id,date_askes,title,description,users_id")] BlogPostConsultation blogClass)
-         {
-             if (ModelState.IsValid)
-             {
-                 bool isAuthenticated = User.Identity.IsAuthenticated;
-                 if (isAuthenticated)
-                 {
-                     var user = await _userManager.GetUserAsync(User);
-                     var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
-                     if (customerClass != null)
-                     {
-                         // Поставете users_id на идентификаторот на корисникот
-                         blogClass.users_id = customerClass.id;
+        public async Task<ActionResult> CreateAsync([Bind(include: "id,date_askes,title,description,users_id")] BlogPostConsultation blogClass)
+        {
+            if (ModelState.IsValid)
+            {
+                bool isAuthenticated = User.Identity.IsAuthenticated;
+                if (isAuthenticated)
+                {
+                    var user = await _userManager.GetUserAsync(User);
+                    var customerClass = db.CustomerObj.SingleOrDefault(x => x.email == user.Email);
+                    if (customerClass != null)
+                    {
+                        // Поставете users_id на идентификаторот на корисникот
+                        blogClass.users_id = customerClass.id;
                         //blogClass.date_askes = DateOnly.FromDateTime(DateTime.UtcNow); 
                         blogClass.date_askes = DateOnly.FromDateTime(DateTime.Now); // Ова ќе стави локално време
 
                         db.BlogPostControllerObj.Add(blogClass);
-                         await db.SaveChangesAsync();
-                         return RedirectToAction("Index");
-                     }
-                 }
-                 else
-                 {
-                     return RedirectToAction("AccessDenied", "Error");
-                 }
-             }
-
-             return View(blogClass);
-         }
-
-       
-       
+                        await db.SaveChangesAsync();
+                        return RedirectToAction("Index");
+                    }
+                }
+                else
+                {
+                    return RedirectToAction("AccessDenied", "Error");
+                }
+            }
+
+            return View(blogClass);
+        }
+
+
+
+
 
 
@@ -151,4 +181,6 @@
             // check for permission
             UsersClass customerClass = await checkAuthorizationAsync();
+            //dodadeno na 23.08
+            ViewBag.isAuthenticated = await getCrrentUser();
             if (customerClass == null)
             {
@@ -174,18 +206,42 @@
         [HttpPost]
         [ValidateAntiForgeryToken]
-        public ActionResult Edit([Bind(include: "id,date_askes,title,description,users_id")] BlogPostConsultation blogClass)
+        /* public ActionResult Edit([Bind(include: "id,date_askes,title,description,users_id")] BlogPostConsultation blogClass)
+         {
+             if (ModelState.IsValid)
+             {
+                 db.Entry(blogClass).State = EntityState.Modified;
+                 db.SaveChanges();
+                 return RedirectToAction("Index");
+             }
+             return View(blogClass);
+         }*/
+
+        
+        public async Task<ActionResult> EditAsync(int id, [Bind(include: "id,date_askes,title,description")] BlogPostConsultation blogClass)
         {
             if (ModelState.IsValid)
             {
-                db.Entry(blogClass).State = EntityState.Modified;
-                db.SaveChanges();
-                return RedirectToAction("Index");
-            }
-            return View(blogClass);
-        }
+                var existingBlogClass = await db.BlogPostControllerObj.FindAsync(id);
+                if (existingBlogClass != null)
+                {
+                    // Запамтете ја старата вредност на users_id
+                    blogClass.users_id = existingBlogClass.users_id;
+
+                    db.Entry(existingBlogClass).CurrentValues.SetValues(blogClass);
+                    await db.SaveChangesAsync();
+                    return RedirectToAction("Index");
+                }
+            }
+            return View(blogClass);
+        }
+
+
 
         // GET: Customer/Delete/5
-        public async Task<ActionResult> DeleteAsync(int? id)
-        { 
+        public async Task<ActionResult> DeleteAsync(int? id) { 
+          //  UsersClass customerClass = await checkAuthorizationAsync();
+
+        ViewBag.isAuthenticated = await getCrrentUser();
+        
             if (id == null)
            {
