Ejemplo n.º 1
0
        /// <summary>
        /// 设置与传入的视图模型相关的关联元素的集合值
        /// </summary>
        /// <param name="boVM"></param>
        /// <param name="courseID"></param>
        /// <returns></returns>
        public async Task SetTypeItems(CourseItemVM boVM, Guid courseID)
        {
            var boCollection = await _boRepository.GetAllAsyn(y => y.Course.Id == courseID);

            boVM.ParentCourseItemCollection = SelfReferentialItemFactory <CourseItem> .GetCollection(boCollection.OrderBy(x => x.SortCode).ToList(), true);

            boVM.CourseItemCollection = PlainFacadeItemFactory <Course> .Get(_courseRepository);
        }
        /// <summary>
        /// 设置用于前端页面需要的关联数据选项
        /// </summary>
        public void SetRelevanceItems(DepartmentVM boVM)
        {
            boVM.DepartmentTypeItemCollection = PlainFacadeItemFactory <Department> .GetByEnum(boVM.DepartmentType);

            boVM.ParentDepartmentItemCollection = SelfReferentialItemFactory <Department> .GetCollection(_boRepository, true);

            boVM.OrganizationItemCollection = PlainFacadeItemFactory <Organ> .Get(_orgRepository);

            boVM.ApplicationRoleItemCollection = _GetApplicationRoleItemCollection(_roleManager.Roles.ToList());
        }
Ejemplo n.º 3
0
        public JobTitleVM(JobTitle bo)
        {
            this.Id          = bo.Id;
            this.Name        = bo.Name;
            this.Description = bo.Description;
            this.SortCode    = bo.SortCode;

            this.JobTitleType               = bo.JobTitleType;
            this.JobTitleTypeName           = bo.JobTitleType.ToString();
            this.JobTitleTypeItemCollection = PlainFacadeItemFactory <JobTitle> .GetByEnum(bo.JobTitleType);
        }
Ejemplo n.º 4
0
        public SystemWorkTaskVM()
        {
            IsForMeOnlySelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(false);

            IsForMyDepartmentOnlySelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(false);

            IsForDefaultSystemRoleGroupSelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(false);

            IsUsedInMenuSelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(true);

            HasShortCutLinkItemSelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(false);

            HasTileLinkItemSelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(false);
        }
Ejemplo n.º 5
0
        public PersonVM(Person bo)
        {
            ID              = bo.ID;
            Name            = bo.Name;
            Description     = bo.Description;
            SortCode        = bo.SortCode;
            EmployeeCode    = bo.EmployeeCode;
            FirstName       = bo.FirstName;
            LastName        = bo.LastName;
            Sex             = bo.Sex;
            TelephoneNumber = bo.TelephoneNumber;
            MobileNumber    = bo.Mobile;
            Email           = bo.Email;
            CredentialsCode = bo.CredentialsCode;
            Birthday        = bo.Birthday;
            BirthdayString  = bo.Birthday.ToString("yyyy-MM-dd");

            if (Birthday.Year == 1)
            {
                Birthday       = DateTime.Now;
                BirthdayString = Birthday.ToString("yyyy-MM-dd");
            }

            SexString = bo.Sex ? "男" : "女";

            SexSelector = PlainFacadeItemFactory <Person> .GetBySex(bo.Sex);

            if (bo.Department != null)
            {
                ParentItemID = bo.Department.ID.ToString();
                ParentItem   = new SelfReferentialItem
                {
                    ID = bo.Department.ID.ToString(),
                    //ParentID = bo.Department.ParentDepartment.ID.ToString(),
                    DisplayName     = bo.Department.Name,
                    SortCode        = bo.Department.SortCode,
                    OperateFunction = "",
                    TargetType      = "",
                    TipsString      = ""
                };
            }
        }
Ejemplo n.º 6
0
        public JobTitleVM(Guid boId, IEntityRepository <JobTitle> boService)
        {
            var bo = boService.GetSingle(boId);

            if (bo == null)
            {
                bo         = new JobTitle();
                this.IsNew = true;
            }
            else
            {
                this.IsNew = false;
            }

            this.Id          = bo.Id;
            this.Name        = bo.Name;
            this.Description = bo.Description;
            this.SortCode    = bo.SortCode;

            this.JobTitleType               = bo.JobTitleType;
            this.JobTitleTypeName           = bo.JobTitleType.ToString();
            this.JobTitleTypeItemCollection = PlainFacadeItemFactory <JobTitle> .GetByEnum(bo.JobTitleType);
        }
