Пример #1
0
        public virtual SecUserRoleDomain CreateSecUserRoleDomain()
        {
            SecUserRoleEntity entity = new SecUserRoleEntity();
            entity.RoleId = Guid.NewGuid().ToString();

            return new SecUserRoleDomain(entity);
        }
Пример #2
0
 public virtual void UpdateSecUserRoleEntity(SecUserRoleEntity entity, DataAccessBroker broker)
 {
     DataAccess.Update(entity, broker);
 }
Пример #3
0
 public virtual void InsertSecUserRoleEntity(SecUserRoleEntity entity, DataAccessBroker broker)
 {
     DataAccess.Insert(entity, broker);
 }
Пример #4
0
        /// <summary>
        /// 保存按钮,先删除,后插入
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSave_Click(Object sender, EventArgs e)
        {
            List<SecUserRoleEntity> DeleteRowInfo = new List<SecUserRoleEntity>();
            List<SecUserRoleEntity> InsertRowInfo = new List<SecUserRoleEntity>();
            List<string> listIds = GetUserIds();
            //Add by Claire.Yang on 2012/08/02
            if (PageGrid != null && PageGrid.Count > 0)
            {
                foreach (string strOldId in listIds)
                {
                    SecUserRoleEntity SecUserRoleEntity = new SecUserRoleEntity();
                    SecUserRoleEntity.UserId = strOldId;
                    SecUserRoleEntity.RoleId = RoleID;

                    DeleteRowInfo.Add(SecUserRoleEntity);
                }
                foreach (string strNewId in PageGrid)
                {
                    SecUserRoleEntity SecUserRoleEntity = new SecUserRoleEntity();

                    SecUserRoleEntity.UserId = strNewId;
                    SecUserRoleEntity.RoleId = RoleID;

                    SecUserRoleEntity.LastModifiedBy = CurrentUser.SecUserEntity.UserId;
                    SecUserRoleEntity.LastModifiedTime = DateTime.Now;
                    InsertRowInfo.Add(SecUserRoleEntity);
                }
            }
            //for (int i = 0; i < dexGrid.Rows.Count; i++)
            //{
            //    SecUserRoleEntity SecUserRoleEntity = new SecUserRoleEntity();
            //    SecUserRoleEntity.UserId = dexGrid.DataKeys[i].Values[SecUserRoleTable.C_USER_ID].ToString();
            //    SecUserRoleEntity.RoleId = RoleID;
            //    DeleteRowInfo.Add(SecUserRoleEntity);
            //}
            //for (int i = 0; i < dexGrid.Rows.Count; i++)
            //{
            //    SecUserRoleEntity SecUserRoleEntity = new SecUserRoleEntity();
            //    CheckBox ck = dexGrid.Rows[i].Cells[0].Controls[0] as CheckBox;
            //    if (ck.Checked)
            //    {
            //        SecUserRoleEntity.UserId = dexGrid.DataKeys[i].Values[SecUserRoleTable.C_USER_ID].ToString();
            //        SecUserRoleEntity.RoleId = RoleID;
            //        SecUserRoleEntity.LastModifiedBy = CurrentUser.SecUserEntity.UserId;
            //        SecUserRoleEntity.LastModifiedTime = DateTime.Now;
            //        InsertRowInfo.Add(SecUserRoleEntity);
            //    }
            //}
            bool boolResult = SystemService.FunctionRoleService.SaveFunctionRoleUserDomain(DeleteRowInfo, InsertRowInfo);
            if (boolResult)
            {
                base.AlertAndClose(GetMessage("MESSAGE_SUCCESS"));
            }
            else
            {
                AlertMessage(GetMessage("MESSAGE_FAILURE"));
            }
        }
Пример #5
0
 public SecUserRoleDomain(SecUserRoleEntity entity)
     : base(entity)
 {
     masterEntity = entity;
 }