Exemplo n.º 1
0
 /// <summary>
 /// Protected constructor
 /// </summary>
 /// <param name="performer"></param>
 /// <param name="startTime"></param>
 /// <param name="transitionLogic"></param>
 protected PerformedStep(ActivityPerformer performer, DateTime?startTime, IFsmTransitionLogic <PerformedStepStatus> transitionLogic)
     : base(PerformedStepStatus.IP, transitionLogic)
 {
     _activities = new HashedSet <Activity>();
     _startTime  = startTime ?? Platform.Time;
     _performer  = performer;
 }
Exemplo n.º 2
0
		public CriteriaJoinWalker(IOuterJoinLoadable persister,CriteriaQueryTranslator translator,
			ISessionFactoryImplementor factory, CriteriaImpl criteria, string rootEntityName,
			IDictionary<string, IFilter> enabledFilters)
			: base(translator.RootSQLAlias, persister, factory, enabledFilters)
		{
			this.translator = translator;

			querySpaces = translator.GetQuerySpaces();

			if (translator.HasProjection)
			{
				resultTypes = translator.ProjectedTypes;

				InitProjection(
					translator.GetSelect(enabledFilters),
					translator.GetWhereCondition(enabledFilters),
					translator.GetOrderBy(),
					translator.GetGroupBy().ToString(),
					LockMode.None
					);
			}
			else
			{
				resultTypes = new IType[] {TypeFactory.ManyToOne(persister.EntityName)};

				InitAll(translator.GetWhereCondition(enabledFilters), translator.GetOrderBy(), LockMode.None);
			}

			userAliasList.Add(criteria.Alias); //root entity comes *last*
			userAliases = ArrayHelper.ToStringArray(userAliasList);
		}
Exemplo n.º 3
0
		static PreprocessingParser()
		{
			operators = new HashedSet<string>();
			operators.Add("<=");
			operators.Add(">=");
			operators.Add("=>");
			operators.Add("=<");
			operators.Add("!=");
			operators.Add("<>");
			operators.Add("!#");
			operators.Add("!~");
			operators.Add("!<");
			operators.Add("!>");
			operators.Add("is not");
			operators.Add("not like");
			operators.Add("not in");
			operators.Add("not between");
			operators.Add("not exists");

			collectionProps = new Dictionary<string, string>();
			collectionProps.Add("elements", "elements");
			collectionProps.Add("indices", "indices");
			collectionProps.Add("size", "size");
			collectionProps.Add("maxindex", "maxIndex");
			collectionProps.Add("minindex", "minIndex");
			collectionProps.Add("maxelement", "maxElement");
			collectionProps.Add("minelement", "minElement");

			collectionProps.Add("index", "index");
		}
Exemplo n.º 4
0
 protected Role()
 {
     CreationDate            = DateTime.Now;
     permissionDistributions = new HashedSet <PermissionDistribution>();
     users         = new HashedSet <User>();
     IsSystemAdmin = false;
 }
        public ProductionOrderCustomsDeclaration(string name, DateTime date, decimal importCustomsDutiesSum, decimal exportCustomsDutiesSum, decimal valueAddedTaxSum,
                                                 decimal exciseSum, decimal customsFeesSum, decimal customsValueCorrection)
        {
            CreationDate = DateTime.Now;

            ValidationUtils.Assert(!String.IsNullOrEmpty(name), "Название не указано.");
            ValidationUtils.Assert(importCustomsDutiesSum >= 0, "Ввозные таможенные пошлины не могут быть отрицательной величиной.");
            ValidationUtils.Assert(exportCustomsDutiesSum >= 0, "Вывозные таможенные пошлины не могут быть отрицательной величиной.");
            ValidationUtils.Assert(exciseSum >= 0, "Акциз не может быть отрицательной величиной.");
            ValidationUtils.Assert(customsFeesSum >= 0, "Таможенные сборы не могут быть отрицательной величиной.");
            ValidationUtils.Assert(!(importCustomsDutiesSum == 0 && exportCustomsDutiesSum == 0 && valueAddedTaxSum == 0 && exciseSum == 0 && customsFeesSum == 0 &&
                                     customsValueCorrection == 0), "Все суммы не могут быть равны 0.");

            Name      = name;
            this.date = date;
            ImportCustomsDutiesSum = importCustomsDutiesSum;
            ExportCustomsDutiesSum = exportCustomsDutiesSum;
            ValueAddedTaxSum       = valueAddedTaxSum;
            ExciseSum              = exciseSum;
            CustomsFeesSum         = customsFeesSum;
            CustomsValueCorrection = customsValueCorrection;
            Comment = String.Empty;
            CustomsDeclarationNumber = String.Empty;

            payments = new HashedSet <ProductionOrderCustomsDeclarationPayment>();
        }
Exemplo n.º 6
0
        /// <summary>
        /// Конструктор
        /// </summary>
        /// <param name="topic">Тема задачи</param>
        /// <param name="type">Тип задачи</param>
        /// <param name="priority">Приоритет задачи</param>
        /// <param name="state">Стастус задачи</param>
        /// <param name="createdBy">Пользователь, создавший задачу</param>
        public Task(string topic, TaskType type, TaskPriority priority, TaskExecutionState state, DateTime creationDate, User createdBy)
        {
            ValidationUtils.Assert(!String.IsNullOrEmpty(topic), "Необходимо указать тему задачи.");
            ValidationUtils.NotNull(type, "Необходимо указать тип задачи.");
            ValidationUtils.NotNull(priority, "Необходимо указать приоритет задачи.");
            ValidationUtils.NotNull(state, "Необходимо указать статус задачи.");
            ValidationUtils.NotNull(createdBy, "Необходимо указать пользователя, создавшего задачу.");
            ValidationUtils.Assert(type.States.Contains(state), String.Format("Статус исполнения задачи «{0}» не допустим для типа задачи «{1}».", state.Name, type.Name));

            Topic          = topic;
            Type           = type;
            ExecutionState = state;
            Priority       = priority;
            CreatedBy      = createdBy;
            CreationDate   = creationDate;
            Description    = "";

            history          = new HashedSet <TaskHistoryItem>();
            executionHistory = new HashedSet <TaskExecutionItem>();

            // Устанавливаем признак изменения полей (чтобы они все попали как первое изменение задачи в историю)
            isContractorChanged = isDeadLineChanged = isDealChanged = isDeletionDateChanged = isDescriptionChanged = isExecutedByChanged =
                isFactualCompletionDateChanged = isFactualSpentTimeChanged = isFactualStartDateChanged = isPriorityChanged = isProductionOrderChanged =
                    isStartDateChanged         = isTopicChanged = isTypeChanged = true;
        }
Exemplo n.º 7
0
 public Owner()
 {
     _badges           = new HashedSet <Badge>();
     _emailAddresses   = new Dictionary <int, string>();
     _mobilesValues    = new Dictionary <int, string>();
     _registrationDate = DateTime.Now;
 }
Exemplo n.º 8
0
 protected User()
 {
     CreationDate        = DateTime.Now;
     roles               = new HashedSet <Role>();
     teams               = new HashedSet <Team>();
     DisplayNameTemplate = "LF";
 }
Exemplo n.º 9
0
        /// <summary>
        /// Конструктор
        /// </summary>
        /// <param name="task">Задача</param>
        /// <param name="executionState">Статус задачи</param>
        /// <param name="completionPercentage">% выполнения</param>
        /// <param name="createdBy">Пользователь, создавший исполение</param>
        /// <param name="creationDate">Дата создания</param>
        /// <param name="date">Дата исполнения</param>
        public TaskExecutionItem(Task task, TaskType taskType, TaskExecutionState executionState, byte completionPercentage, User createdBy, bool isCreatedByUser, DateTime creationDate, DateTime date)
        {
            ValidationUtils.NotNull(task, "Необходимо указать задачу, к которой относится исполнение.");
            ValidationUtils.NotNull(createdBy, "Необходимо указать пользователя, создавшего исполнение.");
            ValidationUtils.Assert(taskType.States.Contains(executionState), String.Format("Статус исполнения «{0}» не допустим для типа задачи «{1}».", executionState.Name, taskType.Name));

            history           = new HashedSet <TaskExecutionHistoryItem>();
            resultDescription = "";
            spentTime         = 0;

            task.AddExecutionItem(this);    //Добавляем исполнение в задачу

            Task = task;

            this.taskType       = taskType;
            this.executionState = executionState;

            CreatedBy    = createdBy;
            CreationDate = creationDate;

            this.completionPercentage = completionPercentage;

            IsCreatedByUser = isCreatedByUser;
            this.date       = date;

            isDateChanged         = isDeletionDateChanged = isResultDescriptionChanged = isSpentTimeChanged = isCompletionPercentageChanged = isExecutionStateChanged =
                isTaskTypeChanged = true;

            Task.UpdateByLastExecution();
            Task.UpdateTaskExecutionState(this);
            Task.UpdateCompletionPercentage(this);
            Task.FactualSpentTime += spentTime;
        }
Exemplo n.º 10
0
		public NativeSQLQuerySpecification(
			string queryString,
			INativeSQLQueryReturn[] sqlQueryReturns,
			ICollection<string> querySpaces)
		{
			this.queryString = queryString;
			this.sqlQueryReturns = sqlQueryReturns;

			if (querySpaces == null)
			{
				this.querySpaces = new HashedSet<string>();
			}
			else
			{
				Iesi.Collections.Generic.ISet<string> tmp = new HashedSet<string>();
				tmp.AddAll(querySpaces);
				// Can't use ImmutableSet here because it doesn't implement GetHashCode properly.
				this.querySpaces = tmp;
			}

			// pre-determine and cache the hashcode
			int hCode = queryString.GetHashCode();
			unchecked
			{
				hCode = 29 * hCode + CollectionHelper.GetHashCode(this.querySpaces);
				if (this.sqlQueryReturns != null)
				{
					hCode = 29 * hCode + sqlQueryReturns.Length;
				}
			}

			hashCode = hCode;
		}
Exemplo n.º 11
0
		public CriteriaLoader(
			IOuterJoinLoadable persister,
			ISessionFactoryImplementor factory,
			CriteriaImpl rootCriteria,
			string rootEntityName, 
			IDictionary<string, IFilter> enabledFilters)
			: base(factory, enabledFilters)
		{
			translator = new CriteriaQueryTranslator(
				factory,
				rootCriteria,
				rootEntityName,
				CriteriaQueryTranslator.RootSqlAlias);

			querySpaces = translator.GetQuerySpaces();

			CriteriaJoinWalker walker = new CriteriaJoinWalker(
				persister,
				translator,
				factory,
				rootCriteria,
				rootEntityName,
				enabledFilters);

			InitFromWalker(walker);

			userAliases = walker.UserAliases;
			resultTypes = walker.ResultTypes;

			PostInstantiate();
		}
Exemplo n.º 12
0
        /// <summary>
        /// Конструктор типа задачи
        /// </summary>
        /// <param name="name">Тип задачи</param>
        public TaskType(string name)
            : this()
        {
            ValidationUtils.Assert(!String.IsNullOrEmpty(name), "Необходимо указать название типа задачи.");
            Name = name;

            states = new HashedSet <TaskExecutionState>();
        }
Exemplo n.º 13
0
        /// <summary>
        /// Konstruktor
        /// </summary>
        protected Person(string oib, string name)
        {
            Oib = oib;
            Name = name;
            telephones = new HashedSet<Telephone>();

            IsValid();
        }
Exemplo n.º 14
0
 public AccountOrganization(string shortName, string fullName, EconomicAgent economicAgent) :
     base(shortName, fullName, economicAgent, OrganizationType.AccountOrganization)
 {
     storages        = new HashedSet <Storage>();
     contracts       = new HashedSet <Contract>();
     documentNumbers = new HashedSet <AccountOrganizationDocumentNumbers>();
     SalesOwnArticle = false;
 }
Exemplo n.º 15
0
 protected Contractor(string name)
 {
     CreationDate  = DateTime.Now;
     contracts     = new HashedSet <Contract>();
     organizations = new HashedSet <ContractorOrganization>();
     Comment       = String.Empty;
     Rating        = 0;
     Name          = name;
 }
Exemplo n.º 16
0
 private void ClientCreate(PersonalData name, Address lok)
 {
     IdClient       = -1;
     Data           = name;
     Localisation   = lok;
     Regon          = null;
     Nip            = null;
     ListOfDiscount = new HashedSet <Discount>();
 }
Exemplo n.º 17
0
        public ProductionOrderMaterialsPackage(ProductionOrder productionOrder, string name)
        {
            ProductionOrder = productionOrder;
            Name            = name;
            var date = DateTime.Now;

            CreationDate = LastChangeDate = date;
            documents    = new HashedSet <ProductionOrderMaterialsPackageDocument>();
        }
Exemplo n.º 18
0
        public Storage(string name, StorageType type)
        {
            sections             = new HashedSet <StorageSection>();
            accountOrganizations = new HashedSet <AccountOrganization>();
            CreationDate         = DateTime.Now;
            Comment = String.Empty;

            Type = type;
            Name = name;
        }
Exemplo n.º 19
0
        public Team(string name, User createdBy)
        {
            CreationDate     = DateTime.Now;
            users            = new HashedSet <User>();
            storages         = new HashedSet <Storage>();
            deals            = new HashedSet <Deal>();
            productionOrders = new HashedSet <ProductionOrder>();

            Name      = name;
            CreatedBy = createdBy;
        }
Exemplo n.º 20
0
 public Client()
 {
     IdClient       = 1;
     Data           = new PersonalData();
     Localisation   = new Address();
     Regon          = new Regon();
     Nip            = new NIP();
     NumberOfPhone  = new Phone();
     MailToClient   = new Mail();
     ListOfDiscount = new HashedSet <Discount>();
 }
Exemplo n.º 21
0
        public Client(string name, ClientType type, ClientLoyalty loyalty, ClientServiceProgram serviceProgram, ClientRegion region, byte rating) : base(name)
        {
            ContractorType = ContractorType.Client;

            Type           = type;
            Loyalty        = loyalty;
            ServiceProgram = serviceProgram;
            Region         = region;
            Rating         = rating;

            deals = new HashedSet <Deal>();
        }
Exemplo n.º 22
0
        public void TestToSetDuplicates()
        {
            ICollection <int> integers = new int[] { 1, 5, 5, 7 };

            Iesi.Collections.Generic.ISet <int> setIntegers = integers.ToSet();

            Assert.IsNotNull(setIntegers, "Nullability");
            Assert.AreEqual(3, setIntegers.Count, "Count");
            Assert.IsTrue(setIntegers.Contains(1), "Contains 1");
            Assert.IsTrue(setIntegers.Contains(5), "Contains 5");
            Assert.IsTrue(setIntegers.Contains(7), "Contains 7");
        }
Exemplo n.º 23
0
 public Deal(string name, User curator)
 {
     CreationDate = StartDate = StageDate = DateTime.Now;
     stageHistory = new HashedSet<DealStageHistory>();
     quotas = new HashedSet<DealQuota>();
     dealPaymentDocuments = new HashedSet<DealPaymentDocument>();
     Comment = String.Empty;
     Curator = curator;
     
     Name = name;
     PerformStageChanging(DealStage.ClientInvestigation);
 }
Exemplo n.º 24
0
 private void setClanovi(Iesi.Collections.Generic.ISet <GimnasticarUcesnik> gimnasticari)
 {
     dgwUserControlClanovi.setItems <GimnasticarUcesnik>(gimnasticari);
     if (!clanoviSorted)
     {
         dgwUserControlClanovi.sort <GimnasticarUcesnik>(
             new string[] { "Prezime", "Ime" },
             new ListSortDirection[] { ListSortDirection.Ascending, ListSortDirection.Ascending });
         clanoviSorted = true;
     }
     dgwUserControlClanovi.clearSelection();
 }
Exemplo n.º 25
0
        public ArticleGroup(string name, string nameFor1C)
        {
            ValidationUtils.Assert(!String.IsNullOrEmpty(name), "Укажите название группы товаров.");
            ValidationUtils.Assert(!String.IsNullOrEmpty(nameFor1C), "Укажите бухгалтерское название группы товаров.");

            Name          = name;
            NameFor1C     = nameFor1C;
            childs        = new HashedSet <ArticleGroup>();
            Comment       = String.Empty;
            SalaryPercent = 0.0M;
            MarkupPercent = 0.0M;
        }
Exemplo n.º 26
0
        public Producer(string name, string organizationName, byte rating, User curator, bool isManufacturer) : base(name)
        {
            manufacturers = new HashedSet <Manufacturer>();

            ContractorType = ContractorType.Producer;

            Rating  = rating;
            Curator = curator;

            var org = new ProducerOrganization(organizationName, isManufacturer);

            AddContractorOrganization(org);
        }
Exemplo n.º 27
0
        protected internal Contract(AccountOrganization accountOrganization, string name, string number, DateTime date, DateTime startDate)
        {
            CreationDate = DateTime.Now;
            contractors  = new HashedSet <Contractor>();
            Comment      = String.Empty;

            accountOrganization.AddContract(this);

            StartDate = startDate.Date;
            Date      = date.Date;
            Number    = number;
            Name      = name;
        }
Exemplo n.º 28
0
        protected internal Organization(string shortName, string fullName, EconomicAgent economicAgent, OrganizationType type)
        {
            ShortName     = shortName;
            FullName      = fullName;
            EconomicAgent = economicAgent;
            Type          = type;

            Address             = String.Empty;
            Comment             = String.Empty;
            CreationDate        = DateTime.Now;
            russianBankAccounts = new HashedSet <RussianBankAccount>();
            foreignBankAccounts = new HashedSet <ForeignBankAccount>();
        }