Ejemplo n.º 7
0
        public SystemWorkTaskVM(SystemWorkTask bo)
        {
            ID                          = bo.ID;
            Name                        = bo.Name;
            Description                 = bo.Description;
            SortCode                    = bo.SortCode;
            ControllerName              = bo.ControllerName;
            ControllerMethod            = bo.ControllerMethod;
            ControllerMethodParameter   = bo.ControllerMethodParameter;
            BusinessEntityName          = bo.BusinessEntityName;
            IconName                    = bo.IconName;
            IsForMeOnly                 = bo.IsForMeOnly;
            IsForMyDepartmentOnly       = bo.IsForMyDepartmentOnly;
            IsForDefaultSystemRoleGroup = bo.IsForDefaultSystemRoleGroup;
            IsUsedInMenu                = bo.IsUsedInMenu;
            HasShortCutLinkItem         = bo.HasShortCutLinkItem;
            HasTileLinkItem             = bo.HasTileLinkItem;

            IsForMeOnlyString                 = bo.IsForMeOnly ? "是" : "否";
            IsForMyDepartmentOnlyString       = bo.IsForMyDepartmentOnly ? "是" : "否";
            IsForDefaultSystemRoleGroupString = bo.IsForDefaultSystemRoleGroup ? "是" : "否";
            IsUsedInMenuString                = bo.IsUsedInMenu ? "是" : "否";
            HasShortCutLinkItemString         = bo.HasShortCutLinkItem ? "是" : "否";
            HasTileLinkItemString             = bo.HasTileLinkItem ? "是" : "否";

            IsForMeOnlySelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(bo.IsForMeOnly);

            IsForMyDepartmentOnlySelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(bo.IsForMyDepartmentOnly);

            IsForDefaultSystemRoleGroupSelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(bo.IsForDefaultSystemRoleGroup);

            IsUsedInMenuSelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(bo.IsUsedInMenu);

            HasShortCutLinkItemSelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(bo.HasShortCutLinkItem);

            HasTileLinkItemSelector = PlainFacadeItemFactory <SystemWorkTask> .GetByBool(bo.HasTileLinkItem);
        }
Ejemplo n.º 8
0
        public DepartmentVM(Department bo)
        {
            Id                 = bo.Id;
            Name               = bo.Name;
            Description        = bo.Description;
            BussinessCode      = bo.BussinessCode;
            IsActiveDepartment = bo.IsActiveDepartment;
            if (bo.IsActiveDepartment)
            {
                IsActiveDepartmentString = "是";
            }
            else
            {
                IsActiveDepartmentString = "否";
            }

            if (bo.ParentDepartment != null)
            {
                ParentItemId = bo.ParentDepartment.Id.ToString();
                ParentItem   = SelfReferentialItemFactory <Department> .Get(bo);
            }

            IsActiveDepartmentSelector = PlainFacadeItemFactory <Department> .GetByBool(bo.IsActiveDepartment);
        }
Ejemplo n.º 9
0
 public PersonVM()
 {
     SexSelector = PlainFacadeItemFactory <Person> .GetBySex();
 }
Ejemplo n.º 10
0
 public DepartmentVM()
 {
     IsActiveDepartmentSelector = PlainFacadeItemFactory <Department> .GetByBool();
 }
Ejemplo n.º 11
0
 public void SetItems()
 {
     this.JobTitleTypeItemCollection = PlainFacadeItemFactory <JobTitle> .GetByEnum(this.JobTitleType);
 }
Ejemplo n.º 12
0
        /// <summary>
        /// 设置用于前端页面需要的下拉数据选项
        /// </summary>
        public void SetTypeItems(EmployeeVM boVM)
        {
            boVM.ParentDepartmentItemCollection = SelfReferentialItemFactory <Department> .GetCollection(_departmentRepository, true);

            boVM.JobTitleItemCollection = PlainFacadeItemFactory <JobTitle> .Get(_jobTitleRepository);
        }