Esempio n. 1
0
        private void BindCards()
        {
            ddType.Items.Clear();
            EntityObject[] mas = BusinessManager.List(DocumentTypeEntity.GetAssignedMetaClassName(), new FilterElementCollection().ToArray());
            foreach (EntityObject eo in mas)
            {
                MetaClass mc = MetaDataWrapper.GetMetaClassByName(eo.Properties["Name"].Value.ToString());
                ddType.Items.Add(new ListItem(CHelper.GetResFileString(mc.FriendlyName), eo.Properties["Name"].Value.ToString()));
            }

            BindTemplates();
        }
Esempio n. 2
0
 public bool Delete(Guid Id)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         DocumentTypeEntity _DocumentTypeEntity = new DocumentTypeEntity(Id);
         if (adapter.FetchEntity(_DocumentTypeEntity))
         {
             adapter.DeleteEntity(_DocumentTypeEntity);
             toReturn = true;
         }
     }
     return toReturn;
 }
Esempio n. 3
0
        private void BindTemplates()
        {
            ddTemplate.Items.Clear();
            ddTemplate.Items.Add(new ListItem(String.Empty, PrimaryKeyId.Empty.ToString()));

            FilterElement           fe  = FilterElement.EqualElement("Name", ddType.SelectedValue);
            FilterElementCollection fec = new FilterElementCollection();

            fec.Add(fe);

            EntityObject[] masTypes = BusinessManager.List(DocumentTypeEntity.GetAssignedMetaClassName(), fec.ToArray());
            if (masTypes.Length > 0)
            {
                FilterElement           fe1  = FilterElement.EqualElement("DocumentTypeId", masTypes[0].PrimaryKeyId.Value);
                FilterElementCollection fec1 = new FilterElementCollection();
                fec1.Add(fe1);
                EntityObject[] mas = BusinessManager.List(DocumentTemplateEntity.GetAssignedMetaClassName(), fec1.ToArray());
                foreach (EntityObject eo in mas)
                {
                    ddTemplate.Items.Add(new ListItem(CHelper.GetResFileString(eo["Name"].ToString()), eo.PrimaryKeyId.Value.ToString()));
                }
            }
        }
Esempio n. 4
0
 public async Task Update(DocumentTypeEntity entity)
 {
     using IDbConnection db = _configuration.GetConnection();
     await db.ExecuteAsync("UpdateDocumentType", entity, commandType : CommandType.StoredProcedure);
 }
Esempio n. 5
0
 public static DocumentType ToModel(this DocumentTypeEntity model) => Mapper.Map <DocumentType>(model);
Esempio n. 6
0
        public DocumentTypeEntity Insert(string TypeCode, string TypeName, string Description, int DisplayType, DateTime CreatedDate, string CreatedBy, DateTime UpdatedDate, string UpdatedBy, bool IsDeleted)
        {
            DocumentTypeEntity _DocumentTypeEntity = new DocumentTypeEntity();
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {

                _DocumentTypeEntity.TypeCode = TypeCode;
                _DocumentTypeEntity.TypeName = TypeName;
                _DocumentTypeEntity.Description = Description;
                _DocumentTypeEntity.DisplayType = DisplayType;
                _DocumentTypeEntity.CreatedDate = CreatedDate;
                _DocumentTypeEntity.CreatedBy = CreatedBy;
                _DocumentTypeEntity.UpdatedDate = UpdatedDate;
                _DocumentTypeEntity.UpdatedBy = UpdatedBy;
                _DocumentTypeEntity.IsDeleted = IsDeleted;
                adapter.SaveEntity(_DocumentTypeEntity, true);
            }
            return _DocumentTypeEntity;
        }
Esempio n. 7
0
 public DocumentTypeEntity Insert(DocumentTypeEntity _DocumentTypeEntity)
 {
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.SaveEntity(_DocumentTypeEntity, true);
     }
     return _DocumentTypeEntity;
 }
Esempio n. 8
0
        public bool Update(Guid Id, string TypeCode, string TypeName, string Description, int DisplayType, DateTime CreatedDate, string CreatedBy, DateTime UpdatedDate, string UpdatedBy, bool IsDeleted)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                DocumentTypeEntity _DocumentTypeEntity = new DocumentTypeEntity(Id);
                if (adapter.FetchEntity(_DocumentTypeEntity))
                {

                    _DocumentTypeEntity.TypeCode = TypeCode;
                    _DocumentTypeEntity.TypeName = TypeName;
                    _DocumentTypeEntity.Description = Description;
                    _DocumentTypeEntity.DisplayType = DisplayType;
                    _DocumentTypeEntity.CreatedDate = CreatedDate;
                    _DocumentTypeEntity.CreatedBy = CreatedBy;
                    _DocumentTypeEntity.UpdatedDate = UpdatedDate;
                    _DocumentTypeEntity.UpdatedBy = UpdatedBy;
                    _DocumentTypeEntity.IsDeleted = IsDeleted;
                    adapter.SaveEntity(_DocumentTypeEntity, true);
                    toReturn = true;
                }
            }
            return toReturn;
        }
Esempio n. 9
0
 public bool Update(DocumentTypeEntity _DocumentTypeEntity, RelationPredicateBucket filter)
 {
     bool toReturn = false;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         adapter.UpdateEntitiesDirectly(_DocumentTypeEntity, filter);
         toReturn = true;
     }
     return toReturn;
 }
Esempio n. 10
0
        public bool Update(DocumentTypeEntity _DocumentTypeEntity)
        {
            bool toReturn = false;
            using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
            {
                RelationPredicateBucket filter = new RelationPredicateBucket();
                IPredicateExpression _PredicateExpression = new PredicateExpression();
                _PredicateExpression.Add(DocumentTypeFields.Id == _DocumentTypeEntity.Id);

                filter.PredicateExpression.Add(_PredicateExpression);

                adapter.UpdateEntitiesDirectly(_DocumentTypeEntity, filter);
                toReturn = true;
            }
            return toReturn;
        }
Esempio n. 11
0
 public DocumentTypeEntity SelectOne(Guid Id)
 {
     DocumentTypeEntity toReturn = null;
     using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
     {
         DocumentTypeEntity _DocumentTypeEntity = new DocumentTypeEntity(Id);
         if (adapter.FetchEntity(_DocumentTypeEntity))
         {
             toReturn = _DocumentTypeEntity;
         }
     }
     return toReturn;
 }