Exemplo n.º 1
0
 public List <Employee> CreateEmployee(Employee employee)
 {
     using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
     _context.Add(employee);
     _context.SaveChanges();
     return(_context.Employees.Where(x => x.EmployeeId == _context.Employees.Max(x => x.EmployeeId)).ToList());
 }
Exemplo n.º 2
0
 public List <Student> CreateStudent(Student student)
 {
     using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
     _context.Add(student);
     _context.SaveChanges();
     return(_context.Students.Where(x => x.StudentId == _context.Students.Max(x => x.StudentId)).ToList());
 }
Exemplo n.º 3
0
        public List <Advisory> CreateAdvisory(Advisory advisory)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(advisory);
            _context.SaveChanges();
            return(_context.Advisories.Where(x => x.AdvisoryId == _context.Advisories.Max(x => x.AdvisoryId)).ToList());
        }
Exemplo n.º 4
0
        public List <Vehicle> CreateVehicle(Vehicle vehicle)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(vehicle);
            _context.SaveChanges();
            return(_context.Vehicles.Where(x => x.VehicleId == _context.Vehicles.Max(x => x.VehicleId)).ToList());
        }
Exemplo n.º 5
0
        public List <Department> CreateDepartment(Department department)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(department);
            _context.SaveChanges();
            return(_context.Departments.Where(x => x.DepartmentId == _context.Departments.Max(x => x.DepartmentId)).ToList());
        }
Exemplo n.º 6
0
        public List <Course> CreateCourse(Course course)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(course);
            _context.SaveChanges();
            return(_context.Courses.Where(x => x.CourseId == _context.Courses.Max(x => x.CourseId)).ToList());
        }
Exemplo n.º 7
0
        public List <Tenure> CreateTenure(Tenure tenure)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(tenure);
            _context.SaveChanges();
            return(_context.Tenures.Where(x => x.TenureId == _context.Tenures.Max(x => x.TenureId)).ToList());
        }
Exemplo n.º 8
0
        public List <Section> CreateSection(Section section)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(section);
            _context.SaveChanges();
            return(_context.Sections.Where(x => x.SectionId == _context.Sections.Max(x => x.SectionId)).ToList());
        }
        public List <ReservationForm> CreateReservationForm(ReservationForm reservationForm)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(reservationForm);
            _context.SaveChanges();
            return(_context.ReservationForms.Where(x => x.ReservationFormId == _context.ReservationForms.Max(x => x.ReservationFormId)).ToList());
        }
Exemplo n.º 10
0
        public List <ProfessorContract> CreateProfessorContract(ProfessorContract professorContract)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(professorContract);
            _context.SaveChanges();
            return(_context.ProfessorContracts.Where(x => x.ProfessorContractId == _context.ProfessorContracts.Max(x => x.ProfessorContractId)).ToList());
        }
Exemplo n.º 11
0
        public List <Professorship> CreateProfessorship(Professorship vehicle)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(vehicle);
            _context.SaveChanges();
            return(_context.Professorships.Where(x => x.ProfessorShipId == _context.Professorships.Max(x => x.ProfessorShipId)).ToList());
        }
Exemplo n.º 12
0
        public List <Report> CreateReport(Report report)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(report);
            _context.SaveChanges();
            return(_context.Reports.Where(x => x.ReportId == _context.Reports.Max(x => x.ReportId)).ToList());
        }
Exemplo n.º 13
0
        public List <School> CreateSchool(School school)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(school);
            _context.SaveChanges();
            return(_context.Schools.Where(x => x.SchoolId == _context.Schools.Max(x => x.SchoolId)).ToList());
        }
Exemplo n.º 14
0
        public List <Enrollment> CreateEnrollment(Enrollment enrollment)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(enrollment);
            _context.SaveChanges();
            return(_context.Enrollments.Where(x => x.EnrollmentId == _context.Enrollments.Max(x => x.EnrollmentId)).ToList());
        }
Exemplo n.º 15
0
        public List <PartUsage> CreatePartUsage(PartUsage partUsage)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(partUsage);
            _context.SaveChanges();
            return(_context.PartUsages.Where(x => x.PartUsageId == _context.PartUsages.Max(x => x.PartUsageId)).ToList());
        }
Exemplo n.º 16
0
        public List <Maintenance> CreateMaintenance(Maintenance maintenance)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);

            _context.Add(maintenance);
            _context.SaveChanges();
            return(_context.Maintenances.Where(x => x.MaintenanceId == _context.Maintenances.Max(x => x.MaintenanceId)).ToList());
        }
Exemplo n.º 17
0
        public List <ProfessorContract> EditProfessorContract(ProfessorContract professorContract)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpProfessorContract = _context.ProfessorContracts.First(x => x.ProfessorContractId == professorContract.ProfessorContractId);

            _context.Entry(tmpProfessorContract).CurrentValues.SetValues(professorContract);
            _context.SaveChanges();
            return(_context.ProfessorContracts.Where(x => x.ProfessorContractId == professorContract.ProfessorContractId).ToList());
        }
