Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("JobId,JobTitle")] JobType jobType)
        {
            if (id != jobType.JobId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(jobType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!JobTypeExists(jobType.JobId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobType));
        }
        public async Task <IActionResult> Edit(int id, [Bind("SupplierId,Website,Login,Password,Notes")] SupplierLogin supplierLogin)
        {
            if (id != supplierLogin.SupplierId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(supplierLogin);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SupplierLoginExists(supplierLogin.SupplierId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SupplierId"] = new SelectList(_context.Supplier, "SupplierId", "Company", supplierLogin.SupplierId);
            return(View(supplierLogin));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(int id, [Bind("SupplierId,OrderingMethod,OrderingEmail,PriceFound,DiscountOw,DiscountOr,DiscountNotes,Terms,LeadTime,SalesReq,Books,PaymentMethod,PaymentNotes")] SupplierOrder supplierOrder)
        {
            if (id != supplierOrder.SupplierId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(supplierOrder);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SupplierOrderExists(supplierOrder.SupplierId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SupplierId"] = new SelectList(_context.Supplier, "SupplierId", "Company", supplierOrder.SupplierId);
            return(View(supplierOrder));
        }
Beispiel #4
0
        public async Task <IActionResult> Edit(int categoryId, [Bind("CategoryId,CodeId,CodeName")] CodeList codeList)
        {
            if (categoryId != codeList.CategoryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(codeList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CodeListExists(codeList.CategoryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_context.CodeCategory, "CategoryId", "CategoryName", codeList.CategoryId);
            return(View(codeList));
        }
        public async Task <IActionResult> Edit(int id, [Bind("CategoryId,CategoryName")] CodeCategory codeCategory)
        {
            if (id != codeCategory.CategoryId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(codeCategory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CodeCategoryExists(codeCategory.CategoryId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(codeCategory));
        }
Beispiel #6
0
        public async Task <IActionResult> Edit(int?projectId, int?orderId, string productId, [Bind("ProjectId,OrderId,ProductId,Dimension,Description,Pattern,Colour,Quantity,Uom,UnitPrice,Amount,DeliveryStatus,OrderedBy,CreatedTime,UpdatedBy,UpdatedTime")] PurchaseOrderdetail purchaseOrderdetail)
        {
            if (projectId != purchaseOrderdetail.ProjectId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(purchaseOrderdetail);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PurchaseOrderdetailExists(purchaseOrderdetail.ProjectId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OrderedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", purchaseOrderdetail.OrderedBy);
            ViewData["ProjectId"] = new SelectList(_context.PurchaseOrder, "ProjectId", "ProjectId", purchaseOrderdetail.ProjectId);
            ViewData["OrderId"]   = new SelectList(_context.PurchaseOrder, "OrderId", "OrderId");
            ViewData["UpdatedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", purchaseOrderdetail.UpdatedBy);
            return(View(purchaseOrderdetail));
        }
Beispiel #7
0
        public async Task <IActionResult> Edit(int id, [Bind("ProjectId,ProjectTag,ClientId,Status,DesignedBy,CreatedTime,UpdatedBy,UpdatedTime")] Project project)
        {
            if (id != project.ProjectId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(project);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProjectExists(project.ProjectId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientId"]   = new SelectList(_context.Client, "ClientId", "Company", project.ClientId);
            ViewData["DesignedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", project.DesignedBy);
            ViewData["UpdatedBy"]  = new SelectList(_context.Employee, "UserId", "FirstName", project.UpdatedBy);
            return(View(project));
        }
        public async Task <IActionResult> Edit(int?projectId, int?orderId, [Bind("ProjectId,OrderId,SupplierId,ShippingPlace,ShippingAddress,ShippingPhone,EstimatedShipdate,OrderedBy,CreatedTime,UpdatedBy,UpdatedTime")] PurchaseOrder purchaseOrder)
        {
            if (projectId != purchaseOrder.ProjectId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(purchaseOrder);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PurchaseOrderExists(purchaseOrder.ProjectId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OrderedBy"]  = new SelectList(_context.Employee, "UserId", "FirstName", purchaseOrder.OrderedBy);
            ViewData["ProjectId"]  = new SelectList(_context.Project, "ProjectId", "ProjectTag", purchaseOrder.ProjectId);
            ViewData["SupplierId"] = new SelectList(_context.Supplier, "SupplierId", "Company", purchaseOrder.SupplierId);
            ViewData["UpdatedBy"]  = new SelectList(_context.Employee, "UserId", "FirstName", purchaseOrder.UpdatedBy);
            return(View(purchaseOrder));
        }
Beispiel #9
0
        public async Task <IActionResult> Edit(int?projectId, string roomId, int?draperyId, [Bind("ProjectId,RoomId,DraperyId,TypeName,TypeValue,DesignedBy,CreatedTime,UpdatedBy,UpdatedTime")] Drapery drapery)
        {
            if (projectId != drapery.ProjectId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(drapery);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DraperyExists(drapery.ProjectId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DesignedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", drapery.DesignedBy);
            ViewData["ProjectId"]  = new SelectList(_context.Room, "ProjectId", "ProjectId", drapery.ProjectId);
            ViewData["RoomId"]     = new SelectList(_context.Room, "RoomId", "RoomId");
            ViewData["UpdatedBy"]  = new SelectList(_context.Employee, "UserId", "FirstName", drapery.UpdatedBy);
            return(View(drapery));
        }
Beispiel #10
0
        public async Task <IActionResult> Edit(int?projectId, string roomId, [Bind("ProjectId,RoomId,FloorCeiling,TotCeiling,BotFloor,LootObject,RootObject,InsideHorizontal,InsideVertical,OutsideHorizontal,OutsideVertical,TrimDepth,InsideDepth,Sill,Control,Notes,DesignedBy,CreatedTime,UpdatedBy,UpdatedTime")] Room room)
        {
            if (projectId != room.ProjectId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(room);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RoomExists(room.ProjectId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DesignedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", room.DesignedBy);
            ViewData["ProjectId"]  = new SelectList(_context.Project, "ProjectId", "ProjectTag", room.ProjectId);
            ViewData["UpdatedBy"]  = new SelectList(_context.Employee, "UserId", "FirstName", room.UpdatedBy);
            return(View(room));
        }
Beispiel #11
0
        public async Task <IActionResult> Edit(int id, [Bind("ClientId,FirstName,LastName,Category,Company,Phone,Address,City,Province,Postalcode,Email,Website,BizType,BizYear,Associations,Recommender,Hst,Reference,Mailing,Term,Timestamp,Comments")] Client client)
        {
            if (id != client.ClientId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(client);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientExists(client.ClientId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Beispiel #12
0
        public async Task <IActionResult> Edit(int?projectId, string roomId, string productId, [Bind("ProjectId,RoomId,ProductId,Dimension,Description,SupplierId,Pattern,Colour,Quantity,Uom,UnitPrice,RetailPrice,Amount,RetailAmount,DesignedBy,CreatedTime,UpdatedBy,UpdatedTime")] Items items)
        {
            if (projectId != items.ProjectId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(items);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ItemsExists(items.ProjectId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DesignedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", items.DesignedBy);
            ViewData["ProjectId"]  = new SelectList(_context.Room, "ProjectId", "ProjectId", items.ProjectId);
            ViewData["RoomId"]     = new SelectList(_context.Room, "RoomId", "RoomId");
            ViewData["UpdatedBy"]  = new SelectList(_context.Employee, "UserId", "FirstName", items.UpdatedBy);
            return(View(items));
        }
Beispiel #13
0
        public async Task <IActionResult> Edit(int id, [Bind("SupplierId,Company,Category,Account,Address,City,Province,Postalcode,Phone,RepName,RepEmail,CreatedBy,CreatedTime")] Supplier supplier)
        {
            if (id != supplier.SupplierId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(supplier);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SupplierExists(supplier.SupplierId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CreatedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", supplier.CreatedBy);
            return(View(supplier));
        }
Beispiel #14
0
        public async Task <IActionResult> Edit(int supplierId, [Bind("SupplierId,ProductId,Dimension,Description,Finishes,Uom,Price,BookNumber,CreatedBy,CreatedTime")] Product product)
        {
            if (supplierId != product.SupplierId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(product);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProductExists(product.SupplierId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CreatedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", product.CreatedBy);
            return(View(product));
        }
Beispiel #15
0
        public async Task <IActionResult> Edit(int id, [Bind("UserId,UserName,FirstName,LastName,Password,JobId,Address,City,Province,Postalcode,Email,Phone")] Employee employee)
        {
            if (id != employee.UserId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(employee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmployeeExists(employee.UserId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["JobId"] = new SelectList(_context.JobType, "JobId", "JobTitle", employee.JobId);
            return(View(employee));
        }
Beispiel #16
0
        public async Task <IActionResult> Edit(int id, [Bind("ProjectId,InvoiceDate,Terms,BillPlace,BillAddress,BillPhone,BillEmail,ShipPlace,ShipAddress,Subtotal,Shipping,Hst,TotalAmount,InvoiceBy,CreatedTime,UpdatedBy,UpdatedTime")] Invoice invoice)
        {
            if (id != invoice.ProjectId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(invoice);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InvoiceExists(invoice.ProjectId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["InvoiceBy"] = new SelectList(_context.Employee, "UserId", "FirstName", invoice.InvoiceBy);
            ViewData["ProjectId"] = new SelectList(_context.Project, "ProjectId", "ProjectTag", invoice.ProjectId);
            ViewData["UpdatedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", invoice.UpdatedBy);
            return(View(invoice));
        }