public IHttpActionResult PutLeaders(decimal id, Leaders leaders)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != leaders.lead_ID)
            {
                return(BadRequest());
            }

            db.Entry(leaders).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LeadersExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutDeanGroup(decimal id, DeanGroup deanGroup)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != deanGroup.group_id)
            {
                return(BadRequest());
            }

            db.Entry(deanGroup).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!DeanGroupExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutGradlesSubjects(decimal id, GradlesSubjects gradlesSubjects)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != gradlesSubjects.student_ID)
            {
                return(BadRequest());
            }

            db.Entry(gradlesSubjects).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GradlesSubjectsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutMembersInProject(MembersInProject membersInProject)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Entry(membersInProject).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                throw;
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
        public IHttpActionResult PutProjects(decimal id, Projects projects)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != projects.project_ID)
            {
                return(BadRequest());
            }

            Projects proj = new Projects()
            {
                project_ID              = projects.project_ID,
                subject_ID              = projects.subject_ID,
                lead_ID                 = projects.lead_ID,
                project_title           = projects.project_title,
                project_students_number = projects.project_students_number
            };

            db.Entry(proj).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ProjectsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
Exemple #6
0
        public IHttpActionResult PutSubjects(decimal id, Subjects subjects)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != subjects.subject_ID)
            {
                return(BadRequest());
            }

            Subjects sub = new Subjects()
            {
                subject_ID   = subjects.subject_ID,
                subject_name = subjects.subject_name,
                lead_ID      = subjects.lead_ID
            };

            db.Entry(sub).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!SubjectsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }