コード例 #1
0
 public StudentManager(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #2
0
        public SchoolDBEntities GetContext()
        {
            SchoolDBEntities wt = new SchoolDBEntities();

            return(wt);
        }
コード例 #3
0
 public ParentManager(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #4
0
 public RolesManager(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #5
0
 static DatabaseAccessor()
 {
     Instance = new SchoolDBEntities();
     Instance.Database.Connection.Open();
 }
コード例 #6
0
        public Karmand FindByUserName(string id)
        {
            SchoolDBEntities db = new SchoolDBEntities();

            return(db.Karmands.Where(p => p.UserName == id).Single());
        }
コード例 #7
0
        public Lesson FindByLessonID(int id)
        {
            SchoolDBEntities db = new SchoolDBEntities();

            return(db.Lessons.Where(p => p.LessonID == id).Single());
        }
コード例 #8
0
        public vLessonGroup FindByYear(string year)
        {
            SchoolDBEntities db = new SchoolDBEntities();

            return(db.vLessonGroups.Where(p => p.Year == year).Single());
        }
コード例 #9
0
        public LessonGroup FindFromLgByLGID(int id)
        {
            SchoolDBEntities db = new SchoolDBEntities();

            return(db.LessonGroups.Where(p => p.LGID == id).Single());
        }
コード例 #10
0
 public void CheckHomework(string content)
 {
     using (SchoolDBEntities schoolDB = new SchoolDBEntities())
     {
     }
 }
コード例 #11
0
 public AbsenceManager(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #12
0
 public vJavabeTamrinRepository()
 {
     conn = new Connection();
     sd   = conn.GetContext();
 }
コード例 #13
0
        protected void gvEmployees_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Edit")
            {
                // Retrieve the row index stored in the
                // CommandArgument property.
                int index = Convert.ToInt32(e.CommandArgument);

                // Retrieve the row that contains the button
                // from the Rows collection.
                GridViewRow row = gvEmployees.Rows[index];
                Session.Add("useridForEditEmployee", row.Cells[0].Text);
                Session.Timeout = 60;
                Response.Redirect("http://*****:*****@"<script type='text/javascript'>");
                    sb.Append("$('#modalShowDetails').modal('show');");
                    sb.Append(@"</script>");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                            "ModalScript", sb.ToString(), false);
                }
            }
            if (e.CommandName == "Delet")
            {
                // Retrieve the row index stored in the
                // CommandArgument property.
                int index = Convert.ToInt32(e.CommandArgument);

                // Retrieve the row that contains the button
                // from the Rows collection.
                GridViewRow row = gvEmployees.Rows[index];

                // KarmandRepository rep = new KarmandRepository();

                //rep.DeleteEmployee(row.Cells[0].Text);
                SchoolDBEntities db = new SchoolDBEntities();
                Karmand          k  = new Karmand();
                string           a  = row.Cells[0].Text;
                k = db.Karmands.Where(p => p.PersonalCode == a).Single();
                db.Karmands.Remove(k);
                db.SaveChanges();
                LoadEmployees();
            }
        }
コード例 #14
0
 public Repository(SchoolDBEntities ctx)
 {
     _ctx = ctx;
     _set = _ctx.Set <TEntity>();
 }
コード例 #15
0
        public vbarnameHaftegi FindByOzviatTak(int id)
        {
            SchoolDBEntities db = new SchoolDBEntities();

            return(db.vbarnameHaftegis.Where(p => p.OzviatID == id).Single());
        }
コード例 #16
0
 public BookManager(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #17
0
        public Karmand FindByEmployeeID(string id)
        {
            SchoolDBEntities db = new SchoolDBEntities();

            return(db.Karmands.Where(p => p.PersonalCode == id).Single());
        }
コード例 #18
0
 public LevelManager(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #19
0
 public NewsManager(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #20
0
 public CourseManager(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #21
0
 public GradesRepository()
 {
     conn = new Connection();
     db   = new SchoolDBEntities();
 }
コード例 #22
0
 public StuffManger(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #23
0
        public Student FindByStudentCode(string id)
        {
            SchoolDBEntities db = new SchoolDBEntities();

            return(db.Students.Where(p => p.StudentCode == id).Single());
        }
コード例 #24
0
 public StdCrsManager(SchoolDBEntities ctx) : base(ctx)
 {
 }
コード例 #25
0
 public Repository()
 {
     context = new SchoolDBEntities();
 }
コード例 #26
0
        protected void gvStudents_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "Edit")
            {
                // Retrieve the row index stored in the
                // CommandArgument property.
                int index = Convert.ToInt32(e.CommandArgument);

                // Retrieve the row that contains the button
                // from the Rows collection.
                GridViewRow row = gvStudents.Rows[index];

                Response.Redirect("http://*****:*****@"<script type='text/javascript'>");
                    sb.Append("$('#modalShowDetails').modal('show');");
                    sb.Append(@"</script>");
                    ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                    "ModalScript", sb.ToString(), false);
                }
            }
            if (e.CommandName == "Delet")
            {
                // Retrieve the row index stored in the
                // CommandArgument property.
                int index = Convert.ToInt32(e.CommandArgument);

                // Retrieve the row that contains the button
                // from the Rows collection.
                GridViewRow row = gvStudents.Rows[index];

                vStudentRepository rep = new vStudentRepository();

                SchoolDBEntities db = new SchoolDBEntities();
                db.Students.Remove(rep.FindByStudentCode(row.Cells[0].Text));
            }
        }