示例#1
0
        public FacultyResponse DeleteFaculty(int fid)
        {
            FacultyResponse facultyDelete = context.Faculty.FirstOrDefault(p => p.fId == fid);

            if (facultyDelete != null)
            {
                context.Faculty.Remove(facultyDelete);
                context.SaveChanges();
            }
            return(facultyDelete);
        }
示例#2
0
        public void SaveFaculty(FacultyResponse faculty)
        {
            if (faculty.fId == 0)
            {
                context.Faculty.Add(faculty);
            }
            else
            {
                FacultyResponse facultyEntry = context.Faculty
                                               .FirstOrDefault(p => p.fId == faculty.fId);

                if (facultyEntry != null)
                {
                    facultyEntry.fName     = faculty.fName;
                    facultyEntry.fLastName = faculty.fLastName;
                }
            }
            context.SaveChanges();
        }
示例#3
0
 public static void AddFResponse(FacultyResponse FacultyResponses)
 {
     fResponses.Add(FacultyResponses);
 }