Example #1
0
 public static Organisation GetSingle(Guid? uid)
 {
     if (uid == null)
         return null;
     var filter = new OrganisationFilter();
     filter.UIDs.Add((Guid)uid);
     var operationResult = ClientManager.RubezhService.GetOrganisations(filter);
     var result = Common.ThrowErrorIfExists(operationResult);
     if (result != null)
         return result.FirstOrDefault();
     return null;
 }
		public ReportOrganisationsFilterViewModel(bool isWithDeleted = false)
		{
			Organisations = new CheckBoxItemList<ReportFilterOrganisationViewModel>();
			var filter = new OrganisationFilter() { User = ClientManager.CurrentUser };
			if (isWithDeleted)
				filter.LogicalDeletationType = LogicalDeletationType.All;
			var organisations = OrganisationHelper.Get(filter);
			if (organisations != null)
			{
				Organisations = new CheckBoxItemList<ReportFilterOrganisationViewModel>();
				foreach (var organisation in organisations)
				{
					Organisations.Add(new ReportFilterOrganisationViewModel(organisation));
				}
			}
		}
		public NightSettingsViewModel()
		{
			Title = "Настройки ночных интервалов";
			Organisations = new List<FilterOrganisationViewModel>();
			var filter = new OrganisationFilter() { User = ClientManager.CurrentUser };
			var organisations = OrganisationHelper.Get(filter);
			if (organisations != null)
			{
				Organisations = new List<FilterOrganisationViewModel>();
				foreach (var organisation in organisations)
				{
					Organisations.Add(new FilterOrganisationViewModel(organisation));
				}
			}
			NightSettings = new NightSettings();
		}
Example #4
0
		public OperationResult<List<Organisation>> GetOrganisations(Guid clientUID, OrganisationFilter filter)
		{
			return SafeOperationCall(clientUID, () => RubezhService.GetOrganisations(clientUID, filter), "GetOrganisations");
		}
Example #5
0
        public JsonResult GetOrganisationsFilter(bool isWithDeleted)
        {
            var filter = new OrganisationFilter { User = ClientManager.CurrentUser };
            if (isWithDeleted)
            {
                filter.LogicalDeletationType = LogicalDeletationType.All;
            }

            var organisationsResult = OrganisationHelper.Get(filter);

            dynamic result = new
            {
                page = 1,
                total = 100,
                records = 100,
                rows = organisationsResult,
            };

            return Json(result, JsonRequestBehavior.AllowGet);
        }
Example #6
0
		public OperationResult<List<Organisation>> GetOrganisations(OrganisationFilter filter)
		{
			return SafeOperationCall(() =>
			{
				var rubezhService = RubezhServiceFactory.Create(TimeSpan.FromMinutes(10));
				using (rubezhService as IDisposable)
					return rubezhService.GetOrganisations(RubezhServiceFactory.UID, filter);
			}, "GetOrganisations");
		}
        public JsonNetResult GetOrganisations(OrganisationFilter filter)
        {
            var result = OrganisationHelper.Get(new OrganisationFilter { LogicalDeletationType = filter.LogicalDeletationType});

			return new JsonNetResult { Data = result };
        }
Example #8
0
        public JsonNetResult GetOrganisation(Guid? id)
        {
			var filter = new OrganisationFilter();
			filter.UIDs.Add(id.Value);
			var operationResult = OrganisationHelper.Get(filter);
			return new JsonNetResult { Data = operationResult.FirstOrDefault() };
        }
Example #9
0
 public static IEnumerable<Organisation> Get(OrganisationFilter filter)
 {
     var result = ClientManager.RubezhService.GetOrganisations(filter);
     return Common.ThrowErrorIfExists(result);
 }
Example #10
0
		public static IEnumerable<Organisation> Get(OrganisationFilter filter, bool isShowError = true)
		{
			var result = ClientManager.RubezhService.GetOrganisations(filter);
			return Common.ShowErrorIfExists(result, isShowError);
		}
Example #11
0
		public OperationResult<List<Organisation>> GetOrganisations(Guid clientUID, OrganisationFilter filter)
		{
			using (var databaseService = new RubezhDAL.DataClasses.DbService())
			{
				return databaseService.OrganisationTranslator.Get(filter);
			}
		}