Beispiel #1
0
		public static Schedule GetSingle(Guid? uid)
		{
			if (uid == null)
				return null;
			var filter = new ScheduleFilter();
			filter.UIDs.Add(uid.Value);
			var operationResult = ClientManager.RubezhService.GetSchedules(filter);
			return Common.ThrowErrorIfExists(operationResult).FirstOrDefault();
		}
		public RubezhAPI.OperationResult<List<Schedule>> GetSchedules(ScheduleFilter filter)
		{
			return SafeOperationCall(() =>
			{
				var rubezhService = RubezhServiceFactory.Create(TimeSpan.FromMinutes(10));
				using (rubezhService as IDisposable)
					return rubezhService.GetSchedules(RubezhServiceFactory.UID, filter);
			}, "GetSchedules");
		}
		//public OperationResult<IEnumerable<ScheduleDayInterval>> GetSheduleDayIntervals(ScheduleDayIntervalFilter filter)
		//{
		//    return SafeOperationCall<OperationResult<IEnumerable<ScheduleDayInterval>>>(() => RubezhService.GetSheduleDayIntervals(filter));
		//}
		//public OperationResult SaveSheduleDayInterval(ScheduleDayInterval item, string name)
		//{
		//    return SafeOperationCall(clientUID, () => RubezhService.SaveSheduleDayInterval(item, name));
		//}
		//public OperationResult RemoveSheduleDayInterval(Guid uid, string name)
		//{
		//    return SafeOperationCall(clientUID, () => RubezhService.RemoveSheduleDayInterval(uid, name));
		//}

		public OperationResult<List<Schedule>> GetSchedules(Guid clientUID, ScheduleFilter filter)
		{
			return SafeOperationCall(clientUID, () => RubezhService.GetSchedules(clientUID, filter), "GetSchedules");
		}
Beispiel #4
0
		public static IEnumerable<Schedule> Get(ScheduleFilter filter)
		{
			var operationResult = ClientManager.RubezhService.GetSchedules(filter);
			return Common.ThrowErrorIfExists(operationResult);
		}
		public OperationResult<List<Schedule>> GetSchedules(Guid clientUID, ScheduleFilter filter)
		{
			using (var databaseService = new RubezhDAL.DataClasses.DbService())
			{
				return databaseService.ScheduleTranslator.Get(filter);
			}
		}