private void officerBindingSource_CurrentChanged(object sender, EventArgs e) { try { officeDB.OfficerRow dr = CurrentRow(); if (dr == null) { return; } if (dr.IsNull("OfficerId")) { return; } if (!myLoadedOfficers.Contains(dr.OfficerId)) { myLoadedOfficers.Add(dr.OfficerId); //load emails and delegates FM.LeadOfficeMng.GetOfficerDelegate().LoadByOfficerId(dr.OfficerId); FM.LeadOfficeMng.GetMemberProfile().Load(dr.OfficerId); //load roles FM.LeadOfficeMng.GetOfficerRole().LoadByOfficerID(dr.OfficerId); FM.LeadOfficeMng.GetContactEmail().LoadByContactId(dr.OfficerId); } if ((dr.IsNull("PositionCode")) || (dr.PositionCode != "TM")) { tribunalTabPage.Enabled = false; } else { displayMemberProfile(); } if (!dr.IsActiveNull()) { pnlDelegateRole.Enabled = true; pnlPersonalFiles.Enabled = true; tsMyFile.Enabled = Janus.Windows.UI.InheritableBoolean.True; } else { pnlDelegateRole.Enabled = false; pnlPersonalFiles.Enabled = false; tsMyFile.Enabled = Janus.Windows.UI.InheritableBoolean.False; } ApplySecurity(dr); } catch (Exception x) { UIHelper.HandleUIException(x); } }
private void fileContactGridEX_FormattingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e) { try { if (fileContactGridEX.CurrentRow != null && e.Row.RowType == Janus.Windows.GridEX.RowType.Record && e.Row.Cells["IsLoaded"].Value == null && e.Row.Cells["ContactId"].Value != null && e.Row.Cells["ContactId"].Value.ToString().Length > 0) { e.Row.BeginEdit(); if (e.Row.Cells["OfficerCode"].Value.ToString().Length > 0) { officeDB.OfficerRow offrow = myfmAB.LeadOfficeMng.GetOfficer().LoadByOfficerCode(e.Row.Cells["OfficerCode"].Value.ToString()); if (!offrow.IsActiveNull() && offrow.Active) { e.Row.Cells["icon"].Value = 2; //active user } else { e.Row.Cells["icon"].Value = 1; //officer - non-user } } else { if (myfmAB.GetFileContact().IsADebtor((int)e.Row.Cells["ContactId"].Value)) // is a debtor { e.Row.Cells["icon"].Value = 3; //debtor } else if (myfmAB.GetFileContact().FileContactCount((int)e.Row.Cells["ContactId"].Value) > 1) // is a shared plain contact { e.Row.Cells["icon"].Value = 4; //person, shared } else { e.Row.Cells["icon"].Value = 0; //contact, standalone - not shared } } e.Row.Cells["IsLoaded"].Value = true; e.Row.EndEdit(); } } catch (Exception x) { UIHelper.HandleUIException(x); } }