Exemplo n.º 29
0
 private void setClanovi(Iesi.Collections.Generic.ISet <GimnasticarUcesnik> gimnasticari)
 {
     getActiveClanoviDataGridViewUserControl()
     .setItems <GimnasticarUcesnik>(gimnasticari);
     if (!clanoviSorted[tabControl1.SelectedIndex])
     {
         getActiveClanoviDataGridViewUserControl().sort <GimnasticarUcesnik>(
             new string[] { "Prezime", "Ime" },
             new ListSortDirection[] { ListSortDirection.Ascending, ListSortDirection.Ascending });
         clanoviSorted[tabControl1.SelectedIndex] = true;
     }
     getActiveClanoviDataGridViewUserControl().clearSelection();
 }
Exemplo n.º 30
0
		public Contract(Plan plan, string customerName, string type)
		{
			if (plan != null)
			{
				plans.Add(plan);
				plan.Contracts.Add(this);
			}
			this.customerName = customerName;
			this.type = type;
			variations = new List<ContractVariation>();
			subcontracts = new HashedSet<Contract>();
			parties = new HashedSet<Party>();
			infos = new HashedSet<Info>();
		}
Exemplo n.º 31
0
        protected BaseWaybill(WaybillType waybillType, string number, DateTime date, User curator, User createdBy, DateTime creationDate)
            : this(waybillType)
        {
            ValidationUtils.NotNull(curator, "Не указан куратор.");

            Number       = number;
            CreationDate = creationDate;
            CreatedBy    = createdBy;
            this.curator = curator;
            Comment      = String.Empty;

            Date = date.Date;

            rows = new HashedSet <BaseWaybillRow>();
        }
        public ProductionOrderTransportSheet(string forwarderName, ProductionOrderCurrencyDeterminationType currencyDeterminationType,
                                             DateTime requestDate, decimal costInCurrency)
        {
            CreationDate = DateTime.Now;

            ValidationUtils.Assert(costInCurrency > 0, "Стоимость транспортного листа не может быть отрицательной или равной нулю.");
            ValidationUtils.Assert(!String.IsNullOrEmpty(forwarderName), "Экспедитор не указан.");

            CostInCurrency = costInCurrency;
            this.currencyDeterminationType = currencyDeterminationType;
            ForwarderName    = forwarderName;
            this.requestDate = requestDate;
            Comment          = String.Empty;

            payments = new HashedSet <ProductionOrderTransportSheetPayment>();
        }
        public ProductionOrderBatchLifeCycleTemplate(string name, ProductionOrderBatchLifeCycleTemplateStage calculationStage,
                                                     ProductionOrderBatchLifeCycleTemplateStage successfullClosingStage, ProductionOrderBatchLifeCycleTemplateStage unsuccessfulClosingStage)
        {
            ValidationUtils.Assert(!String.IsNullOrEmpty(name), "Название шаблона не указано.");
            Name = name;

            ValidationUtils.NotNull(calculationStage, "Не указан один из системных этапов.");
            ValidationUtils.NotNull(successfullClosingStage, "Не указан один из системных этапов.");
            ValidationUtils.NotNull(unsuccessfulClosingStage, "Не указан один из системных этапов.");

            stages = new HashedSet <ProductionOrderBatchLifeCycleTemplateStage>();

            AddStage(calculationStage);
            AddStage(successfullClosingStage);
            AddStage(unsuccessfulClosingStage);
        }
Exemplo n.º 34
0
        public ProductionOrder(string name, Producer producer, Currency currency, ProductionOrderBatchStage calculationStage, ProductionOrderBatchStage successfullClosingStage,
                               ProductionOrderBatchStage unsuccessfulClosingStage, ProductionOrderArticleTransportingPrimeCostCalculationType articleTransportingPrimeCostCalculationType,
                               bool mondayIsWorkDay, bool tuesdayIsWorkDay, bool wednesdayIsWorkDay, bool thursdayIsWorkDay, bool fridayIsWorkDay, bool saturdayIsWorkDay, bool sundayIsWorkDay,
                               User createdBy, DateTime currentDateTime)
        {
            ValidationUtils.Assert(!String.IsNullOrEmpty(name), "Название заказа не указано.");
            Name = name;

            ValidationUtils.NotNull(currency, "Валюта не указана.");
            this.currency     = currency;
            this.currencyRate = null;

            ValidationUtils.NotNull(producer, "Производитель не указан.");
            Producer = producer;

            CreationDate = currentDateTime;
            Date         = currentDateTime.Date;
            CreatedBy    = createdBy;
            Curator      = createdBy;
            ArticleTransportingPrimeCostCalculationType = articleTransportingPrimeCostCalculationType;
            Comment = "";

            batches             = new HashedSet <ProductionOrderBatch>();
            payments            = new HashedSet <ProductionOrderPayment>();
            plannedPayments     = new HashedSet <ProductionOrderPlannedPayment>();
            transportSheets     = new HashedSet <ProductionOrderTransportSheet>();
            extraExpensesSheets = new HashedSet <ProductionOrderExtraExpensesSheet>();
            customsDeclarations = new HashedSet <ProductionOrderCustomsDeclaration>();
            materialsPackages   = new HashedSet <ProductionOrderMaterialsPackage>();

            var batch = new ProductionOrderBatch(calculationStage, successfullClosingStage, unsuccessfulClosingStage, createdBy, currentDateTime);

            AddBatch(batch);

            IsClosed = false;

            MondayIsWorkDay    = mondayIsWorkDay;
            TuesdayIsWorkDay   = tuesdayIsWorkDay;
            WednesdayIsWorkDay = wednesdayIsWorkDay;
            ThursdayIsWorkDay  = thursdayIsWorkDay;
            FridayIsWorkDay    = fridayIsWorkDay;
            SaturdayIsWorkDay  = saturdayIsWorkDay;
            SundayIsWorkDay    = sundayIsWorkDay;
            CheckWorkDaysPlan();
        }
Exemplo n.º 35
0
        public void PostInitialize(Iesi.Collections.Generic.ISet <System.Type> indexedClasses)
        {
            // this method does not requires synchronization
            Type plainClass = rootClassMapping.MappedClass;

            Iesi.Collections.Generic.ISet <Type> tempMappedSubclasses = new HashedSet <System.Type>();

            // together with the caller this creates a o(2), but I think it's still faster than create the up hierarchy for each class
            foreach (Type currentClass in indexedClasses)
            {
                if (plainClass.IsAssignableFrom(currentClass))
                {
                    tempMappedSubclasses.Add(currentClass);
                }
            }

            mappedSubclasses = tempMappedSubclasses;
        }
        public ProductionOrderExtraExpensesSheet(string extraExpensesContractorName, ProductionOrderCurrencyDeterminationType currencyDeterminationType,
                                                 DateTime date, string extraExpensesPurpose, decimal costInCurrency)
        {
            CreationDate = DateTime.Now;

            ValidationUtils.Assert(costInCurrency > 0, "Стоимость листа дополнительных расходов не может быть отрицательной или равной нулю.");
            ValidationUtils.Assert(!String.IsNullOrEmpty(extraExpensesContractorName), "Контрагент не указан.");
            ValidationUtils.Assert(!String.IsNullOrEmpty(extraExpensesPurpose), "Назначение расходов не указано.");

            CostInCurrency = costInCurrency;
            this.currencyDeterminationType = currencyDeterminationType;
            ExtraExpensesContractorName    = extraExpensesContractorName;
            ExtraExpensesPurpose           = extraExpensesPurpose;
            this.date = date;
            Comment   = String.Empty;

            payments = new HashedSet <ProductionOrderExtraExpensesSheetPayment>();
        }
Exemplo n.º 37
0
		protected internal Mappings(
			IDictionary<string, PersistentClass> classes,
			IDictionary<string, Mapping.Collection> collections,
			IDictionary<string, Table> tables,
			IDictionary<string, NamedQueryDefinition> queries,
			IDictionary<string, NamedSQLQueryDefinition> sqlqueries,
			IDictionary<string, ResultSetMappingDefinition> resultSetMappings,
			IDictionary<string, string> imports,
			IList<SecondPassCommand> secondPasses,
			Queue<FilterSecondPassArgs> filtersSecondPasses,
			IList<PropertyReference> propertyReferences,
			INamingStrategy namingStrategy,
			IDictionary<string, TypeDef> typeDefs,
			IDictionary<string, FilterDefinition> filterDefinitions,
			Iesi.Collections.Generic.ISet<ExtendsQueueEntry> extendsQueue,
			IList<IAuxiliaryDatabaseObject> auxiliaryDatabaseObjects,
			IDictionary<string, TableDescription> tableNameBinding,
			IDictionary<Table, ColumnNames> columnNameBindingPerTable,
			string defaultAssembly,
			string defaultNamespace,
			string defaultCatalog,
			string defaultSchema,
			string preferPooledValuesLo,
			Dialect.Dialect dialect)
		{
			this.classes = classes;
			this.collections = collections;
			this.queries = queries;
			this.sqlqueries = sqlqueries;
			this.resultSetMappings = resultSetMappings;
			this.tables = tables;
			this.imports = imports;
			this.secondPasses = secondPasses;
			this.propertyReferences = propertyReferences;
			this.namingStrategy = namingStrategy;
			this.typeDefs = typeDefs;
			this.filterDefinitions = filterDefinitions;
			this.extendsQueue = extendsQueue;
			this.auxiliaryDatabaseObjects = auxiliaryDatabaseObjects;
			this.tableNameBinding = tableNameBinding;
			this.columnNameBindingPerTable = columnNameBindingPerTable;
			this.defaultAssembly = defaultAssembly;
			this.defaultNamespace = defaultNamespace;
			DefaultCatalog = defaultCatalog;
			DefaultSchema = defaultSchema;
			PreferPooledValuesLo = preferPooledValuesLo;
			this.dialect = dialect;
			this.filtersSecondPasses = filtersSecondPasses;
		}
        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="administrationJobsType">vrsta posla uprave</param>
        /// <param name="building">zgrada</param>
        /// <param name="subject">naslov razloga glasovanja</param>
        /// <param name="description">opis razloga glasovanja</param>
        /// <param name="endDateTime">datum i vrijeme zavrsetka glasovanja</param>
        public AdministrationJobsVoting(AdministrationJobsType administrationJobsType, Building building, 
			string subject, string description, DateTime endDateTime)
        {
            this.administrationJobsType = administrationJobsType;
            this.building = building;
            this.subject = subject;
            this.description = description;
            startDateTime = DateTime.Now;
            this.endDateTime = endDateTime;
            numberOfOwners = building.LandRegistry.OwnedPartitionSpaces.Count;
            ownerVotes = new HashedSet<OwnerVote>();
            isFinished = false;
            isAccepted = false;
        }
 public WebContentWidget()
 {
     categories = new HashedSet<WebContentWidgetCategory>();
 }
 public Customer()
 {
     _id = Guid.Empty;
     _orders = new HashedSet<Order>();
 }
Exemplo n.º 41
0
		public User()
		{
			memberships = new HashedSet<Membership>();
		}
