Пример #1
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(TblRecordProduct).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TblRecordProductExists(TblRecordProduct.ProductId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./RpDisplay"));
        }
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            UserRole = HttpContext.Session.GetString("UserRole");

            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.Attach(TblWarehouse).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!TblWarehouseExists(TblWarehouse.WarehouseId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(RedirectToPage("./WDisplay"));
        }
Пример #3
0
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.TblRecordProducts.Add(TblRecordProduct);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./RpDisplay"));
        }
        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.TblAccountings.Add(TblAccountings);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./ADisplay"));
        }
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TblAcc = await _context.TblAccs.FindAsync(id);

            if (TblAcc != null)
            {
                _context.TblAccs.Remove(TblAcc);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./Welcome"));
        }
Пример #6
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TblRecordProduct = await _context.TblRecordProducts.FindAsync(id);

            if (TblRecordProduct != null)
            {
                _context.TblRecordProducts.Remove(TblRecordProduct);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./RpDisplay"));
        }
Пример #7
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TblWarehouse = await _context.TblWarehouses.FindAsync(id);

            if (TblWarehouse != null)
            {
                _context.TblWarehouses.Remove(TblWarehouse);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./WDisplay"));
        }
Пример #8
0
        public async Task <IActionResult> OnPostAsync(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            TblFirstQuality = await _context.TblFirstQualities.FindAsync(id);

            if (TblFirstQuality != null)
            {
                _context.TblFirstQualities.Remove(TblFirstQuality);
                await _context.SaveChangesAsync();
            }

            return(RedirectToPage("./FqDisplay"));
        }
Пример #9
0
        /* public IActionResult OnGet()
         * {
         * ViewData["ProductId"] = new SelectList(_context.TblRecordProducts, "ProductId", "ProductId");
         *   return Page();
         * }
         */

        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            int id = Convert.ToInt32(Request.Form["pID2"]);

            S.ProductId = id;


            if (!ModelState.IsValid)
            {
                return(Page());
            }

            _context.TblShipments.Add(S);
            await _context.SaveChangesAsync();

            return(RedirectToPage("./SDisplay"));
        }
        /*public IActionResult OnGet()
         * {
         *
         *  ViewData["ProductId"] = new SelectList(_context.TblRecordProducts, "ProductId", "ProductId");
         *  return Page();
         * }
         */


        // To protect from overposting attacks, enable the specific properties you want to bind to, for
        // more details, see https://aka.ms/RazorPagesCRUD.
        public async Task <IActionResult> OnPostAsync()
        {
            int id = Convert.ToInt32(Request.Form["productID"]);


            Fq.ProductId = id;

            if (!ModelState.IsValid)
            {
                return(Page());
            }


            // TblFirstQuality.ProductId = TblRecordProducts.ProductId;


            _context.TblFirstQualities.Add(Fq);
            await _context.SaveChangesAsync();


            return(RedirectToPage("./FqDisplay"));
        }