public async Task <IActionResult> Edit(int id, [Bind("Id,Code,DescriptionRU,DescriptionKK,DescriptionEN")] WClass wClass)
        {
            if (id != wClass.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(wClass);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!WClassExists(wClass.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(wClass));
        }
Exemple #2
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            WClass wClass = await db.WClasses.FindAsync(id);

            db.WClasses.Remove(wClass);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
        public async Task <IActionResult> Create([Bind("Id,Code,DescriptionRU,DescriptionKK,DescriptionEN")] WClass wClass)
        {
            if (ModelState.IsValid)
            {
                _context.Add(wClass);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(wClass));
        }
Exemple #4
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Code,Description")] WClass wClass)
        {
            if (ModelState.IsValid)
            {
                db.Entry(wClass).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(wClass));
        }
Exemple #5
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Code,Description")] WClass wClass)
        {
            if (ModelState.IsValid)
            {
                db.WClasses.Add(wClass);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(wClass));
        }
Exemple #6
0
        public async Task <ActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WClass wClass = await db.WClasses.FindAsync(id);

            if (wClass == null)
            {
                return(HttpNotFound());
            }
            return(View(wClass));
        }
Exemple #7
0
 public void updateWeight(float weight)
 {
     weightClass = determineWeightClass(weight);
 }
Exemple #8
0
 public WeightClass(float weight)
 {
     weightClass = determineWeightClass(weight);
 }