Example #1
0
 public Certificate MapToOrm(DalCertificate entity)
 {
     return(new Certificate
     {
         id = entity.Id,
         checkDate = entity.CheckDate,
         controlName_id = entity.ControlName_id,
         duration = entity.Duration,
         employee_id = entity.Employee_id,
         title = entity.Title
     });
 }
Example #2
0
        public DalCertificate MapToDal(BllCertificate entity)
        {
            DalCertificate dalEntity = new DalCertificate
            {
                Id             = entity.Id,
                CheckDate      = entity.CheckDate,
                Duration       = entity.Duration,
                Title          = entity.Title,
                ControlName_id = entity.ControlName != null ? entity.ControlName.Id : (int?)null,
                Employee_id    = entity.Employee != null ? entity.Employee.Id : (int?)null,
            };

            return(dalEntity);
        }
Example #3
0
        public LiteCertificate MapDalToLiteBll(DalCertificate entity)
        {
            if (entity != null)
            {
                LiteCertificate bllEntity = new LiteCertificate
                {
                    Id           = entity.Id,
                    CheckDate    = entity.CheckDate,
                    Duration     = entity.Duration,
                    Title        = entity.Title,
                    ControlName  = entity.ControlName_id != null?uow.ControlNames.Get(entity.ControlName_id.Value).Name : null,
                    EmployeeName = entity.Employee_id != null?uow.Employees.Get(entity.Employee_id.Value).Name          : null
                };

                return(bllEntity);
            }
            return(null);
        }
Example #4
0
        public BllCertificate MapToBll(DalCertificate entity)
        {
            if (entity != null)
            {
                BllCertificate bllEntity = new BllCertificate
                {
                    Id          = entity.Id,
                    CheckDate   = entity.CheckDate,
                    Duration    = entity.Duration,
                    Title       = entity.Title,
                    ControlName = entity.ControlName_id != null?controlNameService.Get((int)entity.ControlName_id) : null,
                                      Employee = entity.Employee_id != null?employeeService.Get((int)entity.Employee_id) : null
                };

                return(bllEntity);
            }
            return(null);
        }