Exemple #1
0
        /// <summary>
        /// Удаляет запись из рабочего пакета
        /// </summary>
        /// <param name="directives"></param>
        /// <param name="directivePackage"></param>
        public void DeleteFromDirectivePackage <T, TV>(IEnumerable <IBaseEntityObject> directives, T directivePackage)
            where T : AbstractDirectivePackage <TV>, new()
            where TV : BaseDirectivePackageRecord, new()
        {
            foreach (IBaseEntityObject directive in directives)
            {
                TV wpRecord = directivePackage.PackageRecords.FirstOrDefault(wpr => wpr.DirectiveId == directive.ItemId &&
                                                                             wpr.PackageItemType == directive.SmartCoreObjectType);
                if (wpRecord == null)
                {
                    wpRecord = _loader.GetObject <TV>(
                        new ICommonFilter[]
                    {
                        new CommonFilter <int>(BaseDirectivePackageRecord.DirectiveIdProperty, directive.ItemId),
                        new CommonFilter <int>(BaseDirectivePackageRecord.PackageItemTypeProperty, directive.SmartCoreObjectType.ItemId),
                        new CommonFilter <int>(BaseDirectivePackageRecord.ParentIdProperty, directivePackage.ItemId)
                    });
                }

                if (wpRecord != null)
                {
                    _casEnvironment.Manipulator.Delete(wpRecord);
                    directivePackage.PackageRecords.Remove(wpRecord);
                }
            }
        }
Exemple #2
0
        public RequestForQuotation GetRequestForQuotation(int requestForQuotationId)
        {
            var result = _loader.GetObject <RequestForQuotation>(requestForQuotationId);

            if (result == null)
            {
                return(null);
            }

            _packageCore.SetParents(result);

            LoadRequestForQuotationItems(result);

            return(result);
        }