示例#1
0
        /// <summary>
        /// Delete review type
        /// </summary>
        /// <param name="item">Review type</param>
        public virtual void DeleteProcuringAgency(ProcuringAgency item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            _itemRepository.Delete(item);
            _cacheManager.RemoveByPattern(GSCatalogDefaults.ProcuringAgencyByPatternKey);

            //event notification
            _eventPublisher.EntityDeleted(item);
        }
示例#2
0
        public ProcuringAgencyModel PrepareProcuringAgencyModel(ProcuringAgencyModel model, ProcuringAgency item, bool excludeProperties = false)
        {
            if (item != null)
            {
                //fill in model values from the entity
                model          = model ?? item.ToModel <ProcuringAgencyModel>();
                model.TypeText = _localizationService.GetLocalizedEnum(item.procuringAgencyType);
            }
            //neu thong tin chu dau tu dang sua la PECC1 thi chi cho phep sua thong tin khac, thong tin loai chu dau tu khong cho sua
            if (model.procuringAgencyType == ProcuringAgencyType.PECC1)
            {
                model.lsType = ((ProcuringAgencyType)model.TypeId).ToSelectList(true, new int[] { 0, (int)ProcuringAgencyType.Main, (int)ProcuringAgencyType.JointVenture });
            }
            else
            {
                model.lsType = ((ProcuringAgencyType)model.TypeId).ToSelectList(true, new int[] { 0, (int)ProcuringAgencyType.PECC1 });
            }

            return(model);
        }