Ejemplo n.º 1
0
        public IHttpActionResult PutEmployee_Education(int id, Employee_Education employee_Education)
        {
            var obj = db.Employee_Education.Find(id);

            obj.Employee_Education_DegreeName    = employee_Education.Employee_Education_DegreeName;
            obj.Employee_Education_DegreeYear    = employee_Education.Employee_Education_DegreeYear;
            obj.Employee_Education_ObtainedMarks = employee_Education.Employee_Education_ObtainedMarks;
            obj.Employee_Education_Percentage    = employee_Education.Employee_Education_Percentage;
            obj.Employee_Education_TotalMarks    = employee_Education.Employee_Education_TotalMarks;
            obj.Employee_Education_University    = employee_Education.Employee_Education_University;
            db.Entry(obj).State = EntityState.Modified;
            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!Employee_EducationExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Ejemplo n.º 2
0
        public IHttpActionResult PostEmployee_Education(Employee_Education employee_Education)
        {
            employee_Education.Employee_id = db.Employee.Max(m => m.Employee_id);
            db.Employee_Education.Add(employee_Education);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = employee_Education.Employee_Education_id }, employee_Education));
        }
Ejemplo n.º 3
0
        public IHttpActionResult GetEmployee_Education(int id)
        {
            Employee_Education employee_Education = db.Employee_Education.Find(id);

            if (employee_Education == null)
            {
                return(NotFound());
            }

            return(Ok(employee_Education));
        }
Ejemplo n.º 4
0
        public IHttpActionResult DeleteEmployee_Education(int id)
        {
            Employee_Education employee_Education = db.Employee_Education.Find(id);

            if (employee_Education == null)
            {
                return(NotFound());
            }

            db.Employee_Education.Remove(employee_Education);
            db.SaveChanges();

            return(Ok(employee_Education));
        }