public async Task <ActionResult> Delete(int id)
        {
            using (var dbcontext = new SchoolERPDBContext())
            {
                User_Role userRole = await dbcontext.User_Roles.FindAsync(id);

                if (userRole != null)
                {
                    userRole.Is_Deleted = true;
                    dbcontext.Entry(userRole).CurrentValues.SetValues(userRole);
                    dbcontext.Entry(userRole).State = EntityState.Modified;
                    await dbcontext.SaveChangesAsync();
                }
            }

            return(RedirectToAction("RoleList"));
        }
        public async Task <ActionResult> Delete(int id)
        {
            using (var dbcontext = new SchoolERPDBContext())
            {
                Class cls = await dbcontext.Class.FindAsync(id);

                if (cls != null)
                {
                    cls.Is_Deleted = true;
                    dbcontext.Entry(cls).CurrentValues.SetValues(cls);
                    dbcontext.Entry(cls).State = EntityState.Modified;
                    await dbcontext.SaveChangesAsync();
                }
            }

            return(RedirectToAction("ClassList"));
        }
        public async Task <ActionResult> Delete(int id)
        {
            using (var dbcontext = new SchoolERPDBContext())
            {
                Exam exam = await dbcontext.Exam.FindAsync(id);

                if (exam != null)
                {
                    exam.Is_Deleted = true;
                    dbcontext.Entry(exam).CurrentValues.SetValues(exam);
                    dbcontext.Entry(exam).State = EntityState.Modified;
                    await dbcontext.SaveChangesAsync();
                }
            }

            return(RedirectToAction("ExamList"));
        }