Пример #1
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      = ""
                };
            }
        }
Пример #2
0
 public PersonVM()
 {
     SexSelector = PlainFacadeItemFactory <Person> .GetBySex();
 }