Ejemplo n.º 1
0
 //To Delete the record of a particular employee
 public int DeleteEmployee(int id)
 {
     try
     {
         TblEmployee emp = db.TblEmployee.Find(id);
         db.TblEmployee.Remove(emp);
         db.SaveChanges();
         return(1);
     }
     catch
     {
         throw;
     }
 }
Ejemplo n.º 2
0
        //To Update the records of a particluar employee
        public int UpdateEmployee(TblEmployee employee)
        {
            try
            {
                db.Entry(employee).State = EntityState.Modified;
                db.SaveChanges();

                return(1);
            }
            catch
            {
                throw;
            }
        }