Пример #1
0
        private FormAuthCollection GetAuthCollection(BaseMdiChildForm form)
        {
            if (this.FormAuthCollection != null && this.FormAuthCollection.Changed == false)
            {
                return(this.FormAuthCollection);
            }
            //
            // 로그인 유저의 화면별 권한정보
            //
            this.FormAuthCollection = form.AuthCollection;

            DataTable dt = CommonDao.GetInstance().AuthInfoSelect();

            List <FormAuthInfo> authInfoList = new List <FormAuthInfo>();

            foreach (DataRow row in dt.Rows)
            {
                FormAuthInfo authInfo = new FormAuthInfo(
                    viewId: row["VIEW_ID"].ToString(),
                    authKind: row["AUTH_KIND"].ToString(),
                    value: row["AUTH_YN"].ToString() == "Y" ? true : false);
                authInfoList.Add(authInfo);
            }
            authInfoList = authInfoList.FindAll(view => view.ViewId == form.Name);

            this.FormAuthCollection         = new FormAuthCollection(authInfoList);
            this.FormAuthCollection.Changed = false;

            return(this.FormAuthCollection);
        }
Пример #2
0
        public void OpenForm(string assemblyName, string typeName, string text)
        {
            foreach (Form openForm in this.MdiChildren)
            {
                if (openForm.GetType().FullName == typeName)
                {
                    openForm.Activate();
                    return;
                }
            }
            BaseMdiChildForm form = AssemblyUtil.CreateInstance <BaseMdiChildForm>(assemblyName, typeName);

            form.AuthCollection = GetAuthCollection(form);
            form.MdiParent      = this;
            form.Icon           = Properties.Resources.program;
            form.Text           = " " + text;
            form.BringToFront();
            form.Show();
        }