Exemplo n.º 42
0
		protected AbstractEntityPersister(PersistentClass persistentClass, ICacheConcurrencyStrategy cache,
		                                  ISessionFactoryImplementor factory)
		{
			this.factory = factory;
			this.cache = cache;
			isLazyPropertiesCacheable = persistentClass.IsLazyPropertiesCacheable;
			cacheEntryStructure = factory.Settings.IsStructuredCacheEntriesEnabled
			                      	? (ICacheEntryStructure) new StructuredCacheEntry(this)
			                      	: (ICacheEntryStructure) new UnstructuredCacheEntry();

			entityMetamodel = new EntityMetamodel(persistentClass, factory);

			if (persistentClass.HasPocoRepresentation)
			{
				//TODO: this is currently specific to pojos, but need to be available for all entity-modes
				foreach (Subclass subclass in persistentClass.SubclassIterator)
				{
					entityNameBySubclass[subclass.MappedClass] = subclass.EntityName;
				}
			}
			int batch = persistentClass.BatchSize;
			if (batch == -1)
				batch = factory.Settings.DefaultBatchFetchSize;

			batchSize = batch;
			hasSubselectLoadableCollections = persistentClass.HasSubselectLoadableCollections;

			propertyMapping = new BasicEntityPropertyMapping(this);

			#region IDENTIFIER

			identifierColumnSpan = persistentClass.Identifier.ColumnSpan;
			rootTableKeyColumnNames = new string[identifierColumnSpan];
			identifierAliases = new string[identifierColumnSpan];

			rowIdName = persistentClass.RootTable.RowId;

			loaderName = persistentClass.LoaderName;

			// TODO NH: Not safe cast to Column
			int i = 0;
			foreach (Column col in persistentClass.Identifier.ColumnIterator)
			{
				rootTableKeyColumnNames[i] = col.GetQuotedName(factory.Dialect);
				identifierAliases[i] = col.GetAlias(factory.Dialect, persistentClass.RootTable);
				i++;
			}

			#endregion

			#region VERSION

			if (persistentClass.IsVersioned)
			{
				foreach (Column col in persistentClass.Version.ColumnIterator)
				{
					versionColumnName = col.GetQuotedName(factory.Dialect);
					break; //only happens once
				}
			}
			else
			{
				versionColumnName = null;
			}

			#endregion

			#region WHERE STRING

			sqlWhereString = !string.IsNullOrEmpty(persistentClass.Where) ? "( " + persistentClass.Where + ") " : null;
			sqlWhereStringTemplate = sqlWhereString == null
			                         	? null
			                         	: Template.RenderWhereStringTemplate(sqlWhereString, factory.Dialect,
			                         	                                     factory.SQLFunctionRegistry);

			#endregion

			#region PROPERTIES

			bool lazyAvailable = IsInstrumented(EntityMode.Poco);

			int hydrateSpan = entityMetamodel.PropertySpan;
			propertyColumnSpans = new int[hydrateSpan];
			propertySubclassNames = new string[hydrateSpan];
			propertyColumnAliases = new string[hydrateSpan][];
			propertyColumnNames = new string[hydrateSpan][];
			propertyColumnFormulaTemplates = new string[hydrateSpan][];
			propertyUniqueness = new bool[hydrateSpan];
			propertySelectable = new bool[hydrateSpan];
			propertyColumnUpdateable = new bool[hydrateSpan][];
			propertyColumnInsertable = new bool[hydrateSpan][];
			ISet thisClassProperties = new HashedSet();

			lazyProperties = new HashedSet<string>();
			List<string> lazyNames = new List<string>();
			List<int> lazyNumbers = new List<int>();
			List<IType> lazyTypes = new List<IType>();
			List<string[]> lazyColAliases = new List<string[]>();

			i = 0;
			bool foundFormula = false;

			foreach (Property prop in persistentClass.PropertyClosureIterator)
			{
				thisClassProperties.Add(prop);

				int span = prop.ColumnSpan;
				propertyColumnSpans[i] = span;
				propertySubclassNames[i] = prop.PersistentClass.EntityName;
				string[] colNames = new string[span];
				string[] colAliases = new string[span];
				string[] templates = new string[span];
				int k = 0;
				foreach (ISelectable thing in prop.ColumnIterator)
				{
					colAliases[k] = thing.GetAlias(factory.Dialect, prop.Value.Table);
					if (thing.IsFormula)
					{
						foundFormula = true;
						templates[k] = thing.GetTemplate(factory.Dialect, factory.SQLFunctionRegistry);
					}
					else
					{
						colNames[k] = thing.GetTemplate(factory.Dialect, factory.SQLFunctionRegistry);
					}
					k++;
				}
				propertyColumnNames[i] = colNames;
				propertyColumnFormulaTemplates[i] = templates;
				propertyColumnAliases[i] = colAliases;

				if (lazyAvailable && prop.IsLazy)
				{
					lazyProperties.Add(prop.Name);
					lazyNames.Add(prop.Name);
					lazyNumbers.Add(i);
					lazyTypes.Add(prop.Value.Type);
					lazyColAliases.Add(colAliases);
				}

				propertyColumnUpdateable[i] = prop.Value.ColumnUpdateability;
				propertyColumnInsertable[i] = prop.Value.ColumnInsertability;

				propertySelectable[i] = prop.IsSelectable;

				propertyUniqueness[i] = prop.Value.IsAlternateUniqueKey;

				i++;
			}
			hasFormulaProperties = foundFormula;
			lazyPropertyColumnAliases = lazyColAliases.ToArray();
			lazyPropertyNames = lazyNames.ToArray();
			lazyPropertyNumbers = lazyNumbers.ToArray();
			lazyPropertyTypes = lazyTypes.ToArray();

			#endregion

			#region SUBCLASS PROPERTY CLOSURE

			List<string> columns = new List<string>();
			List<bool> columnsLazy = new List<bool>();
			List<string> aliases = new List<string>();
			List<string> formulas = new List<string>();
			List<string> formulaAliases = new List<string>();
			List<string> formulaTemplates = new List<string>();
			List<bool> formulasLazy = new List<bool>();
			List<IType> types = new List<IType>();
			List<string> names = new List<string>();
			List<string> classes = new List<string>();
			List<string[]> templates2 = new List<string[]>();
			List<string[]> propColumns = new List<string[]>();
			List<FetchMode> joinedFetchesList = new List<FetchMode>();
			List<CascadeStyle> cascades = new List<CascadeStyle>();
			List<bool> definedBySubclass = new List<bool>();
			List<int[]> propColumnNumbers = new List<int[]>();
			List<int[]> propFormulaNumbers = new List<int[]>();
			List<bool> columnSelectables = new List<bool>();
			List<bool> propNullables = new List<bool>();

			foreach (Property prop in persistentClass.SubclassPropertyClosureIterator)
			{
				names.Add(prop.Name);
				classes.Add(prop.PersistentClass.EntityName);
				bool isDefinedBySubclass = !thisClassProperties.Contains(prop);
				definedBySubclass.Add(isDefinedBySubclass);
				propNullables.Add(prop.IsOptional || isDefinedBySubclass); //TODO: is this completely correct?
				types.Add(prop.Type);

				string[] cols = new string[prop.ColumnSpan];
				string[] forms = new string[prop.ColumnSpan];
				int[] colnos = new int[prop.ColumnSpan];
				int[] formnos = new int[prop.ColumnSpan];
				int l = 0;
				bool lazy = prop.IsLazy && lazyAvailable;
				foreach (ISelectable thing in prop.ColumnIterator)
				{
					if (thing.IsFormula)
					{
						string template = thing.GetTemplate(factory.Dialect, factory.SQLFunctionRegistry);
						formnos[l] = formulaTemplates.Count;
						colnos[l] = -1;
						formulaTemplates.Add(template);
						forms[l] = template;
						formulas.Add(thing.GetText(factory.Dialect));
						formulaAliases.Add(thing.GetAlias(factory.Dialect));
						formulasLazy.Add(lazy);
					}
					else
					{
						string colName = thing.GetTemplate(factory.Dialect, factory.SQLFunctionRegistry);
						colnos[l] = columns.Count; //before add :-)
						formnos[l] = -1;
						columns.Add(colName);
						cols[l] = colName;
						aliases.Add(thing.GetAlias(factory.Dialect, prop.Value.Table));
						columnsLazy.Add(lazy);
						columnSelectables.Add(prop.IsSelectable);
					}
					l++;
				}
				propColumns.Add(cols);
				templates2.Add(forms);
				propColumnNumbers.Add(colnos);
				propFormulaNumbers.Add(formnos);

				joinedFetchesList.Add(prop.Value.FetchMode);
				cascades.Add(prop.CascadeStyle);
			}
			subclassColumnClosure = columns.ToArray();
			subclassColumnAliasClosure = aliases.ToArray();
			subclassColumnLazyClosure = columnsLazy.ToArray();
			subclassColumnSelectableClosure = columnSelectables.ToArray();

			subclassFormulaClosure = formulas.ToArray();
			subclassFormulaTemplateClosure = formulaTemplates.ToArray();
			subclassFormulaAliasClosure = formulaAliases.ToArray();
			subclassFormulaLazyClosure = formulasLazy.ToArray();

			subclassPropertyNameClosure = names.ToArray();
			subclassPropertySubclassNameClosure = classes.ToArray();
			subclassPropertyTypeClosure = types.ToArray();
			subclassPropertyNullabilityClosure = propNullables.ToArray();
			subclassPropertyFormulaTemplateClosure = templates2.ToArray();
			subclassPropertyColumnNameClosure = propColumns.ToArray();
			subclassPropertyColumnNumberClosure = propColumnNumbers.ToArray();
			subclassPropertyFormulaNumberClosure = propFormulaNumbers.ToArray();

			subclassPropertyCascadeStyleClosure = cascades.ToArray();
			subclassPropertyFetchModeClosure = joinedFetchesList.ToArray();

			propertyDefinedOnSubclass = definedBySubclass.ToArray();

			#endregion

			// Handle any filters applied to the class level
			filterHelper = new FilterHelper(persistentClass.FilterMap, factory.Dialect, factory.SQLFunctionRegistry);

			temporaryIdTableName = persistentClass.TemporaryIdTableName;
			temporaryIdTableDDL = persistentClass.TemporaryIdTableDDL;
		}
