Пример #1
0
        public async Task <IActionResult> Create([Bind("UserId,UserName,UserPassword,UserImagePath,Address,PostCode,Phone,BirthDate,IsOnline,NoOfAccess,CreationDate,NoOfBlock")] WebUsers webUsers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(webUsers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(webUsers));
        }
        public async Task <IActionResult> Create([Bind("AdminShopId,UserName,UserPassword,ShopName,ShopEmail,PhoneNo,ShopAddress")] Adminshop adminshop)
        {
            if (ModelState.IsValid)
            {
                _context.Add(adminshop);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(adminshop));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("PaymentId,PaymentType")] Payments payments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(payments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(payments));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("AccessoryTypeId,AccessoryType")] AccessoryTypes accessoryTypes)
        {
            if (ModelState.IsValid)
            {
                _context.Add(accessoryTypes);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(accessoryTypes));
        }
        public async Task <IActionResult> Create([Bind("ErrId,ErrMessage,ErrDate,ErrPageName,ErrLine,ErrDetails")] ErrorTb errorTb)
        {
            if (ModelState.IsValid)
            {
                _context.Add(errorTb);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(errorTb));
        }
Пример #6
0
        public async Task <IActionResult> Create([Bind("ProductId,ProductImagePath")] ProductPictures productPictures)
        {
            if (ModelState.IsValid)
            {
                _context.Add(productPictures);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProductId"] = new SelectList(_context.Products, "ProductId", "ProductName", productPictures.ProductId);
            return(View(productPictures));
        }
        public async Task <IActionResult> Create([Bind("ProductId,ScreenSize,ScreenType,Ram,CameraPropertry,Battery,ModeNo,FingerPrint,WaterResist,Processor,HardType,HardStorage,Genaration,ExtraProperty")] LaptopProperties laptopProperties)
        {
            if (ModelState.IsValid)
            {
                _context.Add(laptopProperties);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProductId"] = new SelectList(_context.Products, "ProductId", "ProductName", laptopProperties.ProductId);
            return(View(laptopProperties));
        }
Пример #8
0
        public async Task <IActionResult> Create([Bind("UserId,Email")] UserEmails userEmails)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userEmails);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["UserId"] = new SelectList(_context.WebUsers, "UserId", "Address", userEmails.UserId);
            return(View(userEmails));
        }
        public async Task <IActionResult> Create([Bind("ProductId,ScreenSize,ScreenType,Ram,CameraPropertry,Battery,ModeNo,FingerPrint,WaterResist,Sim,OperatingSystem,Storage,ExtraProperty")] MobileProperties mobileProperties)
        {
            if (ModelState.IsValid)
            {
                _context.Add(mobileProperties);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProductId"] = new SelectList(_context.Products, "ProductId", "ProductName", mobileProperties.ProductId);
            return(View(mobileProperties));
        }
        public async Task <IActionResult> Create([Bind("ProductId,AccessoryTypeId")] Accessories accessories)
        {
            if (ModelState.IsValid)
            {
                _context.Add(accessories);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AccessoryTypeId"] = new SelectList(_context.AccessoryTypes, "AccessoryTypeId", "AccessoryType", accessories.AccessoryTypeId);
            ViewData["ProductId"]       = new SelectList(_context.Products, "ProductId", "ProductName", accessories.ProductId);
            return(View(accessories));
        }
Пример #11
0
        public async Task <IActionResult> Create([Bind("OrderId,OrderDate,OrderPrice,DriverNo,DeliveryDate,IsPaid,IsProductBinEmpty,UserId,PaymentId")] Orders orders)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orders);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PaymentId"] = new SelectList(_context.Payments, "PaymentId", "PaymentType", orders.PaymentId);
            ViewData["UserId"]    = new SelectList(_context.WebUsers, "UserId", "Address", orders.UserId);
            return(View(orders));
        }
        public async Task <IActionResult> Create([Bind("ProductId,CategoryId,BrandId,ProductName,ProductDescription,ProductQuantity,ProductPrice,Discount,VendorName,ProductColor,ProductRate,IsOffer")] Products products)
        {
            if (ModelState.IsValid)
            {
                _context.Add(products);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["BrandId"]    = new SelectList(_context.Brands, "BrandId", "BrandName", products.BrandId);
            ViewData["CategoryId"] = new SelectList(_context.Categories, "CategoryId", "CategoryName", products.CategoryId);
            return(View(products));
        }
Пример #13
0
        public async Task <IActionResult> Create([Bind("UserId,MessageBody,MessageDate,ProductId")] UserProductComments userProductComments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(userProductComments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProductId"] = new SelectList(_context.Products, "ProductId", "ProductName", userProductComments.ProductId);
            ViewData["UserId"]    = new SelectList(_context.WebUsers, "UserId", "Address", userProductComments.UserId);
            return(View(userProductComments));
        }
        public async Task <IActionResult> Create([Bind("OrderId,ProductId,UnitPrice,SellingPrice,Quantity")] OrderDetails orderDetails)
        {
            if (ModelState.IsValid)
            {
                _context.Add(orderDetails);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OrderId"]   = new SelectList(_context.Orders, "OrderId", "OrderId", orderDetails.OrderId);
            ViewData["ProductId"] = new SelectList(_context.Products, "ProductId", "ProductName", orderDetails.ProductId);
            return(View(orderDetails));
        }
Пример #15
0
        public async Task <IActionResult> Create([Bind("BrandId,BrandName,BrandDescription,BrandLogoPicturePath")] Brands brands, IFormFile _Imag)
        {
            if (ModelState.IsValid)
            {
                brands.BrandId = GetMaxBrandNo();
                _context.Add(brands);
                await _context.SaveChangesAsync();

                SaveBrand_Image(brands, _Imag);
                _context.SaveChanges();
                return(RedirectToAction(nameof(Index)));
            }
            return(View(brands));
        }
Пример #16
0
        public async Task <IActionResult> Create(Categories categories, IFormFile _Imag)
        {
            if (ModelState.IsValid)
            {
                categories.CategoryId = GetMaxGatagNo();
                _context.Add(categories);
                await _context.SaveChangesAsync();

                SaveCatg_Image(categories, _Imag);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(categories));
        }