Exemplo n.º 1
0
        public void TestTransateion()
        {
            SPAdvertisementEntity spAdvertisement = new SPAdvertisementEntity();

            spAdvertisement.UpperID     = null;
            spAdvertisement.Name        = "";
            spAdvertisement.Code        = "";
            spAdvertisement.ImageUrl    = "";
            spAdvertisement.AdPrice     = "";
            spAdvertisement.AccountType = "";
            //obj.ApplyStatus = this.txtApplyStatus.Text.Trim();
            spAdvertisement.AdType      = "";
            spAdvertisement.AdText      = "";
            spAdvertisement.Description = "";
            spAdvertisement.IsDisable   = false;
            //obj.AssignedClient = Convert.ToInt32(this.numAssignedClient.Value.Trim());
            spAdvertisement.CreateBy          = 25;
            spAdvertisement.CreateAt          = System.DateTime.Now;
            spAdvertisement.LastModifyBy      = 25;
            spAdvertisement.LastModifyAt      = System.DateTime.Now;
            spAdvertisement.LastModifyComment = "´´½¨Óû§¡£";


            SelfDataObj.Save(spAdvertisement);



            SelfDataObj.Delete(spAdvertisement);
        }
Exemplo n.º 2
0
        public override void Save(SystemUserEntity obj)
        {
            SystemUserEntity finduser = SelfDataObj.GetUserByLoginID(obj.UserLoginID);

            if (finduser != null)
            {
                throw new DataValidationException(" Login ID ”" + obj.UserLoginID + "“ has exist。");
            }

            base.Save(obj);
        }
        public SystemApplicationEntity FindByCode(string applicationCode)
        {
            List <SystemApplicationEntity> listApplication = SelfDataObj.FindedApplicationsByCode(applicationCode);

            if (listApplication.Count > 0)
            {
                return(listApplication[0]);
            }

            return(null);
        }
Exemplo n.º 4
0
        public void QuickAdd(SPSClientEntity clientEntity, string loginId, string password)
        {
            int spClientuserID = SystemUserWrapper.QuickAddUser(loginId, RoleCodeList.ROLE_CODE_SPDOWNUSER, password, loginId + SystemConfigConst.Config_SysDefaultUsermail);

            if (spClientuserID < 0)
            {
                throw new Exception("Create sPClient failed");
            }
            clientEntity.UserID = spClientuserID;

            SelfDataObj.Save(clientEntity);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 获取用户分配的所有角色
        /// </summary>
        /// <param name="loginID">登陆ID</param>
        /// <returns></returns>
        public List <SystemRoleWrapper> GetUserAssignedRoleByUserLoginId(string loginID)
        {
            if (loginID == SystemUserWrapper.DEV_USER_ID)
            {
                return(SystemRoleWrapper.ConvertToWrapperList(this.DataObjectsContainerIocID.SystemRoleDataObjectInstance.FindAll()));
            }


            SystemUserEntity        user = SelfDataObj.GetUserByLoginID(loginID);
            List <SystemRoleEntity> list = this.DataObjectsContainerIocID.SystemUserRoleRelationDataObjectInstance.GetUserAssignedRoles(user);

            foreach (SystemRoleEntity role in list)
            {
                this.DataObjectsContainerIocID.SystemRoleDataObjectInstance.InitializeLazyProperty(role, SystemRoleEntity.PROPERTY_NAME_ROLEID);
                this.DataObjectsContainerIocID.SystemRoleDataObjectInstance.InitializeLazyProperty(role, SystemRoleEntity.PROPERTY_NAME_ROLENAME);
                this.DataObjectsContainerIocID.SystemRoleDataObjectInstance.InitializeLazyProperty(role, SystemRoleEntity.PROPERTY_NAME_ROLEDESCRIPTION);
                this.DataObjectsContainerIocID.SystemRoleDataObjectInstance.InitializeLazyProperty(role, SystemRoleEntity.PROPERTY_NAME_ROLEISSYSTEMROLE);
            }
            return(SystemRoleWrapper.ConvertToWrapperList(list));
        }
        public SystemApplicationWrapper CreateOrLoadApplication(string configValue)
        {
            List <SystemApplicationEntity> listApplication = SelfDataObj.FindedApplicationsByCode(configValue);

            if (listApplication.Count > 0)
            {
                return(new SystemApplicationWrapper(listApplication[0]));
            }
            else
            {
                var app = new SystemApplicationEntity()
                {
                    SystemApplicationName                = configValue,
                    SystemApplicationDescription         = configValue,
                    SystemApplicationUrl                 = "#",
                    SystemApplicationIsSystemApplication = true
                };
                this.SelfDataObj.Save(app);
                return(new SystemApplicationWrapper(app));
            }
        }
 public List <SPDayReportEntity> QueryReport(DateTime startDate, DateTime endDate)
 {
     return(SelfDataObj.QueryReport(startDate.Date, endDate.Date));
 }
Exemplo n.º 8
0
 public SPSClientEntity GetClientByUserID(int userId)
 {
     return(SelfDataObj.GetClientByUserID(userId));
 }