Exemplo n.º 43
0
		private void InitTransientState()
		{
			loadContexts = null;
			nullAssociations = new HashedSet<AssociationKey>();
			nonlazyCollections = new List<IPersistentCollection>(InitCollectionSize);
		}
Exemplo n.º 44
0
		private void AddChild(FromClause fromClause)
		{
			if (_childFromClauses == null)
			{
				_childFromClauses = new HashedSet<FromClause>();
			}
			_childFromClauses.Add(fromClause);
		}
Exemplo n.º 45
0
        /// <summary>
        /// Konstruktor
        /// </summary>
        /// <param name="username">korisnicko ime</param>
        /// <param name="password">lozinka</param>
        /// <param name="passwordCoder">koder lozinke pomocu kojeg se lozinka kodira</param>
        public User(string username, string password, IPasswordCoder passwordCoder)
        {
            this.userName = username;
            roles = new HashedSet<Role>();

            passwordFormat = passwordCoder.PasswordFormat;

            if(passwordFormat == MembershipPasswordFormat.Hashed) {
                passwordSalt = generatePasswordSalt();
            }

            this.password = Encode(password, passwordCoder);

            CreationDate = DateTime.Now.ToUniversalTime();
        }
Exemplo n.º 46
0
		public Company(){
			this.addresses = new IESI.HashedSet<Address>();
			this.bankAccounts = new IESI.HashedSet<BankAccount>();
		}
Exemplo n.º 47
0
 /// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="legalPerson">pravna osoba</param>
 /// <param name="repairServices">usluge koje obavlja izovdac radova</param>
 public Contractor(LegalPerson legalPerson, ICollection<RepairService> repairServices)
 {
     this.legalPerson = legalPerson;
     this.repairServices = new HashedSet<RepairService>(repairServices);
 }
