public async Task <IActionResult> PutPurchaseOrderdetail([FromRoute] int projectId, int orderId, string productId, [FromBody] PurchaseOrderdetail purchaseOrderdetail)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (projectId != purchaseOrderdetail.ProjectId)
            {
                return(BadRequest());
            }

            _context.Entry(purchaseOrderdetail).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProjectExists(projectId) && !OrderExists(orderId) && !ProductExists(productId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 2
0
        public async Task <IActionResult> PutSupplierOrder([FromRoute] int id, [FromBody] SupplierOrder supplierOrder)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != supplierOrder.SupplierId)
            {
                return(BadRequest());
            }

            _context.Entry(supplierOrder).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SupplierOrderExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 3
0
        public async Task <IActionResult> PutInvoice([FromRoute] int id, [FromBody] Invoice invoice)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != invoice.ProjectId)
            {
                return(BadRequest());
            }

            _context.Entry(invoice).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!InvoiceExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 4
0
        public async Task <IActionResult> PutItems([FromRoute] int projectId, string roomId, string productId, [FromBody] Items items)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (projectId != items.ProjectId)
            {
                return(BadRequest());
            }

            _context.Entry(items).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProjectExists(projectId) && !RoomExists(roomId) && !ProductExists(productId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 5
0
        public async Task <IActionResult> PutProduct([FromRoute] string productId, int supplierId, [FromBody] Product product)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (productId != product.ProductId)
            {
                return(BadRequest());
            }

            _context.Entry(product).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProductExists(productId) && !SupplierExists(supplierId))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 6
0
        public async Task <IActionResult> PutCodeCategory([FromRoute] int id, [FromBody] CodeCategory codeCategory)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != codeCategory.CategoryId)
            {
                return(BadRequest());
            }

            _context.Entry(codeCategory).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CodeCategoryExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Esempio n. 7
0
        public async Task<IActionResult> PutRoom([FromRoute] string roomId, int projectId, [FromBody] Room room)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (roomId != room.RoomId)
            {
                return BadRequest();
            }

            _context.Entry(room).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RoomExists(roomId) && !ProjectExists(projectId))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return NoContent();
        }
Esempio n. 8
0
        public async Task <IActionResult> Create([Bind("CategoryId,CategoryName")] CodeCategory codeCategory)
        {
            if (ModelState.IsValid)
            {
                _context.Add(codeCategory);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(codeCategory));
        }
