Пример #1
0
        protected override object GetEditObject()
        {
            //this.ValidateInput();
            if (_facade == null)
            {
                _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
            }
            UserEx userEx = this._facade.CreateNewUserEx();

            userEx.UserName       = FormatHelper.CleanString(this.txtUserNameEdit.Text, 40);
            userEx.UserTelephone  = FormatHelper.CleanString(this.txtUserTelephoneEdit.Text, 40);
            userEx.UserEmail      = FormatHelper.CleanString(this.txtUserEmailEdit.Text, 100);
            userEx.UserDepartment = FormatHelper.CleanString(this.drpDepartmentEdit.SelectedValue, 40);
            userEx.UserCode       = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtUserCodeEdit.Text, 40));
            userEx.MaintainUser   = this.GetUserCode();

            if (this.cmdSave.Disabled == true)                  //add
            {
                userEx.UserPassword = FormatHelper.CleanString(this.txtUserPasswordEdit.Text, 60);
            }
            else                //update
            {
                userEx.UserPassword = FormatHelper.CleanString(this.txtPasswordCache.Text);
            }


            userEx.user2OrgList = GetUser2OrgList(this.SelectableTextboxOrg.Tag, userEx.UserCode);

            return(userEx);
        }
Пример #2
0
 /// <summary>
 /// 创建人:
 /// 创建日期:
 /// 用途:
 /// 修改人:   Angel Zhu
 /// 修改日期: 2004/04/28
 /// 修改原因: 对用户的密码进行MD5加密后,存入数据库.
 /// </summary>
 /// <param name="domainObject"></param>
 protected override void AddDomainObject(object domainObject)
 {
     ((UserEx)domainObject).UserPassword = EncryptionHelper.MD5Encryption(((UserEx)domainObject).UserPassword.Trim().ToUpper());
     if (_facade == null)
     {
         _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
     }
     this._facade.AddUserEx((UserEx)domainObject);
     //维护新增用户时将用户状态置为N,第一次登陆时提示更改密码  joe
     ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.OpenConnection();
     DataProvider.BeginTransaction();
     try
     {
         string newuser = "******" + txtUserCodeEdit.Text.Trim().ToUpper() + "'";
         ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.Execute(newuser);
         DataProvider.CommitTransaction();
     }
     catch
     {
         DataProvider.RollbackTransaction();
     }
     finally
     {
         ((BenQGuru.eMES.Common.DomainDataProvider.SQLDomainDataProvider)DataProvider).PersistBroker.CloseConnection();
     }
 }
Пример #3
0
 protected override void UpdateDomainObject(object domainObject)
 {
     if (_facade == null)
     {
         _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
     }
     this._facade.UpdateUserGroup((UserGroup)domainObject);
 }
Пример #4
0
 protected override void DeleteDomainObjects(ArrayList domainObjects)
 {
     if (_facade == null)
     {
         _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
     }
     this._facade.DeleteUserEx((UserEx[])domainObjects.ToArray(typeof(UserEx)));
 }
Пример #5
0
 protected override void AddDomainObject(object domainObject)
 {
     if (_facade == null)
     {
         _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
     }
     this._facade.AddUSERGROUP2ITEM((USERGROUP2ITEM)domainObject);
 }
Пример #6
0
 protected override void DeleteDomainObjects(ArrayList domainObjects)
 {
     if (_facade == null)
     {
         _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
     }
     //this.DeleteDefaultPageRight(domainObjects);
     this._facade.DeleteUserGroup((UserGroup[])domainObjects.ToArray(typeof(UserGroup)));
 }
Пример #7
0
 protected override void AddDomainObject(object domainObject)
 {
     if (_facade == null)
     {
         _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
     }
     this._facade.AddUserGroup((UserGroup)domainObject);
     //this.AddDefaultPageRight();
 }
Пример #8
0
 protected override int GetRowCount()
 {
     if (_facade == null)
     {
         _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
     }
     return(this._facade.QueryUserGroupCount(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtUserGroupCodeQuery.Text))));
 }
