Beispiel #1
0
        public async Task <IActionResult> Create([Bind("Id,Code,Details")] Durations durations)
        {
            if (ModelState.IsValid)
            {
                _context.Add(durations);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(durations));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Name")] Cities cities)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cities);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cities));
        }
        public async Task <IActionResult> Create([Bind("Id,Totalamount,Categoryname")] CustomerCategories customerCategories)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customerCategories);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(customerCategories));
        }
Beispiel #4
0
        public async Task <IActionResult> Create([Bind("Id,Timestamp,Text")] Logs logs)
        {
            if (ModelState.IsValid)
            {
                _context.Add(logs);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(logs));
        }
Beispiel #5
0
        public async Task <IActionResult> Create([Bind("Id,Lastname,Firstname,Address,CityId,Phone,Email,Mobile")] Customers customers)
        {
            if (ModelState.IsValid)
            {
                _context.Add(customers);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CityId"] = new SelectList(_context.Cities, "Id", "Name", customers.CityId);
            return(View(customers));
        }
Beispiel #6
0
        public async Task <IActionResult> Create([Bind("Id,Itemnb,Brand,Model,Size,CategoryId,Cost,Returned,Type,Stock,Serialnumber")] Items items)
        {
            if (ModelState.IsValid)
            {
                _context.Add(items);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Code", items.CategoryId);
            return(View(items));
        }
Beispiel #7
0
        public async Task <IActionResult> Create([Bind("Id,CustomerId,Date,Description,Amount")] Purchases purchases)
        {
            if (ModelState.IsValid)
            {
                _context.Add(purchases);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerId"] = new SelectList(_context.Customers, "Id", "Firstname", purchases.CustomerId);
            return(View(purchases));
        }
Beispiel #8
0
        public async Task <IActionResult> Create([Bind("Id,CategoryId,DurationId,GeartypeId,Price")] Rentprices rentprices)
        {
            if (ModelState.IsValid)
            {
                _context.Add(rentprices);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Code", rentprices.CategoryId);
            ViewData["DurationId"] = new SelectList(_context.Durations, "Id", "Code", rentprices.DurationId);
            ViewData["GeartypeId"] = new SelectList(_context.Geartypes, "Id", "Name", rentprices.GeartypeId);
            return(View(rentprices));
        }
Beispiel #9
0
        public async Task <IActionResult> Create([Bind("Id,Creationdate,Effectivereturn,Plannedreturn,CustomerId,Notes,Total,Takenon,Paidon,Insurance,Goget,HelpStaffId,TuneStaffId")] Contracts contracts)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contracts);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CustomerId"]  = new SelectList(_context.Customers, "Id", "Firstname", contracts.CustomerId);
            ViewData["HelpStaffId"] = new SelectList(_context.Staffs, "Id", "Id", contracts.HelpStaffId);
            ViewData["TuneStaffId"] = new SelectList(_context.Staffs, "Id", "Id", contracts.TuneStaffId);
            return(View(contracts));
        }
Beispiel #10
0
        public async Task <IActionResult> Create([Bind("Id,ItemId,ContractId,DurationId,CategoryId,Price,Description,Linenb,Partialreturn")] Renteditems renteditems)
        {
            if (ModelState.IsValid)
            {
                _context.Add(renteditems);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CategoryId"] = new SelectList(_context.Categories, "Id", "Code", renteditems.CategoryId);
            ViewData["ContractId"] = new SelectList(_context.Contracts, "Id", "Id", renteditems.ContractId);
            ViewData["DurationId"] = new SelectList(_context.Durations, "Id", "Code", renteditems.DurationId);
            ViewData["ItemId"]     = new SelectList(_context.Items, "Id", "Itemnb", renteditems.ItemId);
            return(View(renteditems));
        }