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

                return(RedirectToAction(nameof(Index)));
            }
            return(View(recieverdetails));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Id,Expected_date_of_delivery,ParcelId")] Tracking tracking)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tracking);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ParcelId"] = new SelectList(_context.Set <Parcel>(), "Id", "Content_type", tracking.ParcelId);
            return(View(tracking));
        }
        public async Task <IActionResult> Create([Bind("Id,Delivery_address,Parcel_weight,Content_type,Shipping_cost,SenderdetailsId,CompanydetailsId,RecieverdetailsId")] Parcel parcel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(parcel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompanydetailsId"]  = new SelectList(_context.Companydetails, "Id", "Email_Id", parcel.CompanydetailsId);
            ViewData["RecieverdetailsId"] = new SelectList(_context.Recieverdetails, "Id", "Email_Id", parcel.RecieverdetailsId);
            ViewData["SenderdetailsId"]   = new SelectList(_context.Senderdetails, "Id", "Email_Id", parcel.SenderdetailsId);
            return(View(parcel));
        }