Esempio n. 9
0
        public async Task <IActionResult> Create([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 (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Esempio n. 10
0
        public async Task <IActionResult> Create([Bind("JobId,JobTitle")] JobType jobType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(jobType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(jobType));
        }
Esempio n. 11
0
        public async Task <IActionResult> Create([Bind("CategoryId,CodeId,CodeName")] CodeList codeList)
        {
            if (ModelState.IsValid)
            {
                _context.Add(codeList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_context.CodeCategory, "CategoryId", "CategoryName", codeList.CategoryId);
            return(View(codeList));
        }
Esempio n. 12
0
        public async Task <IActionResult> Create([Bind("SupplierId,Website,Login,Password,Notes")] SupplierLogin supplierLogin)
        {
            if (ModelState.IsValid)
            {
                _context.Add(supplierLogin);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SupplierId"] = new SelectList(_context.Supplier, "SupplierId", "Company", supplierLogin.SupplierId);
            return(View(supplierLogin));
        }
Esempio n. 13
0
        public async Task <IActionResult> Create([Bind("SupplierId,OrderingMethod,OrderingEmail,PriceFound,DiscountOw,DiscountOr,DiscountNotes,Terms,LeadTime,SalesReq,Books,PaymentMethod,PaymentNotes")] SupplierOrder supplierOrder)
        {
            if (ModelState.IsValid)
            {
                _context.Add(supplierOrder);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["SupplierId"] = new SelectList(_context.Supplier, "SupplierId", "Company", supplierOrder.SupplierId);
            return(View(supplierOrder));
        }
Esempio n. 14
0
        public async Task <IActionResult> Create([Bind("UserId,UserName,FirstName,LastName,Password,JobId,Address,City,Province,Postalcode,Email,Phone")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["JobId"] = new SelectList(_context.JobType, "JobId", "JobTitle", employee.JobId);
            return(View(employee));
        }
Esempio n. 15
0
        public async Task <IActionResult> Create([Bind("SupplierId,Company,Category,Account,Address,City,Province,Postalcode,Phone,RepName,RepEmail,CreatedBy,CreatedTime")] Supplier supplier)
        {
            if (ModelState.IsValid)
            {
                _context.Add(supplier);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CreatedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", supplier.CreatedBy);
            return(View(supplier));
        }
Esempio n. 16
0
        public async Task <IActionResult> Create([Bind("SupplierId,ProductId,Dimension,Description,Finishes,Uom,Price,BookNumber,CreatedBy,CreatedTime")] Product product)
        {
            if (ModelState.IsValid)
            {
                _context.Add(product);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CreatedBy"] = new SelectList(_context.Employee, "UserId", "FirstName", product.CreatedBy);
            return(View(product));
        }
Esempio n. 17
0
        public async Task <IActionResult> Create([Bind("ProjectId,ProjectTag,ClientId,Status,DesignedBy,CreatedTime,UpdatedBy,UpdatedTime")] Project project)
        {
            if (ModelState.IsValid)
            {
                _context.Add(project);
                await _context.SaveChangesAsync();

                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));
        }
Esempio n. 18
0
        public async Task <IActionResult> Create([Bind("ProjectId,RoomId,FloorCeiling,TotCeiling,BotFloor,LootObject,RootObject,InsideHorizontal,InsideVertical,OutsideHorizontal,OutsideVertical,TrimDepth,InsideDepth,Sill,Control,Notes,DesignedBy,CreatedTime,UpdatedBy,UpdatedTime")] Room room)
        {
            if (ModelState.IsValid)
            {
                _context.Add(room);
                await _context.SaveChangesAsync();

                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));
        }
Esempio n. 19
0
        public async Task <IActionResult> Create([Bind("ProjectId,InvoiceDate,Terms,BillPlace,BillAddress,BillPhone,BillEmail,ShipPlace,ShipAddress,Subtotal,Shipping,Hst,TotalAmount,InvoiceBy,CreatedTime,UpdatedBy,UpdatedTime")] Invoice invoice)
        {
            if (ModelState.IsValid)
            {
                _context.Add(invoice);
                await _context.SaveChangesAsync();

                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));
        }
Esempio n. 20
0
        public async Task <IActionResult> Create([Bind("ProjectId,OrderId,SupplierId,ShippingPlace,ShippingAddress,ShippingPhone,EstimatedShipdate,OrderedBy,CreatedTime,UpdatedBy,UpdatedTime")] PurchaseOrder purchaseOrder)
        {
            if (ModelState.IsValid)
            {
                _context.Add(purchaseOrder);
                await _context.SaveChangesAsync();

                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));
        }
Esempio n. 21
0
        public async Task <IActionResult> Create([Bind("ProjectId,RoomId,DraperyId,TypeName,TypeValue,DesignedBy,CreatedTime,UpdatedBy,UpdatedTime")] Drapery drapery)
        {
            if (ModelState.IsValid)
            {
                _context.Add(drapery);
                await _context.SaveChangesAsync();

                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));
        }
Esempio n. 22
0
        public async Task <IActionResult> Create([Bind("ProjectId,RoomId,ProductId,Dimension,Description,SupplierId,Pattern,Colour,Quantity,Uom,UnitPrice,RetailPrice,Amount,RetailAmount,DesignedBy,CreatedTime,UpdatedBy,UpdatedTime")] Items items)
        {
            if (ModelState.IsValid)
            {
                _context.Add(items);
                await _context.SaveChangesAsync();

                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));
        }
Esempio n. 23
0
        public async Task <IActionResult> Create([Bind("ProjectId,OrderId,ProductId,Dimension,Description,Pattern,Colour,Quantity,Uom,UnitPrice,Amount,DeliveryStatus,OrderedBy,CreatedTime,UpdatedBy,UpdatedTime")] PurchaseOrderdetail purchaseOrderdetail)
        {
            if (ModelState.IsValid)
            {
                _context.Add(purchaseOrderdetail);
                await _context.SaveChangesAsync();

                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));
        }