public OperationResult<List<Holiday>> GetHolidays(Guid clientUID, HolidayFilter filter)
		{
			using (var databaseService = new RubezhDAL.DataClasses.DbService())
			{
				return databaseService.HolidayTranslator.Get(filter);
			}
		}
		public RubezhAPI.OperationResult<List<Holiday>> GetHolidays(HolidayFilter filter)
		{
			return SafeOperationCall(() =>
			{
				var rubezhService = RubezhServiceFactory.Create(TimeSpan.FromMinutes(10));
				using (rubezhService as IDisposable)
					return rubezhService.GetHolidays(RubezhServiceFactory.UID, filter);
			}, "GetHolidays");
		}
Example #3
0
		public static Holiday GetSingle(Guid? uid)
		{
			if (uid == null)
				return null;
			var filter = new HolidayFilter();
			filter.UIDs.Add(uid.Value);
			var operationResult = ClientManager.RubezhService.GetHolidays(filter);
			return Common.ShowErrorIfExists(operationResult).FirstOrDefault();
		}
Example #4
0
		public static IEnumerable<Holiday> Get(HolidayFilter filter, bool isShowError = true)
		{
			var operationResult = ClientManager.RubezhService.GetHolidays(filter);
			return Common.ShowErrorIfExists(operationResult, isShowError);
		}
		//public OperationResult<IEnumerable<DayIntervalPart>> GetDayIntervalParts(DayIntervalPartFilter filter)
		//{
		//    return SafeOperationCall<OperationResult<IEnumerable<DayIntervalPart>>>(() => RubezhService.GetDayIntervalParts(filter));
		//}
		//public OperationResult SaveDayIntervalPart(DayIntervalPart item, string name)
		//{
		//    return SafeOperationCall(clientUID, () => RubezhService.SaveDayIntervalPart(item, name));
		//}
		//public OperationResult RemoveDayIntervalPart(Guid uid, string name)
		//{
		//    return SafeOperationCall(clientUID, () => RubezhService.RemoveDayIntervalPart(uid, name));
		//}

		public OperationResult<List<Holiday>> GetHolidays(Guid clientUID, HolidayFilter filter)
		{
			return SafeOperationCall(clientUID, () => RubezhService.GetHolidays(clientUID, filter), "GetHolidays");
		}