public void BindData(atriumDB.FileContactDataTable dt) { sstMngr = FM.GetSSTMng(); ucAddress1.FM = FM; addressBindingSource.DataMember = FM.DB.Address.TableName; addressBindingSource.DataSource = FM.DB; partyBindingSource.DataSource = dt.DataSet; partyBindingSource.DataMember = "Contact"; filePartyBindingSource.DataSource = dt.DataSet; filePartyBindingSource.DataMember = dt.TableName; ucAddress1.DataSource = addressBindingSource; UIHelper.ComboBoxInit("vcontacttypeparty", contactTypeCodeucMultiDropDown, FM); UIHelper.ComboBoxInit("HearingMethod", mccHearingMethod, FM); UIHelper.ComboBoxInit("HearingMethod", filePartyGridEX.DropDowns["ddHearingMethod"], FM); UIHelper.ComboBoxInit("vcontacttypeparty", filePartyGridEX.DropDowns["ddContactType"], FM); UIHelper.ComboBoxInit("Sex", sexCodeucMultiDropDown, FM); UIHelper.ComboBoxInit("LanguageCode", languageCodeucMultiDropDown, FM); LoadContactIdDataView(); dt.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged); FM.DB.Contact.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged); FM.DB.Address.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged); FM.GetFileContact().OnUpdate += new atLogic.UpdateEventHandler(ucFileParty_OnUpdate); FM.GetPerson().OnUpdate += new atLogic.UpdateEventHandler(ucFileParty_OnUpdate); FM.GetAddress().OnUpdate += new atLogic.UpdateEventHandler(ucFileParty_OnUpdate); }
public override void Save() { if (sstMngr.DB.FileParty.HasErrors) { UIHelper.TableHasErrorsOnSaveMessBox(sstMngr.DB); } else { try { filePartyBindingSource.EndEdit(); partyBindingSource.EndEdit(); addressBindingSource.EndEdit(); atLogic.BusinessProcess bp = FM.GetBP(); bp.AddForUpdate(FM.GetFileContact()); bp.AddForUpdate(FM.GetPerson()); bp.AddForUpdate(FM.GetAddress()); bp.AddForUpdate(FM.EFile); bp.Update(); ApplyBR(true); } catch (Exception x) { throw x; } } }
public void BindFileContactData(atriumDB.FileContactDataTable dt) { UIHelper.ComboBoxInit("ContactType", ucMultiDropDown1, FM); UIHelper.ComboBoxInit("LanguageCode", languageCodeucMultiDropDown, FM); UIHelper.ComboBoxInit("NativeLanguage", ucMultiDDNativeLanguage, FM); ucAddress1.FM = FM; if (FM.GetSSTMng() == null) { cmdEditParticipant.Text = "Edit Contact Info"; NativeLang.Visible = false; ucMultiDDNativeLanguage.Visible = false; chkInterpreter.Visible = false; notesEditBox.Top = 74; notesLabel.Top = 78; fileContactGridEX.RootTable.Columns["isParty"].Visible = false; fileContactGridEX.RootTable.Columns["isPending"].Visible = false; } else fileContactGridEX.RootTable.Columns["isOfficer"].Visible = false; addressBindingSource.DataMember = FM.DB.Address.TableName; addressBindingSource.DataSource = FM.DB; contactBindingSource.DataMember = "Contact"; contactBindingSource.DataSource = dt.DataSet; ucAddress1.DataSource = addressBindingSource; DataView dv = new DataView(dt, "", "", DataViewRowState.ModifiedCurrent | DataViewRowState.Unchanged); fileContactBindingSource.DataSource = dv; fileContactBindingSource.DataMember = ""; UIHelper.ComboBoxInit("ContactType", fileContactGridEX.DropDowns["ddContactType"], FM); //UIHelper.ComboBoxInit("vofficelist", fileContactGridEX.DropDowns["ddOffice"], FM); //UIHelper.ComboBoxInit("vofficelist", fileContactGridEX.DropDowns["ddOfficeCode"], FM); ucOfficeSelectBox1.AtMng = FM.AtMng; dt.ColumnChanged+= new DataColumnChangeEventHandler(dt_ColumnChanged); FM.DB.Contact.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged); FM.DB.Address.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged); FM.GetFileContact().OnUpdate += new atLogic.UpdateEventHandler(ucFileContact_OnUpdate); FM.GetPerson().OnUpdate += new atLogic.UpdateEventHandler(ucFileContact_OnUpdate); FM.GetAddress().OnUpdate += new atLogic.UpdateEventHandler(ucFileContact_OnUpdate); }
public override void ApplySecurity(DataRow dr) { if (FileForm() != null && FileForm().ReadOnly) { return; } atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)dr; UIHelper.EnableControls(filePartyBindingSource, FM.GetFileContact().CanEdit(fcr)); UIHelper.EnableControls(partyBindingSource, FM.GetPerson().CanEdit(CurrentRowParty())); if (!CurrentRowParty().IsAddressCurrentIDNull() && CurrentRowAddress() != null) { UIHelper.EnableControls(addressBindingSource, FM.GetAddress().CanEdit(CurrentRowAddress())); } UIHelper.EnableCommandBarCommand(cmdDelete, FM.GetFileContact().CanDelete(fcr)); }
public override void ApplySecurity(DataRow dr) { if (FileForm() != null && FileForm().ReadOnly) return; atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)dr; UIHelper.EnableControls(fileContactBindingSource, FM.GetFileContact().CanEdit(fcr)); UIHelper.EnableControls(filePartyBindingSource, FM.GetFileContact().CanEdit(fcr)); UIHelper.EnableControls(contactBindingSource, FM.GetPerson().CanEdit(CurrentRowContact())); if (!CurrentRowContact().IsAddressCurrentIDNull() && CurrentRowAddress() != null) UIHelper.EnableControls(addressBindingSource, FM.GetAddress().CanEdit(CurrentRowAddress())); bool canDelFP = true; if (FM.GetSSTMng() != null) { canDelFP = FM.GetSSTMng().GetFileParty().CanDelete(CurrentRowFP()); } bool canDelete= FM.GetFileContact().CanDelete(fcr) && ( CurrentRowFP()==null || CurrentRowFP().FileContactId!=CurrentRow().FileContactid || canDelFP ); bool canOverride = FM.AtMng.SecurityManager.CanOverride(FM.CurrentFileId, atSecurity.SecurityManager.Features.FileContact) == atSecurity.SecurityManager.ExPermissions.Yes; UIHelper.EnableCommandBarCommand(tsDelete, canDelete && (fcr.ContactType != "FTM" || canOverride)); if (canOverride) { ucMultiDropDown1.ReadOnly = false; } else { ucMultiDropDown1.ReadOnly = true; } bool isReadOnly = FM.AtMng.SecurityManager.CanExecute(0, atSecurity.SecurityManager.Features.Atrium) == atSecurity.SecurityManager.ExPermissions.No; if(isReadOnly) { tsConvertToOfficer.Enabled = Janus.Windows.UI.InheritableBoolean.False; cmdEditParticipant.Enabled = Janus.Windows.UI.InheritableBoolean.False; } }
public override void Delete() { try { if (UIHelper.ConfirmDelete()) { CurrentRow().Delete(); filePartyBindingSource.EndEdit(); atLogic.BusinessProcess bp = FM.GetBP(); bp.AddForUpdate(FM.GetFileContact()); bp.AddForUpdate(FM.EFile); bp.Update(); ApplyBR(true); fFile f = (fFile)this.ParentForm; f.fileToc.LoadTOC(); } } catch (Exception x) { throw x; } }