Пример #9
0
 protected override object[] LoadDataSource(int inclusive, int exclusive)
 {
     if (_facade == null)
     {
         _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
     }
     return(this._facade.QueryUserGroup(
                FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtUserGroupCodeQuery.Text)),
                inclusive, exclusive));
 }
Пример #10
0
        protected override object GetEditObject(GridRecord row)
        {
            if (_facade == null)
            {
                _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
            }
            object obj = _facade.GetUserGroup(row.Items.FindItemByKey("UserGroupCode").Text.ToString());

            if (obj != null)
            {
                return((UserGroup)obj);
            }

            return(null);
        }
Пример #11
0
        protected override object GetEditObject(Infragistics.WebUI.UltraWebGrid.UltraGridRow row)
        {
            if (_facade == null)
            {
                _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
            }
            object obj = _facade.GetUSERGROUP2ITEM(row.Cells[1].Text.ToString(), row.Cells[2].Text.ToString());

            if (obj != null)
            {
                return((USERGROUP2ITEM)obj);
            }

            return(null);
        }
Пример #12
0
        protected override object GetEditObject()
        {
            //this.ValidateInput();

            if (_facade == null)
            {
                _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
            }
            UserGroup userGroup = this._facade.CreateNewUserGroup();

            userGroup.UserGroupDescription = FormatHelper.CleanString(this.txtUserGroupDescriptionEdit.Text, 100);
            userGroup.UserGroupCode        = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtUserGroupCodeEdit.Text, 40));
            userGroup.UserGroupType        = FormatHelper.CleanString(this.drpUserGroupTypeEdit.SelectedValue, 40);
            userGroup.MaintainUser         = this.GetUserCode();

            return(userGroup);
        }
Пример #13
0
        protected override object GetEditObject()
        {
            //this.ValidateInput();

            if (_facade == null)
            {
                _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
            }
            USERGROUP2ITEM userGroup = this._facade.CreateNewUSERGROUP2ITEM();

            userGroup.EATTRIBUTE1   = FormatHelper.CleanString(this.txtUserGroupDescriptionEdit.Text, 100);
            userGroup.USERGROUPCODE = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtUserGroupCodeQuery.Text, 40));
            userGroup.ITEMCODE      = FormatHelper.CleanString(this.citemtype.Text, 40);
            userGroup.MDATE         = FormatHelper.TODateInt(DateTime.Now);
            userGroup.MTIME         = FormatHelper.TOTimeInt(DateTime.Now);
            userGroup.MUSER         = this.GetUserCode();

            return(userGroup);
        }
Пример #14
0
        private User2Org[] GetUser2OrgList(string orgIDList, string userCode)
        {
            orgIDList = orgIDList.Trim();

            int defaultOrgID = -1;

            if (orgIDList.Length > 0)
            {
                defaultOrgID = int.Parse(orgIDList.Substring(1, orgIDList.IndexOf(")") - 1).Trim());
                orgIDList    = orgIDList.Substring(orgIDList.IndexOf(")") + 1).Trim();
            }

            string[] orgIDs = orgIDList.Split(new char[] { ',' });

            User2Org[] user2OrgList = null;
            if (orgIDs.Length > 0)
            {
                user2OrgList = new User2Org[orgIDs.Length];

                if (_facade == null)
                {
                    _facade = new SystemSettingFacadeFactory(base.DataProvider).CreateUserFacade();
                }

                for (int i = 0; i < orgIDs.Length; i++)
                {
                    User2Org user2Org = _facade.CreateNewUser2Org();
                    user2Org.OrganizationID = int.Parse(orgIDs[i].Trim());
                    user2Org.UserCode       = userCode;
                    user2Org.IsDefaultOrg   = 0;
                    if (defaultOrgID == user2Org.OrganizationID)
                    {
                        user2Org.IsDefaultOrg = 1;
                    }
                    user2Org.MaintainUser = this.GetUserCode();

                    user2OrgList[i] = user2Org;
                }
            }

            return(user2OrgList);
        }