source: StockMaster/Views/Product/Edit.cshtml@ dfe03b8

main
Last change on this file since dfe03b8 was dfe03b8, checked in by Ceyda <ceyda.huseini@…>, 3 days ago

Initialize StockMaster project

  • Property mode set to 100644
File size: 6.5 KB
RevLine 
[dfe03b8]1@model StockMaster.Models.Product
2@{
3 ViewData["Title"] = "Edit Product";
4}
5
6<div class="row mb-4">
7 <div class="col-12">
8 <h2><i class="fas fa-edit"></i> Edit Product</h2>
9 <nav aria-label="breadcrumb">
10 <ol class="breadcrumb">
11 <li class="breadcrumb-item"><a href="/">Home</a></li>
12 <li class="breadcrumb-item"><a href="/Product/Index">Products</a></li>
13 <li class="breadcrumb-item active">Edit</li>
14 </ol>
15 </nav>
16 </div>
17</div>
18
19<div class="row">
20 <div class="col-md-8">
21 <div class="card">
22 <div class="card-header">
23 <i class="fas fa-info-circle"></i> Product Information
24 </div>
25 <div class="card-body">
26 <form asp-action="Edit" method="post">
27 @Html.AntiForgeryToken()
28 <input type="hidden" asp-for="ProductId" />
29 <input type="hidden" asp-for="CreatedAt" />
30
31 <div class="row">
32 <div class="col-md-6 mb-3">
33 <label asp-for="Name" class="form-label">Product Name *</label>
34 <input asp-for="Name" class="form-control" placeholder="Enter product name" required />
35 <span asp-validation-for="Name" class="text-danger"></span>
36 </div>
37
38 <div class="col-md-6 mb-3">
39 <label asp-for="Sku" class="form-label">SKU *</label>
40 <input asp-for="Sku" class="form-control" placeholder="Stock keeping unit" required />
41 <span asp-validation-for="Sku" class="text-danger"></span>
42 </div>
43 </div>
44
45 <div class="mb-3">
46 <label asp-for="Description" class="form-label">Description</label>
47 <textarea asp-for="Description" class="form-control" rows="3" placeholder="Product description"></textarea>
48 </div>
49
50 <div class="row">
51 <div class="col-md-6 mb-3">
52 <label asp-for="CategoryId" class="form-label">Category</label>
53 <select asp-for="CategoryId" class="form-select">
54 <option value="">Select category</option>
55 @foreach (var cat in ViewBag.Categories)
56 {
57 <option value="@cat.CategoryId">@cat.Name</option>
58 }
59 </select>
60 </div>
61
62 <div class="col-md-6 mb-3">
63 <label asp-for="SupplierId" class="form-label">Supplier</label>
64 <select asp-for="SupplierId" class="form-select">
65 <option value="">Select supplier</option>
66 @foreach (var sup in ViewBag.Suppliers)
67 {
68 <option value="@sup.SupplierId">@sup.Name</option>
69 }
70 </select>
71 </div>
72 </div>
73
74 <div class="row">
75 <div class="col-md-6 mb-3">
76 <label asp-for="UnitPrice" class="form-label">Unit Price (MKD) *</label>
77 <div class="input-group">
78 <input asp-for="UnitPrice" class="form-control" type="number" step="0.01" min="0" required />
79 <span class="input-group-text">MKD</span>
80 </div>
81 <span asp-validation-for="UnitPrice" class="text-danger"></span>
82 </div>
83
84 <div class="col-md-6 mb-3">
85 <label asp-for="ReorderLevel" class="form-label">Reorder Level *</label>
86 <input asp-for="ReorderLevel" class="form-control" type="number" min="0" required />
87 <small class="text-muted">Alert when stock falls below this level</small>
88 </div>
89 </div>
90
91 <div class="form-check mb-3">
92 <input asp-for="IsActive" class="form-check-input" type="checkbox" />
93 <label asp-for="IsActive" class="form-check-label">
94 Active
95 </label>
96 </div>
97
98 <div class="d-grid gap-2 d-md-flex justify-content-md-end">
99 <a href="/Product/Index" class="btn btn-secondary">
100 <i class="fas fa-times"></i> Cancel
101 </a>
102 <button type="submit" class="btn btn-primary">
103 <i class="fas fa-save"></i> Update
104 </button>
105 </div>
106 </form>
107 </div>
108 </div>
109 </div>
110
111 <div class="col-md-4">
112 <div class="card">
113 <div class="card-header">
114 <i class="fas fa-info-circle"></i> Product Details
115 </div>
116 <div class="card-body">
117 <ul class="list-unstyled">
118 <li class="mb-2">
119 <strong>Product ID:</strong> #@Model.ProductId
120 </li>
121 <li class="mb-2">
122 <strong>Created:</strong> @Model.CreatedAt.ToString("dd.MM.yyyy HH:mm")
123 </li>
124 <li>
125 <strong>Status:</strong>
126 @if (Model.IsActive)
127 {
128 <span class="badge bg-success">Active</span>
129 }
130 else
131 {
132 <span class="badge bg-secondary">Inactive</span>
133 }
134 </li>
135 </ul>
136 </div>
137 </div>
138
139 <div class="card mt-3">
140 <div class="card-header">
141 <i class="fas fa-exclamation-triangle"></i> Warning
142 </div>
143 <div class="card-body">
144 <p class="mb-0 text-muted small">
145 <i class="fas fa-info-circle"></i>
146 Be careful when changing SKU. It must be unique.
147 </p>
148 </div>
149 </div>
150 </div>
151</div>
Note: See TracBrowser for help on using the repository browser.