Exemplo n.º 18
0
        public List <Professorship> EditProfessorship(Professorship professorship)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpProfessorship = _context.Professorships.First(x => x.ProfessorShipId == professorship.ProfessorShipId);

            _context.Entry(tmpProfessorship).CurrentValues.SetValues(professorship);
            _context.SaveChanges();
            return(_context.Professorships.Where(x => x.ProfessorShipId == professorship.ProfessorShipId).ToList());
        }
Exemplo n.º 19
0
        public List <Maintenance> EditMaintenance(Maintenance maintenance)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpMaintenance = _context.Maintenances.First(x => x.MaintenanceId == maintenance.MaintenanceId);

            _context.Entry(tmpMaintenance).CurrentValues.SetValues(maintenance);
            _context.SaveChanges();
            return(_context.Maintenances.Where(x => x.MaintenanceId == maintenance.MaintenanceId).ToList());
        }
Exemplo n.º 20
0
        public List <Contract> EditContract(Contract contract)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpContract = _context.Contracts.First(x => x.ContractId == contract.ContractId);

            _context.Entry(tmpContract).CurrentValues.SetValues(contract);
            _context.SaveChanges();
            return(_context.Contracts.Where(x => x.ContractId == contract.ContractId).ToList());
        }
Exemplo n.º 21
0
        public List <Section> EditSection(Section section)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpSection = _context.Sections.First(x => x.SectionId == section.SectionId);

            _context.Entry(tmpSection).CurrentValues.SetValues(section);
            _context.SaveChanges();
            return(_context.Sections.Where(x => x.SectionId == section.SectionId).ToList());
        }
Exemplo n.º 22
0
        public List <Vehicle> EditVehicle(Vehicle vehicle)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpVehicle = _context.Vehicles.First(x => x.VehicleId == vehicle.VehicleId);

            _context.Entry(tmpVehicle).CurrentValues.SetValues(vehicle);
            _context.SaveChanges();
            return(_context.Vehicles.Where(x => x.VehicleId == vehicle.VehicleId).ToList());
        }
Exemplo n.º 23
0
        public List <Report> EditReport(Report report)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpReport = _context.Reports.First(x => x.ReportId == report.ReportId);

            _context.Entry(tmpReport).CurrentValues.SetValues(report);
            _context.SaveChanges();
            return(_context.Reports.Where(x => x.ReportId == report.ReportId).ToList());
        }
Exemplo n.º 24
0
        public List <Enrollment> EditEnrollment(Enrollment enrollment)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpEnrollment = _context.Enrollments.First(x => x.EnrollmentId == enrollment.EnrollmentId);

            _context.Entry(tmpEnrollment).CurrentValues.SetValues(enrollment);
            _context.SaveChanges();
            return(_context.Enrollments.Where(x => x.EnrollmentId == enrollment.EnrollmentId).ToList());
        }
Exemplo n.º 25
0
        public List <PartUsage> EditPartUsage(PartUsage partUsage)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpPartUsage = _context.PartUsages.First(x => x.PartUsageId == partUsage.PartUsageId);

            _context.Entry(tmpPartUsage).CurrentValues.SetValues(partUsage);
            _context.SaveChanges();
            return(_context.PartUsages.Where(x => x.PartUsageId == partUsage.PartUsageId).ToList());
        }
Exemplo n.º 26
0
        public List <School> EditSchool(School school)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpSchool = _context.Schools.First(x => x.SchoolId == school.SchoolId);

            _context.Entry(tmpSchool).CurrentValues.SetValues(school);
            _context.SaveChanges();
            return(_context.Schools.Where(x => x.SchoolId == school.SchoolId).ToList());
        }
Exemplo n.º 27
0
        public List <ReservationForm> EditReservationForm(ReservationForm reservationForm)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpReservationForm = _context.ReservationForms.First(x => x.ReservationFormId == reservationForm.ReservationFormId);

            _context.Entry(tmpReservationForm).CurrentValues.SetValues(reservationForm);
            _context.SaveChanges();
            return(_context.ReservationForms.Where(x => x.ReservationFormId == reservationForm.ReservationFormId).ToList());
        }
Exemplo n.º 28
0
        public List <Advisory> EditAdvisory(Advisory advisory)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpAdvisory = _context.Advisories.First(x => x.AdvisoryId == advisory.AdvisoryId);

            _context.Entry(tmpAdvisory).CurrentValues.SetValues(advisory);
            _context.SaveChanges();
            return(_context.Advisories.Where(x => x.AdvisoryId == advisory.AdvisoryId).ToList());
        }
Exemplo n.º 29
0
        public List <Employee> EditEmployee(Employee employee)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpEmployee = _context.Employees.First(x => x.EmployeeId == employee.EmployeeId);

            _context.Entry(tmpEmployee).CurrentValues.SetValues(employee);
            _context.SaveChanges();
            return(_context.Employees.Where(x => x.EmployeeId == employee.EmployeeId).ToList());
        }
Exemplo n.º 30
0
        public List <Tenure> EditTenure(Tenure tenure)
        {
            using TinyCollegeContext _context = new TinyCollegeContext(_builder.Options);
            var tmpTenure = _context.Tenures.First(x => x.TenureId == tenure.TenureId);

            _context.Entry(tmpTenure).CurrentValues.SetValues(tenure);
            _context.SaveChanges();
            return(_context.Tenures.Where(x => x.TenureId == tenure.TenureId).ToList());
        }