Exemplo n.º 1
0
        public SaveResult UpdateFacility(Facility facility)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Facilities.Attach(facility);

            db.ObjectStateManager.ChangeObjectState(facility, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating Facility";
            }

            return result;
        }
Exemplo n.º 2
0
        public SaveResult UpdateOrganization(Organization organization)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Organizations.Attach(organization);

            db.ObjectStateManager.ChangeObjectState(organization, System.Data.EntityState.Modified);

            if (SaveChanges())
            {
                BuildHostCache(true);
            }
            else
            {
                result.WasSuccessful = false;
                result.Message = "Error updating Organization";
            }

            return result;
        }
Exemplo n.º 3
0
        public SaveResult UpdateCourt(Court court)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Courts.Attach(court);

            db.ObjectStateManager.ChangeObjectState(court, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating Court";
            }

            return result;
        }
Exemplo n.º 4
0
        public SaveResult UpdateEventLevel(EventLevel eventLevel)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.EventLevels.Attach(eventLevel);

            db.ObjectStateManager.ChangeObjectState(eventLevel, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating EventLevel";
            }

            return result;
        }
Exemplo n.º 5
0
        public SaveResult UpdateUserOrganization(UserOrganization uo)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.UserOrganizations.Attach(uo);

            db.ObjectStateManager.ChangeObjectState(uo, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating UserOrganization";
            }

            return result;
        }
Exemplo n.º 6
0
        public SaveResult DeleteCourt(Court court)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Courts.DeleteObject(court);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting Court";
            }

            return result;
        }
Exemplo n.º 7
0
        public SaveResult DeleteStringing(Stringing stringing)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Stringings.DeleteObject(stringing);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting Stringing";
            }

            return result;
        }
Exemplo n.º 8
0
        public SaveResult UpdateStringing(Stringing stringing)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Stringings.Attach(stringing);

            db.ObjectStateManager.ChangeObjectState(stringing, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating Stringing";
            }

            return result;
        }
Exemplo n.º 9
0
        public SaveResult DeleteOrganizationProgram(OrganizationProgram op)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.OrganizationPrograms.DeleteObject(op);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting OrganizationProgram";
            }

            return result;
        }
Exemplo n.º 10
0
        public SaveResult DeleteSchedule(Schedule schedule)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Schedules.DeleteObject(schedule);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting Schedule";
            }

            return result;
        }
Exemplo n.º 11
0
        public SaveResult DeleteOrganization(Organization organization)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Organizations.DeleteObject(organization);

            if (SaveChanges())
            {
                BuildHostCache(true);
            }
            else
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting Organization";
            }

            return result;
        }
Exemplo n.º 12
0
        public SaveResult DeleteFacility(Facility facility)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Facilities.DeleteObject(facility);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting Facility";
            }

            return result;
        }
Exemplo n.º 13
0
        public SaveResult DeleteEventLevel(EventLevel eventLevel)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.EventLevels.DeleteObject(eventLevel);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting EventLevel";
            }

            return result;
        }
Exemplo n.º 14
0
        public SaveResult UpdateOrganizationProgram(OrganizationProgram op)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.OrganizationPrograms.Attach(op);

            db.ObjectStateManager.ChangeObjectState(op, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating OrganizationProgram";
            }

            return result;
        }
Exemplo n.º 15
0
        public SaveResult DeleteUserNote(UserNote note)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.UserNotes.DeleteObject(note);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting UserNote";
            }

            return result;
        }
Exemplo n.º 16
0
        public SaveResult UpdateSchedule(Schedule schedule)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.Schedules.Attach(schedule);

            db.ObjectStateManager.ChangeObjectState(schedule, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating Schedule";
            }

            return result;
        }
Exemplo n.º 17
0
        public SaveResult DeleteUserOrganization(UserOrganization uo)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.UserOrganizations.DeleteObject(uo);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting UserOrganization";
            }

            return result;
        }
Exemplo n.º 18
0
        public SaveResult UpdateUserNote(UserNote note)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.UserNotes.Attach(note);

            db.ObjectStateManager.ChangeObjectState(note, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating UserNote";
            }

            return result;
        }
Exemplo n.º 19
0
        public SaveResult UpdateAmenity(OrganizationAmenity amenity)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.OrganizationAmenities.Attach(amenity);

            db.ObjectStateManager.ChangeObjectState(amenity, System.Data.EntityState.Modified);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error updating Amenity";
            }

            return result;
        }
Exemplo n.º 20
0
        public override bool ChangePassword(string username, string oldPassword, string newPassword)
        {
            SaveResult result = new SaveResult();

            User user = DataService.GetUser(username);
            if (user != null && user.Password == oldPassword)
            {
                user.Password = newPassword;
                result = DataService.UpdateUser(user);
            }

            return result.WasSuccessful;
        }
Exemplo n.º 21
0
        public SaveResult DeleteAmenity(OrganizationAmenity amenity)
        {
            SaveResult result = new SaveResult { WasSuccessful = true };

            db.OrganizationAmenities.DeleteObject(amenity);

            if (!SaveChanges())
            {
                result.WasSuccessful = false;
                result.Message = "Error deleting Amenity";
            }

            return result;
        }