public async Task <IActionResult> Edit(int id, [Bind("CategoryItemPatternId,StorageId,NotificationId,Name,Type,CurrentQuantity,ExpectedQuantity,ShopingFrequency")] Categoryitempattern categoryitempattern) { if (id != categoryitempattern.CategoryItemPatternId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(categoryitempattern); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoryitempatternExists(categoryitempattern.CategoryItemPatternId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["NotificationId"] = new SelectList(_context.Notificationtype, "NotificationId", "Type", categoryitempattern.NotificationId); ViewData["StorageId"] = new SelectList(_context.Storage, "StorageId", "Name", categoryitempattern.StorageId); return(View(categoryitempattern)); }
public async Task <IActionResult> Create([Bind("CategoryItemPatternId,StorageId,NotificationId,Name,Type,CurrentQuantity,ExpectedQuantity,ShopingFrequency")] Categoryitempattern categoryitempattern) { if (ModelState.IsValid) { _context.Add(categoryitempattern); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["NotificationId"] = new SelectList(_context.Notificationtype, "NotificationId", "Type", categoryitempattern.NotificationId); ViewData["StorageId"] = new SelectList(_context.Storage, "StorageId", "Name", categoryitempattern.StorageId); return(View(categoryitempattern)); }
#pragma warning disable 1998 public async override global::System.Threading.Tasks.Task ExecuteAsync() { BeginContext(42, 2, true); WriteLiteral("\r\n"); EndContext(); #line 3 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" ViewData["Title"] = "Index"; #line default #line hidden BeginContext(85, 29, true); WriteLiteral("\r\n<h1>Index</h1>\r\n\r\n<p>\r\n "); EndContext(); BeginContext(114, 111, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "44a0cfaf7229be62fdc13df57997ff6b3ec7ddac4557", async() => { BeginContext(137, 84, true); WriteLiteral("<button type=\"button\" class=\"btn btn-secondary btn-info\">Dodaj nowy produkt</button>"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_0.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(225, 1350, true); WriteLiteral(@" </p> <div class=""limiter""> <div class=""table100 ver5 m-b-110""> <table data-vertable=""ver5"" width: 100%> <thead> <tr class=""row100 head""> <th class=""column100 column2"" data-column=""column2""> BarCode </th> <th class=""column100 column2"" data-column=""column2""> Measure Unit </th> <th class=""column100 column3"" data-column=""column3""> How much left </th> <th class=""column100 column4"" data-column=""column4""> Name </th> <th class=""column100 column5"" data-column=""column5""> CategoryItemPattern </th> <th class=""column100 column6"" data-column=""column6""> Photo </th> "); WriteLiteral(@" <th class=""column100 column7"" data-column=""column7""> Expiration date </th > <th class=""column100 column8"" data-column=""column8""> Actions </th> </tr> </thead> <tbody> "); EndContext(); #line 44 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" foreach (var item in Model) { fridgepzContext _context = new fridgepzContext(); Itempattern pat = await _context.Itempattern.FindAsync(item.ItemPatternId); Categoryitempattern cat = await _context.Categoryitempattern.FindAsync(pat.CategoryItemPatternId); DateTime date = item.ExpirationDate ?? DateTime.Now; String only_date = date.ToString("dd/MM/yyyy"); #line default #line hidden BeginContext(2073, 132, true); WriteLiteral(" <tr>\r\n <td class=\"column100 column2\" data-column=\"column2\">\r\n "); EndContext(); BeginContext(2206, 11, false); #line 54 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" Write(pat.BarCode); #line default #line hidden EndContext(); BeginContext(2217, 139, true); WriteLiteral("\r\n </td>\r\n <td class=\"column100 column2\" data-column=\"column2\">\r\n "); EndContext(); BeginContext(2357, 8, false); #line 57 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" Write(pat.Unit); #line default #line hidden EndContext(); BeginContext(2365, 139, true); WriteLiteral("\r\n </td>\r\n <td class=\"column100 column3\" data-column=\"column3\">\r\n "); EndContext(); BeginContext(2505, 16, false); #line 60 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" Write(item.HowMuchLeft); #line default #line hidden EndContext(); BeginContext(2521, 139, true); WriteLiteral("\r\n </td>\r\n <td class=\"column100 column4\" data-column=\"column4\">\r\n "); EndContext(); BeginContext(2661, 8, false); #line 63 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" Write(pat.Name); #line default #line hidden EndContext(); BeginContext(2669, 139, true); WriteLiteral("\r\n </td>\r\n <td class=\"column100 column5\" data-column=\"column5\">\r\n "); EndContext(); BeginContext(2809, 8, false); #line 66 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" Write(cat.Name); #line default #line hidden EndContext(); BeginContext(2817, 143, true); WriteLiteral("\r\n </td>\r\n <td class=\"column100 column6\" data-column=\"column6\">\r\n <img"); EndContext(); BeginWriteAttribute("src", " src=\"", 2960, "\"", 2988, 2); WriteAttributeValue("", 2966, "/images/", 2966, 8, true); #line 69 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" WriteAttributeValue("", 2974, pat.PhotoName, 2974, 14, false); #line default #line hidden EndWriteAttribute(); BeginContext(2989, 153, true); WriteLiteral(" width=\"60\" />\r\n </td>\r\n <td class=\"column100 column7\" data-column=\"column7\">\r\n "); EndContext(); BeginContext(3143, 9, false); #line 72 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" Write(only_date); #line default #line hidden EndContext(); BeginContext(3152, 236, true); WriteLiteral("\r\n </td>\r\n <td class=\"column100 column8\" data-column=\"column8\">\r\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">\r\n "); EndContext(); BeginContext(3388, 126, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "44a0cfaf7229be62fdc13df57997ff6b3ec7ddac12273", async() => { BeginContext(3441, 69, true); WriteLiteral("<button type=\"button\" class=\"btn btn-secondary btn-danger\">-</button>"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_1.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1); if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null) { throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues")); } BeginWriteTagHelperAttribute(); #line 76 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" WriteLiteral(item.ItemId); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3514, 151, true); WriteLiteral("\r\n </div>\r\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic example\">\r\n "); EndContext(); BeginContext(3665, 127, false); __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "44a0cfaf7229be62fdc13df57997ff6b3ec7ddac14895", async() => { BeginContext(3716, 72, true); WriteLiteral("<button type=\"button\" class=\"btn btn-secondary btn-danger\">Usuń</button>"); EndContext(); } ); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>(); __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_2.Value; __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2); if (__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues == null) { throw new InvalidOperationException(InvalidTagHelperIndexerAssignment("asp-route-id", "Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper", "RouteValues")); } BeginWriteTagHelperAttribute(); #line 79 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" WriteLiteral(item.ItemId); #line default #line hidden __tagHelperStringValueBuffer = EndWriteTagHelperAttribute(); __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"] = __tagHelperStringValueBuffer; __tagHelperExecutionContext.AddTagHelperAttribute("asp-route-id", __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.RouteValues["id"], global::Microsoft.AspNetCore.Razor.TagHelpers.HtmlAttributeValueStyle.DoubleQuotes); await __tagHelperRunner.RunAsync(__tagHelperExecutionContext); if (!__tagHelperExecutionContext.Output.IsContentModified) { await __tagHelperExecutionContext.SetOutputContentAsync(); } Write(__tagHelperExecutionContext.Output); __tagHelperExecutionContext = __tagHelperScopeManager.End(); EndContext(); BeginContext(3792, 98, true); WriteLiteral("\r\n </div>\r\n </td>\r\n\r\n </tr>\r\n"); EndContext(); #line 84 "C:\Users\Lenovo\Documents\FridgeWspolne\fridge-master\Fridge_PZ(najnowsza)\Fridge_PZ\FridgePZ\Views\Items\Index.cshtml" } #line default #line hidden BeginContext(3909, 743, true); WriteLiteral(@" </tbody> </table> </div> </div> <!--===============================================================================================--> <script src=""vendor/jquery/jquery-3.2.1.min.js""></script> <!--===============================================================================================--> <script src=""vendor/bootstrap/js/popper.js""></script> <script src=""vendor/bootstrap/js/bootstrap.min.js""></script> <!--===============================================================================================--> <script src=""vendor/select2/select2.min.js""></script> <!--===============================================================================================--> <script src=""js/main.js""></script>"); EndContext(); }