private bool CheckIsEdit(IDataset pDataset) { if (this.m_pEditWorkspace != null) { IWorkspace workspace = pDataset.Workspace; if (workspace.ConnectionProperties.IsEqual(this.m_pEditWorkspace.ConnectionProperties)) { if (workspace.Type != esriWorkspaceType.esriRemoteDatabaseWorkspace) { return(true); } if (workspace is IVersionedWorkspace) { IVersionedObject obj2 = pDataset as IVersionedObject; if (obj2.IsRegisteredAsVersioned) { SysGrants grants = new SysGrants(); return(((AppConfigInfo.UserID.Length == 0) || (AppConfigInfo.UserID.ToLower() == "admin")) || grants.GetStaffAndRolesLayerPri(AppConfigInfo.UserID, 2, pDataset.Name)); } } } } return(false); }
private void btnStartEditing_Click(object sender, EventArgs e) { SysGrants grants = new SysGrants(); bool flag = false; if ((this.m_pTable as IDataset).Workspace.Type == esriWorkspaceType.esriRemoteDatabaseWorkspace) { if (AppConfigInfo.UserID.Length == 0) { flag = true; } else { flag = grants.GetStaffAndRolesLayerPri(AppConfigInfo.UserID, 2, (this.m_pTable as IDataset).Name); } } else { flag = true; } if (flag) { ((this.m_pTable as IDataset).Workspace as IWorkspaceEdit).StartEditing(true); this.dataGrid1.ReadOnly = false; this.btnStartEditing.Enabled = false; this.btnSaveEditing.Enabled = false; this.m_InEditing = true; this.btnStopEditing.Enabled = true; } }