コード例 #1
0
ファイル: StudentDAL.cs プロジェクト: Mhlove/Rachit-WForm
        /// <summary>
        /// This function is used to delete a row from the database
        /// </summary>
        /// <param name="eid"> The id of the Employee who's data we wish to delete from the database</param>
        public void delete(Student modelobj)
        {
            var context = new TestDBEntities1();

            context.Entry(modelobj).State = System.Data.Entity.EntityState.Deleted;
            context.SaveChanges();
        }
コード例 #2
0
ファイル: StudentDAL.cs プロジェクト: Mhlove/Rachit-WForm
        /// <summary>
        /// This function is used to update a particular entry in the database
        /// </summary>
        public void update(Student studentobj)
        {
            var context = new TestDBEntities1();

            context.Entry(studentobj).State = System.Data.Entity.EntityState.Modified;
            context.SaveChanges();
        }
コード例 #3
0
ファイル: EmployeeDAL.cs プロジェクト: Mhlove/Rachit-WForm
        /// <summary>
        /// This function is used to update a particular entry in the database
        /// </summary>
        public void update(Employee modelobj)
        {
            var context = new TestDBEntities1();

            context.Entry(modelobj).State = System.Data.Entity.EntityState.Modified;
            context.SaveChanges();
        }
コード例 #4
0
        /// <summary>
        /// update method to update the records of the student datatable
        /// </summary>

        public void UpdateStudentVal(Student emp)
        {
            using (TestDBEntities1 context = new TestDBEntities1())
            {
                context.Entry(emp).State = System.Data.Entity.EntityState.Modified;
                context.SaveChanges();
            }
        }