public async Task <ActionResult> Edit([Bind(Include = "Id,BandENo,DateTime,Price,Vat,InstitutionInfoId")] ImportTaxableGoods importTaxableGoods)
        {
            if (ModelState.IsValid)
            {
                db.Entry(importTaxableGoods).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", new { id = importTaxableGoods.InstitutionInfoId }));
            }
            return(View(importTaxableGoods));
        }
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            ImportTaxableGoods importTaxableGoods = await db.ImportTaxableGoodses.FindAsync(id);

            if (importTaxableGoods != null)
            {
                db.ImportTaxableGoodses.Remove(importTaxableGoods);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", new { id = importTaxableGoods.InstitutionInfoId }));
            }
            return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
        }
        // GET: ImportTaxableGoods/Details/5
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ImportTaxableGoods importTaxableGoods = await db.ImportTaxableGoodses.FindAsync(id);

            if (importTaxableGoods == null)
            {
                return(HttpNotFound());
            }
            return(View(importTaxableGoods));
        }
        // GET: ImportTaxableGoods/Create
        public ActionResult Create(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            if (id == 0)
            {
                return(HttpNotFound());
            }

            var data = new ImportTaxableGoods
            {
                InstitutionInfoId = (int)id
            };

            return(View(data));
        }
        public async Task <ActionResult> Create([Bind(Include = "Id,BandENo,DateTime,Price,Vat,InstitutionInfoId")] ImportTaxableGoods importTaxableGoods)
        {
            if (ModelState.IsValid)
            {
                db.ImportTaxableGoodses.Add(importTaxableGoods);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index", new { id = importTaxableGoods.InstitutionInfoId }));
            }

            if (importTaxableGoods.InstitutionInfoId != 0)
            {
                var data = new ImportTaxableGoods
                {
                    InstitutionInfoId = importTaxableGoods.InstitutionInfoId
                };
                return(View(data));
            }
            return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
        }