Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("PkMillKey,MillId,FkMillTypeId,Company,Latitude,Longitude,FkEpasubcatId,Naprodcat,ProdCat1,ProdCat2,ShippingAddress,ShippingAddress2,ShippingCity,ShippingState,ShippingPostcode,ShippingCountry,PostalAddress,PostalAddress2,PostalCity,PostalState,PostalPostcode,PostalCountry,Eparegion,Website,Comments,MillStatus,StatusDate")] MillInformation millInformation)
        {
            if (id != millInformation.MillId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(millInformation);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MillInformationExists(millInformation.MillId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            ViewData["FkEpasubcatId"] = new SelectList(_context.Epasubcat, "PkSubcatId", "Subcat", millInformation.FkEpasubcatId);
            ViewData["FkMillTypeId"]  = new SelectList(_context.MillType, "PkTypeId", "PkTypeId", millInformation.FkMillTypeId);
            return(View(millInformation));
        }
Example #2
0
        public async Task <IActionResult> Create([Bind("PkMillKey,MillId,FkMillTypeId,Company,Latitude,Longitude,FkEpasubcatId,Naprodcat,ProdCat1,ProdCat2,ShippingAddress,ShippingAddress2,ShippingCity,ShippingState,ShippingPostcode,ShippingCountry,PostalAddress,PostalAddress2,PostalCity,PostalState,PostalPostcode,PostalCountry,Eparegion,Website,Comments,MillStatus,StatusDate")] MillInformation millInformation)
        {
            if (ModelState.IsValid)
            {
                _context.Add(millInformation);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            ViewData["FkEpasubcatId"] = new SelectList(_context.Epasubcat, "PkSubcatId", "Subcat", millInformation.FkEpasubcatId);
            ViewData["FkMillTypeId"]  = new SelectList(_context.MillType, "PkTypeId", "PkTypeId", millInformation.FkMillTypeId);
            return(View(millInformation));
        }