public virtual ControlPanelUser Update(BizEntity.Common.ControlPanelUser request)
        {
            ControlPanelUser result;

            TrimProperties(ref request);
            var keyStoneUser = GetKeyStoneUserByLoginName(request.LoginName);

            using (TransactionScope scope = new TransactionScope())
            {
                #region < 查询Keystone中数据,并进行赋值 >
                if (keyStoneUser != null && keyStoneUser.Count == 1)
                {
                    request.SourceDirectory = keyStoneUser[0].SourceDirectory;
                    request.LogicUserId     = keyStoneUser[0].LogicUserId;
                    request.PhysicalUserId  = keyStoneUser[0].PhysicalUserId;
                }
                #endregion

                result = ObjectFactory <IControlPanelUserDA> .Instance.UpdateUser(request);

                result.CompanyCode    = request.CompanyCode;
                result.DepartmentName = request.DepartmentName;
                SynMappingAndSysUser(result);

                scope.Complete();
            }
            return(result);
        }
        public virtual ControlPanelUser Create(BizEntity.Common.ControlPanelUser request)
        {
            ControlPanelUser result;

            TrimProperties(ref request);

            using (TransactionScope scope = new TransactionScope())
            {
                result = ObjectFactory <IControlPanelUserDA> .Instance.CreateUser(request);

                result.CompanyCode    = request.CompanyCode;
                result.DepartmentName = request.DepartmentName;
                SynMappingAndSysUser(result);

                scope.Complete();
            }
            return(result);
        }