Exemplo n.º 1
0
        public async Task <string> PFitemAsync(string amount, string rdid)
        {
            RecordDetails temp = _context.RecordDetails.Where(s => s.Rdid.ToString() == rdid).ToList().First();

            temp.QuantityDelivered = int.Parse(amount);
            _context.Update(temp);
            await _context.SaveChangesAsync();

            return("123");
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(string id, [Bind("ItemNumber,Category,ItemName,ReorderLevel,ReorderQty,UnitOfMeasure,Stock,Supplier1,Supplier2,Supplier3,Supplier1Price,Supplier2Price,Supplier3Price,Location")] Catalogue catalogue)
        {
            if (id != catalogue.ItemNumber)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(catalogue);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CatalogueExists(catalogue.ItemNumber))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["Supplier1"] = new SelectList(_context.Supplier, "SupplierCode", "SupplierCode", catalogue.Supplier1);
            ViewData["Supplier2"] = new SelectList(_context.Supplier, "SupplierCode", "SupplierCode", catalogue.Supplier2);
            ViewData["Supplier3"] = new SelectList(_context.Supplier, "SupplierCode", "SupplierCode", catalogue.Supplier3);
            return(View(catalogue));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(string id, [Bind("SupplierCode,SupplierName,GstregistrationNo,TitleOfCourtesy,ContactName,PhoneNo,FaxNo,Address,City,PostalCode")] Supplier supplier)
        {
            if (id != supplier.SupplierCode)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(supplier);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SupplierExists(supplier.SupplierCode))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(supplier));
        }
Exemplo n.º 4
0
        public async Task <IActionResult> Edit(int id, [Bind("UserId,TitleOfCourtesy,Name,DepartmentCode,Telephone,Fax,EmailAddress")] User user)
        {
            if (id != user.UserId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.UserId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DepartmentCode"] = new SelectList(_context.Department, "DepartmentCode", "DepartmentCode", user.DepartmentCode);
            return(View(user));
        }
        public async Task <IActionResult> Edit(string id, [Bind("Dlid,StartDate,EstDeliverDate,CompleteDate,DepartmentCode,RepId,CollectionPointId,Status")] DisbursementList disbursementList)
        {
            if (id != disbursementList.Dlid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(disbursementList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DisbursementListExists(disbursementList.Dlid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CollectionPointId"] = new SelectList(_context.CollectionPoint, "CollectionPointId", "CollectionPointName", disbursementList.CollectionPointId);
            ViewData["DepartmentCode"]    = new SelectList(_context.Department, "DepartmentCode", "DepartmentCode", disbursementList.DepartmentCode);
            //ViewData["RepId"] = new SelectList(_context.User, "UserId", "DepartmentCode", disbursementList.RepId);
            return(View(disbursementList));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Rdid,Rrid,ItemNumber,Quantity,Remark")] RecordDetails recordDetails)
        {
            if (id != recordDetails.Rdid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(recordDetails);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RecordDetailsExists(recordDetails.Rdid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ItemNumber"] = new SelectList(_context.Catalogue, "ItemNumber", "ItemNumber", recordDetails.ItemNumber);
            return(View(recordDetails));
        }