| 1 | @{
|
|---|
| 2 |
|
|---|
| 3 | var userRole = Context.Session.GetString("Role");
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 | bool isAdmin = userRole == "Admin";
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 | bool canManageInventory = isAdmin || userRole == "Inventory Manager";
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 | bool canSell = isAdmin || userRole == "Sales Personnel";
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | bool canManageWarehouse = isAdmin || canSell|| userRole == "Warehouse Staff";
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 | bool canAccessSettings = isAdmin || canManageInventory || canSell;
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | <!DOCTYPE html>
|
|---|
| 22 | <html lang="en">
|
|---|
| 23 | <head>
|
|---|
| 24 | <meta charset="utf-8" />
|
|---|
| 25 | <meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|---|
| 26 | <title>@ViewData["Title"] - Stock Master</title>
|
|---|
| 27 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css" />
|
|---|
| 28 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
|
|---|
| 29 | <style>
|
|---|
| 30 | :root {
|
|---|
| 31 | --primary-color: #2563eb;
|
|---|
| 32 | --secondary-color: #475569;
|
|---|
| 33 | --success-color: #10b981;
|
|---|
| 34 | --danger-color: #ef4444;
|
|---|
| 35 | --warning-color: #f59e0b;
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | body {
|
|---|
| 39 | font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|---|
| 40 | background-color: #f8fafc;
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 | .nav-link.disabled, .dropdown-item.disabled {
|
|---|
| 45 | color: rgba(255, 255, 255, 0.4) !important;
|
|---|
| 46 | pointer-events: none;
|
|---|
| 47 | cursor: default;
|
|---|
| 48 | }
|
|---|
| 49 |
|
|---|
| 50 | .dropdown-item.disabled {
|
|---|
| 51 | color: #adb5bd !important;
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 | .navbar {
|
|---|
| 55 | background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
|
|---|
| 56 | box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 | .navbar-brand {
|
|---|
| 60 | font-weight: 700;
|
|---|
| 61 | font-size: 1.5rem;
|
|---|
| 62 | color: white !important;
|
|---|
| 63 | }
|
|---|
| 64 |
|
|---|
| 65 | .nav-link {
|
|---|
| 66 | color: rgba(255,255,255,0.9) !important;
|
|---|
| 67 | transition: all 0.3s;
|
|---|
| 68 | font-weight: 500;
|
|---|
| 69 | }
|
|---|
| 70 |
|
|---|
| 71 | .nav-link:not(.disabled):hover {
|
|---|
| 72 | color: white !important;
|
|---|
| 73 | transform: translateY(-2px);
|
|---|
| 74 | }
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 | .card {
|
|---|
| 78 | border: none;
|
|---|
| 79 | border-radius: 12px;
|
|---|
| 80 | box-shadow: 0 4px 6px rgba(0,0,0,0.07);
|
|---|
| 81 | transition: all 0.3s;
|
|---|
| 82 | margin-bottom: 20px;
|
|---|
| 83 | }
|
|---|
| 84 |
|
|---|
| 85 | .card:hover {
|
|---|
| 86 | box-shadow: 0 8px 15px rgba(0,0,0,0.1);
|
|---|
| 87 | transform: translateY(-2px);
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|
| 90 | .card-header {
|
|---|
| 91 | background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
|
|---|
| 92 | color: white;
|
|---|
| 93 | font-weight: 600;
|
|---|
| 94 | border-radius: 12px 12px 0 0 !important;
|
|---|
| 95 | padding: 1rem 1.5rem;
|
|---|
| 96 | }
|
|---|
| 97 |
|
|---|
| 98 | .btn-primary {
|
|---|
| 99 | background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
|
|---|
| 100 | border: none;
|
|---|
| 101 | padding: 0.5rem 1.5rem;
|
|---|
| 102 | font-weight: 500;
|
|---|
| 103 | transition: all 0.3s;
|
|---|
| 104 | }
|
|---|
| 105 |
|
|---|
| 106 | .btn-primary:hover {
|
|---|
| 107 | transform: translateY(-2px);
|
|---|
| 108 | box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
|
|---|
| 109 | }
|
|---|
| 110 |
|
|---|
| 111 | .table {
|
|---|
| 112 | background: white;
|
|---|
| 113 | border-radius: 8px;
|
|---|
| 114 | overflow: hidden;
|
|---|
| 115 | }
|
|---|
| 116 |
|
|---|
| 117 | .table thead {
|
|---|
| 118 | background-color: #f1f5f9;
|
|---|
| 119 | }
|
|---|
| 120 |
|
|---|
| 121 | .stat-card {
|
|---|
| 122 | background: white;
|
|---|
| 123 | border-radius: 12px;
|
|---|
| 124 | padding: 1.5rem;
|
|---|
| 125 | box-shadow: 0 4px 6px rgba(0,0,0,0.07);
|
|---|
| 126 | height: 100%;
|
|---|
| 127 | }
|
|---|
| 128 |
|
|---|
| 129 | .stat-icon {
|
|---|
| 130 | width: 50px;
|
|---|
| 131 | height: 50px;
|
|---|
| 132 | border-radius: 10px;
|
|---|
| 133 | display: flex;
|
|---|
| 134 | align-items: center;
|
|---|
| 135 | justify-content: center;
|
|---|
| 136 | font-size: 1.5rem;
|
|---|
| 137 | color: white;
|
|---|
| 138 | }
|
|---|
| 139 |
|
|---|
| 140 | .alert {
|
|---|
| 141 | border-radius: 8px;
|
|---|
| 142 | border: none;
|
|---|
| 143 | }
|
|---|
| 144 | </style>
|
|---|
| 145 | @await RenderSectionAsync("Styles", required: false)
|
|---|
| 146 | </head>
|
|---|
| 147 | <body>
|
|---|
| 148 | <nav class="navbar navbar-expand-lg navbar-dark">
|
|---|
| 149 | <div class="container-fluid">
|
|---|
| 150 | <a class="navbar-brand" href="/">
|
|---|
| 151 | <i class="fas fa-boxes"></i> Stock Master
|
|---|
| 152 | </a>
|
|---|
| 153 | <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
|---|
| 154 | <span class="navbar-toggler-icon"></span>
|
|---|
| 155 | </button>
|
|---|
| 156 | <div class="collapse navbar-collapse" id="navbarNav">
|
|---|
| 157 | <ul class="navbar-nav me-auto">
|
|---|
| 158 | <li class="nav-item">
|
|---|
| 159 | <a class="nav-link" href="/Home/Index">
|
|---|
| 160 | <i class="fas fa-home"></i> Dashboard
|
|---|
| 161 | </a>
|
|---|
| 162 | </li>
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 | <li class="nav-item">
|
|---|
| 166 | <a class="nav-link @(canManageInventory ? "" : "disabled")" href="/Product/Index">
|
|---|
| 167 | <i class="fas fa-box"></i> Products
|
|---|
| 168 | </a>
|
|---|
| 169 | </li>
|
|---|
| 170 | <li class="nav-item">
|
|---|
| 171 | <a class="nav-link @(canManageInventory ? "" : "disabled")" href="/Report/Index">
|
|---|
| 172 | <i class="fas fa-chart-pie"></i> Reports
|
|---|
| 173 | </a>
|
|---|
| 174 | </li>
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 | <li class="nav-item">
|
|---|
| 178 | <a class="nav-link @(canSell ? "" : "disabled")" href="/Sale/Index">
|
|---|
| 179 | <i class="fas fa-shopping-cart"></i> Sales
|
|---|
| 180 | </a>
|
|---|
| 181 | </li>
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 | <li class="nav-item">
|
|---|
| 185 | <a class="nav-link @(canManageInventory ? "" : "disabled")" href="/PurchaseOrder/Index">
|
|---|
| 186 | <i class="fas fa-truck"></i> Purchase Orders
|
|---|
| 187 | </a>
|
|---|
| 188 | </li>
|
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 | <li class="nav-item">
|
|---|
| 192 | <a class="nav-link @(canManageWarehouse ? "" : "disabled")" href="/Warehouse/Index">
|
|---|
| 193 | <i class="fas fa-warehouse"></i> Warehouses
|
|---|
| 194 | </a>
|
|---|
| 195 | </li>
|
|---|
| 196 |
|
|---|
| 197 |
|
|---|
| 198 | <li class="nav-item dropdown">
|
|---|
| 199 | <a class="nav-link dropdown-toggle @(canAccessSettings ? "" : "disabled")" href="#" role="button" data-bs-toggle="dropdown">
|
|---|
| 200 | <i class="fas fa-cog"></i> Settings
|
|---|
| 201 | </a>
|
|---|
| 202 | <ul class="dropdown-menu">
|
|---|
| 203 |
|
|---|
| 204 | <li>
|
|---|
| 205 | <a class="dropdown-item @(canManageInventory ? "" : "disabled")" href="/Category/Index">
|
|---|
| 206 | <i class="fas fa-tag"></i> Categories
|
|---|
| 207 | </a>
|
|---|
| 208 | </li>
|
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 | <li>
|
|---|
| 212 | <a class="dropdown-item @(canSell ? "" : "disabled")" href="/Customer/Index">
|
|---|
| 213 | <i class="fas fa-users"></i> Customers
|
|---|
| 214 | </a>
|
|---|
| 215 | </li>
|
|---|
| 216 |
|
|---|
| 217 |
|
|---|
| 218 | <li>
|
|---|
| 219 | <a class="dropdown-item @(canManageInventory ? "" : "disabled")" href="/Supplier/Index">
|
|---|
| 220 | <i class="fas fa-truck"></i> Suppliers
|
|---|
| 221 | </a>
|
|---|
| 222 | </li>
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 | <li>
|
|---|
| 226 | <a class="dropdown-item @(isAdmin ? "" : "disabled")" href="/User/Index">
|
|---|
| 227 | <i class="fas fa-user-cog"></i> Users
|
|---|
| 228 | </a>
|
|---|
| 229 | </li>
|
|---|
| 230 | </ul>
|
|---|
| 231 | </li>
|
|---|
| 232 | </ul>
|
|---|
| 233 | <ul class="navbar-nav">
|
|---|
| 234 | <li class="nav-item dropdown">
|
|---|
| 235 | <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
|
|---|
| 236 | <i class="fas fa-user"></i> @Context.Session.GetString("FullName") (@userRole)
|
|---|
| 237 | </a>
|
|---|
| 238 | <ul class="dropdown-menu">
|
|---|
| 239 | <li>
|
|---|
| 240 | <a class="dropdown-item" href="/Account/Logout">
|
|---|
| 241 | <i class="fas fa-sign-out-alt"></i> Logout
|
|---|
| 242 | </a>
|
|---|
| 243 | </li>
|
|---|
| 244 | </ul>
|
|---|
| 245 | </li>
|
|---|
| 246 | </ul>
|
|---|
| 247 | </div>
|
|---|
| 248 | </div>
|
|---|
| 249 | </nav>
|
|---|
| 250 |
|
|---|
| 251 | <div class="container-fluid mt-4">
|
|---|
| 252 | @if (TempData["Success"] != null)
|
|---|
| 253 | {
|
|---|
| 254 | <div class="alert alert-success alert-dismissible fade show">
|
|---|
| 255 | <i class="fas fa-check-circle"></i> @TempData["Success"]
|
|---|
| 256 | <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|---|
| 257 | </div>
|
|---|
| 258 | }
|
|---|
| 259 | @if (TempData["Error"] != null)
|
|---|
| 260 | {
|
|---|
| 261 | <div class="alert alert-danger alert-dismissible fade show">
|
|---|
| 262 | <i class="fas fa-exclamation-circle"></i> @TempData["Error"]
|
|---|
| 263 | <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
|
|---|
| 264 | </div>
|
|---|
| 265 | }
|
|---|
| 266 |
|
|---|
| 267 | @RenderBody()
|
|---|
| 268 | </div>
|
|---|
| 269 |
|
|---|
| 270 | <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js"></script>
|
|---|
| 271 | <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script>
|
|---|
| 272 | @await RenderSectionAsync("Scripts", required: false)
|
|---|
| 273 | </body>
|
|---|
| 274 | </html> |
|---|