Exemplo n.º 48
0
 /// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="legalPerson">pravna osoba</param>
 /// <param name="contractors">izvodaci radova</param>
 public BuildingManager(LegalPerson legalPerson, ICollection<Contractor> contractors)
 {
     this.legalPerson = legalPerson;
     this.contractors = new HashedSet<Contractor>(contractors);
 }
Exemplo n.º 49
0
		private static Iesi.Collections.Generic.ISet<EntityKey>[] Transpose(IList<EntityKey[]> keys)
		{
			Iesi.Collections.Generic.ISet<EntityKey>[] result = new Iesi.Collections.Generic.ISet<EntityKey>[keys[0].Length];
			for (int j = 0; j < result.Length; j++)
			{
				result[j] = new HashedSet<EntityKey>();
				for (int i = 0; i < keys.Count; i++)
				{
					EntityKey key = keys[i][j];
					if (key != null)
					{
						result[j].Add(key);
					}
				}
			}
			return result;
		}
Exemplo n.º 50
0
 public Supplier() 
 {
     _products = new HashedSet<Product>();
 }
Exemplo n.º 51
0
			public FilterQueryPlanKey(string query, string collectionRole, bool shallow, IDictionary<string, IFilter> enabledFilters)
			{
				this.query = query;
				this.collectionRole = collectionRole;
				this.shallow = shallow;

				if (enabledFilters == null || (enabledFilters.Count == 0))
				{
					filterNames = new HashedSet<string>();
				}
				else
				{
					filterNames = new HashedSet<string>(enabledFilters.Keys);
				}

				int hash = query.GetHashCode();
				hash = 29 * hash + collectionRole.GetHashCode();
				hash = 29 * hash + (shallow ? 1 : 0);
				hash = 29 * hash + CollectionHelper.GetHashCode(filterNames);
				hashCode = hash;
			}
Exemplo n.º 52
0
 public User()
 {
     _interests = new HashedSet<UserInterest>();
     _conversations = new HashedSet<Conversation>();
     _posts = new HashedSet<Post>();
 }
Exemplo n.º 53
0
 /// <summary>
 /// Konstruktor
 /// </summary>
 /// <param name="building">zgrada</param>
 /// <param name="money">novac</param>
 internal Reserve(Building building, decimal money)
 {
     this.building = building;
     this.money = money;
     reserveBills = new HashedSet<Bill>();
 }
Exemplo n.º 54
0
		public T1()
		{
			this.Children = new HashedSet<T2>();
		}
Exemplo n.º 55
0
 /// <summary>
 /// Konsturktor
 /// </summary>
 /// <param name="cadastralParticle">katastarska cestica</param>
 public LandRegistry(CadastralParticle cadastralParticle)
 {
     this.cadastralParticle = cadastralParticle;
     partitionSpaces = new HashedSet<IPartitionSpace>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FormBuilderWidget"/> class.
 /// </summary>
 public FormBuilderWidget()
 {
     answers = new HashedSet<FormWidgetAnswer>();
 }
Exemplo n.º 57
0
 public ProductCategory() 
 {
     _products = new HashedSet<Product>();
 }
Exemplo n.º 58
0
			internal QueryCacheKey(string query, bool scalar, IDictionary<string, IFilter> enabledFilters)
			{
				_query = query;
				_scalar = scalar;
				if (enabledFilters == null || enabledFilters.Count == 0)
				{
					_filterNames = new HashedSet<string>();
				}
				else
				{
					_filterNames = new HashedSet<string>(enabledFilters.Keys);
				}

				unchecked
				{
					_hashCode = query.GetHashCode();
					_hashCode = 29 * _hashCode + (scalar ? 1 : 0);
					_hashCode = 29 * _hashCode + CollectionHelper.GetHashCode(_filterNames);
				}
			}
Exemplo n.º 59
0
        public void PostInitialize(Iesi.Collections.Generic.ISet<System.Type> indexedClasses)
        {
            // this method does not requires synchronization
            Type plainClass = rootClassMapping.MappedClass;
            Iesi.Collections.Generic.ISet<Type> tempMappedSubclasses = new HashedSet<System.Type>();

            // together with the caller this creates a o(2), but I think it's still faster than create the up hierarchy for each class
            foreach (Type currentClass in indexedClasses)
            {
                if (plainClass.IsAssignableFrom(currentClass))
                {
                    tempMappedSubclasses.Add(currentClass);
                }
            }

            mappedSubclasses = tempMappedSubclasses;
        }
Exemplo n.º 60
0
		/// <summary>
		/// Clear the internal state of the <see cref="Configuration"/> object.
		/// </summary>
		private void Reset()
		{
			classes = new Dictionary<string, PersistentClass>(); //new SequencedHashMap(); - to make NH-369 bug deterministic
			imports = new Dictionary<string, string>();
			collections = new Dictionary<string, NHibernate.Mapping.Collection>();
			tables = new Dictionary<string, Table>();
			namedQueries = new Dictionary<string, NamedQueryDefinition>();
			namedSqlQueries = new Dictionary<string, NamedSQLQueryDefinition>();
			sqlResultSetMappings = new Dictionary<string, ResultSetMappingDefinition>();
			secondPasses = new List<SecondPassCommand>();
			propertyReferences = new List<Mappings.PropertyReference>();
			filterDefinitions = new Dictionary<string, FilterDefinition>();
			interceptor = emptyInterceptor;
			properties = Environment.Properties;
			auxiliaryDatabaseObjects = new List<IAuxiliaryDatabaseObject>();
			sqlFunctions = new Dictionary<string, ISQLFunction>();
			mappingsQueue = new MappingsQueue();
			eventListeners = new EventListeners();
			typeDefs = new Dictionary<string, TypeDef>();
			extendsQueue = new HashedSet<ExtendsQueueEntry>();
			tableNameBinding = new Dictionary<string, Mappings.TableDescription>();
			columnNameBindingPerTable = new Dictionary<Table, Mappings.ColumnNames>();
		}