예제 #1
0
        public override View BusinessToData(View view, BUSView businessEntity, TContext context, bool NewRecord)
        {
            View dataEntity = base.BusinessToData(view, businessEntity, context, NewRecord);

            dataEntity.BusObjectId = businessEntity.BusObjectId;
            return(dataEntity);
        }
예제 #2
0
        public override UIView BusinessToUI(BUSView businessEntity)
        {
            UIView UIEntity = base.BusinessToUI(businessEntity);

            UIEntity.BusObjectName = businessEntity.BusObjectName;
            return(UIEntity);
        }
예제 #3
0
        public override BUSView DataToBusiness(View dataEntity, TContext context)
        {
            BUSView        businessEntity = base.DataToBusiness(dataEntity, context);
            BusinessObject busObject      = context.BusinessObjects.AsNoTracking().FirstOrDefault(i => i.Id == dataEntity.BusObjectId);

            businessEntity.BusObject = busObject;
            if (busObject != null)
            {
                businessEntity.BusObjectId   = busObject.Id;
                businessEntity.BusObjectName = busObject.Name;
            }
            return(businessEntity);
        }
예제 #4
0
        public override BUSView UIToBusiness(UIView UIEntity, TContext context, IViewInfo viewInfo, bool isNewRecord)
        {
            BUSView        businessEntity = base.UIToBusiness(UIEntity, context, viewInfo, isNewRecord);
            BusinessObject busObject      = context.BusinessObjects.FirstOrDefault(n => n.Name == UIEntity.BusObjectName);

            if (busObject != null)
            {
                businessEntity.BusObject     = busObject;
                businessEntity.BusObjectId   = busObject.Id;
                businessEntity.BusObjectName = busObject.Name;
            }
            return(businessEntity);
        }
예제 #5
0
        public override IEnumerable <ValidationResult> BUSUIValidate(TContext context, BUSView businessComponent, UIView UIEntity)
        {
            List <ValidationResult> result = base.BUSUIValidate(context, businessComponent, UIEntity).ToList();

            if (string.IsNullOrWhiteSpace(businessComponent.ErrorMessage))
            {
                if (businessComponent.BusObject == null)
                {
                    result.Add(new ValidationResult(
                                   "Business object with this name not found",
                                   new List <string>()
                    {
                        "BusObjectName"
                    }));
                }
            }
            return(result);
        }