public async Task <IActionResult> Create([Bind("Id,Name,Email_Id,Address,Mobile_Number,Website")] Companies companies)
        {
            if (ModelState.IsValid)
            {
                _context.Add(companies);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(companies));
        }
        public async Task <IActionResult> Create([Bind("Id,Expected_date_of_delivery,ParcelsId")] Trackings trackings)
        {
            if (ModelState.IsValid)
            {
                _context.Add(trackings);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ParcelsId"] = new SelectList(_context.Set <Parcels>(), "Id", "Content_type", trackings.ParcelsId);
            return(View(trackings));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,Delivery_address,Parcel_weight,Content_type,Shipping_cost,SendersId,CompaniesId,RecieversId")] Parcels parcels)
        {
            if (ModelState.IsValid)
            {
                _context.Add(parcels);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompaniesId"] = new SelectList(_context.Companies, "Id", "Email_Id", parcels.CompaniesId);
            ViewData["RecieversId"] = new SelectList(_context.Recievers, "Id", "Email_Id", parcels.RecieversId);
            ViewData["SendersId"]   = new SelectList(_context.Senders, "Id", "Email_Id", parcels.SendersId);
            return(View(parcels));
        }