예제 #1
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));
        }
예제 #2
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));
        }
예제 #3
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));
        }
예제 #4
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));
        }
예제 #5
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));
        }
예제 #6
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));
        }
예제 #7
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));
        }
예제 #8
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));
        }
예제 #9
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));
        }
예제 #10
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));
        }
예제 #11
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));
        }
예제 #12
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));
        }
예제 #13
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));
        }
예제 #14
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));
        }
예제 #15
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));
        }
예제 #16
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));
        }