Exemple #1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            Lepmtrl lepmtrl = await db.Lepmtrls.FindAsync(id);

            db.Lepmtrls.Remove(lepmtrl);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Code,NameEN,NameKZ,NameRU")] Lepmtrl lepmtrl)
        {
            if (ModelState.IsValid)
            {
                db.Entry(lepmtrl).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(lepmtrl));
        }
Exemple #3
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Code,NameEN,NameKZ,NameRU")] Lepmtrl lepmtrl)
        {
            if (ModelState.IsValid)
            {
                db.Lepmtrls.Add(lepmtrl);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(lepmtrl));
        }
Exemple #4
0
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Lepmtrl lepmtrl = await db.Lepmtrls.FindAsync(id);

            if (lepmtrl == null)
            {
                return(HttpNotFound());
            }
            return(View(lepmtrl));
        }