Esempio n. 1
0
        protected void Rebirth(object sender, EventArgs e)
        {
            if (Util.SuperVisiorMode)
            {
                if (this.CurrentGrid.SelectedKeys.Count > 0)
                {
                    var objs = DbUtil.LoadObjectsIgnoreStatus(this.CurrentGrid.SelectedKeys.ToArray());

                    foreach (var item in objs)
                    {
                        try
                        {
                            if (item is SCUser)
                            {
                                if (item.Status == SchemaObjectStatus.Normal)
                                {
                                    throw new InvalidOperationException(string.Format("{0} (ID:{1})为正常状态", ((PC.SCUser)item).Name, item.ID));
                                }
                                item.Status = SchemaObjectStatus.Normal;
                                PC.Executors.SCObjectOperations.InstanceWithPermissions.AddUser((SCUser)item, null);
                            }
                        }
                        catch (Exception ex)
                        {
                            this.notice.AddErrorInfo(ex);
                        }
                    }

                    this.InnerRefreshList();
                }
            }
            else
            {
                this.notice.Text = "需要管理员权限来执行此操作。";
            }
        }