示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("wayBillID,RecipientName,Address,Cell,Date,WayBillInfo,WayBillweight,NumberOfParcels")] TritonExpressWaybill tritonExpressWaybill)
        {
            if (id != tritonExpressWaybill.wayBillID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tritonExpressWaybill);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TritonExpressWaybillExists(tritonExpressWaybill.wayBillID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tritonExpressWaybill));
        }
示例#2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,branch,vehicleyear,vehiclemake,vehiclemodel,vehiclereg,wayBillID")] TritonExpressVehicle tritonExpressVehicle)
        {
            if (id != tritonExpressVehicle.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tritonExpressVehicle);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TritonExpressVehicleExists(tritonExpressVehicle.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tritonExpressVehicle));
        }