void IMeetingScheduler.CreateMeeting(String Desc, DateTime StartTime, DateTime EndTime, int priority , List <int> userIds, bool avRequired, bool phoneRequired , bool videoRequired, int prefLocation, int calledByUser , string myPhoneBridge, string myPhoneAccess , DateTime WindowStart, DateTime WindowEnd, int Duration) { int currentid; using (ManagementSystemDataContext dataContext = new ManagementSystemDataContext(_connectionString)) { Meeting_MasterDto meetingMasterDto = new Meeting_MasterDto { MeetingDesc = Desc, MeetingStartTime = StartTime, MeetingEndTime = EndTime, MeetingPriority = priority, IsAVRequired = avRequired, IsPhoneRequired = phoneRequired, IsVideoConfRequired = videoRequired, PreferredLocationId = prefLocation, ActualLocationId = prefLocation, MeetingCalledBy = calledByUser, PhoneBridge = myPhoneBridge, PhoneBridgeAccessCode = myPhoneAccess, MeetingWindowStart = WindowStart, MeetingWindowEnd = WindowEnd, MeetingDuration = Duration }; dataContext.Meeting_MasterDtos.InsertOnSubmit(meetingMasterDto); dataContext.SubmitChanges(); currentid = meetingMasterDto.MeetingId; List <Meeting_ResponseDto> meetingResponses = new List <Meeting_ResponseDto>(); foreach (int usr in userIds) { Meeting_ResponseDto meetingResponseDto = new Meeting_ResponseDto { MeetingId = currentid, FKUserId = usr, InvitedOn = DateTime.Now, RespondedOn = null }; meetingResponses.Add(meetingResponseDto); } dataContext.Meeting_ResponseDtos.InsertAllOnSubmit <Meeting_ResponseDto>(meetingResponses); dataContext.SubmitChanges(); } }
void ILocationSaver.RemoveLocation(int locationId) { using (ManagementSystemDataContext datacontext = new ManagementSystemDataContext(_connectionString)) { datacontext.Location_MasterDtos.DeleteAllOnSubmit(datacontext.Location_MasterDtos.Where(c => c.LocationId == locationId)); datacontext.SubmitChanges(); } }
void IMeetingScheduler.RemoveUserBusyTime(int userScheduleIndexId) { using (ManagementSystemDataContext dataContext = new ManagementSystemDataContext(_connectionString)) { dataContext.UserScheduleDtos.DeleteAllOnSubmit(dataContext.UserScheduleDtos.Where(c => c.IndexId == userScheduleIndexId)); dataContext.SubmitChanges(); } }
public void SetCustomSettings(ICustomSetting customSetting) { using (ManagementSystemDataContext dataContext = new ManagementSystemDataContext(_connectionString)) { CustomSettingDto customSettingDto = dataContext.CustomSettingDtos.First(); customSettingDto.ViewDays = customSetting.ViewDays; customSettingDto.WorkDayBegin = customSetting.WorkDayBegin; customSettingDto.WorkDayEnd = customSetting.WorkDayEnd; dataContext.SubmitChanges(); } }
void IMeetingScheduler.ScheduleUserBusyTime(string description, DateTime beginTime, DateTime endTime, int userId) { using (ManagementSystemDataContext dataContext = new ManagementSystemDataContext(_connectionString)) { UserScheduleDto userScheduleDto = new UserScheduleDto { FromTime = beginTime, ToTime = endTime, UserId = userId, ScheduleEntryDescription = description, ScheduleEntryType = 1 }; dataContext.UserScheduleDtos.InsertOnSubmit(userScheduleDto); dataContext.SubmitChanges(); } }
void ILocationSaver.SaveLocation(ILocationMaster location) { using (ManagementSystemDataContext datacontext = new ManagementSystemDataContext(_connectionString)) { if (datacontext.Location_MasterDtos.Any(c => c.LocationId == location.LocationId)) { Location_MasterDto lcm = datacontext.Location_MasterDtos.Single(c => c.LocationId == location.LocationId); lcm.IsAVAvailable = location.IsAvAvailable; lcm.IsPhoneAvailable = location.IsPhoneAvailable; lcm.IsVideoConfAvailable = location.IsVideoConfAvailable; lcm.LocationBuilding = location.LocationBuilding; lcm.LocationCapacity = location.LocationCapacity; lcm.LocationFloor = location.LocationFloor; lcm.LocationName = location.LocationName; lcm.LocationRoom = location.LocationRoom; } else { Location_MasterDto lcm = new Location_MasterDto { IsAVAvailable = location.IsAvAvailable, IsPhoneAvailable = location.IsPhoneAvailable, IsVideoConfAvailable = location.IsVideoConfAvailable, LocationBuilding = location.LocationBuilding, LocationCapacity = location.LocationCapacity, LocationFloor = location.LocationFloor, LocationName = location.LocationName, LocationRoom = location.LocationRoom }; datacontext.Location_MasterDtos.InsertOnSubmit(lcm); } datacontext.SubmitChanges(); } }