日期:2014-05-20 浏览次数:20808 次
//用戶在某個窗體的權限列表。key為功能項名,如按鈕名稱。value為權限類型 Hashtable hash = ttaad431mgr.GetHashtableByID(str_usid, this.Name); bool auth_AddNew = false; if (hash.Contains("btnAddNew")) { int int_AddNew = (int)hash["btnAddNew"]; if (int_AddNew == (int)Common.PermisionFuntEnum.Permit) { auth_AddNew = true; } } //IsEdit 是否編輯狀態 btnAddNew.Enabled = IsEdit ? false : auth_AddNew;
int auth_nama = (int)Common.PermisionFildEnum.Reject; if (hash.Contains("nama")) { auth_nama = (int)hash["nama"]; } labnama.Tag = auth_nama;//標簽保存權限類型,“復制”中使用 if (auth_nama == (int)Common.PermisionFildEnum.ReadOnly) { txtnama.PasswordChar = Convert.ToChar(0); txtnama.Enabled = true; txtnama.ReadOnly = true; } else if (auth_nama == (int)Common.PermisionFildEnum.Reject) { txtnama.PasswordChar = ' '; txtnama.Enabled = false; } else { txtnama.PasswordChar = Convert.ToChar(0); txtnama.Enabled = true; txtnama.ReadOnly = !IsEdit; }