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 void bindDebtorData(CLAS.DebtorDataTable a) { UIHelper.ComboBoxInit("Sex", ucSexCodeMcc, FM); UIHelper.ComboBoxInit("LanguageCode", ucLanguageCodeMcc, FM); UIHelper.ComboBoxInit("AddressType", ucAddressTypeMcc, FM); UIHelper.ComboBoxInit("AddressSource", ucAddressSourceMcc, FM); UIHelper.ComboBoxInit("Province", addressGridEX.DropDowns["ddProvince"], FM); UIHelper.ComboBoxInit("Country", addressGridEX.DropDowns["ddCountry"], FM); UIHelper.ComboBoxInit("AddressType", addressGridEX.DropDowns["ddAddressType"], FM); this.debtorBindingSource.DataSource = a.DataSet; this.debtorBindingSource.DataMember = a.TableName; DataView dvAKA = new DataView(FM.DB.AKA, "ContactID=" + CurrentRow().ContactId.ToString(), "", DataViewRowState.CurrentRows); this.aKABindingSource.DataSource = dvAKA; DataView dvAddr = new DataView(FM.DB.Address, "ContactID=" + CurrentRow().ContactId.ToString(), "", DataViewRowState.CurrentRows); this.addressBindingSource.DataSource = dvAddr; ucAddress1.FM = FM; ucAddress1.DataSource = addressBindingSource; FM.DB.Address.ColumnChanged += new DataColumnChangeEventHandler(Address_ColumnChanged); a.ColumnChanged += new DataColumnChangeEventHandler(Address_ColumnChanged); FM.GetCLASMng().GetDebtor().OnUpdate += new atLogic.UpdateEventHandler(ucOpponent_OnUpdate); FM.GetAddress().OnUpdate += new atLogic.UpdateEventHandler(ucOpponent_OnUpdate); SelectCurrentAddress(); ValidateLastKnownAddress(CurrentRow()); }
private void displayMemberProfile() { tribunalTabPage.Enabled = true; if (CurrentRow().GetMemberProfileRows().Length == 0) { FM.LeadOfficeMng.GetMemberProfile().Add(CurrentRow()); } if (memberProfileBindingSource.Count > 0) { int pos = memberProfileBindingSource.Find("OfficerId", CurrentRow().OfficerId); memberProfileBindingSource.Position = pos; } //ucAddress if (CurrentRow().IsAddressCurrentIDNull()) { addAddressBtn.Visible = true; addressGroupBox.Visible = false; ucAddress.Visible = false; } else { addAddressBtn.Visible = false; addressGroupBox.Visible = true; ucAddress.Visible = true; if (FM.DB.Address.FindByAddressId(CurrentRow().AddressCurrentID) == null) { FM.GetAddress().LoadByContactId(CurrentRow().OfficerId); } int adrpos = addressBindingSource.Find("AddressId", CurrentRow().AddressCurrentID); addressBindingSource.Position = adrpos; } }
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 override void Save() { if (FM.LeadOfficeMng.DB.Office.HasErrors) { UIHelper.TableHasErrorsOnSaveMessBox(FM.DB); } else { try { this.officeBindingSource.EndEdit(); this.addressBindingSource.EndEdit(); atLogic.BusinessProcess bp = FM.GetBP(); bp.AddForUpdate(FM.LeadOfficeMng.GetOffice()); bp.AddForUpdate(FM.GetAddress()); bp.Update(); ApplyBR(true); fFile f = (fFile)this.ParentForm; f.fileToc.LoadTOC(); } catch (Exception x) { throw x; } } }
public override void ReloadUserControlData() { FM.LeadOfficeMng.GetOffice().PreRefresh(); FM.GetAddress().PreRefresh(); lmDatasets.officeDB.OfficeRow or = FM.LeadOfficeMng.GetOffice().LoadByOfficeFileId(FM.CurrentFile.FileId); FM.GetAddress().Load(or.AddressId); }
private void addressBindingSource_CurrentChanged(object sender, EventArgs e) { atriumDB.AddressRow dr = CurrentRowAddress(); ApplyAddressSecurity(dr); string mask = FM.GetAddress().PhoneMask(CurrentRowAddress()); maskedEditBox1.Mask = mask; maskedEditBox2.Mask = mask; maskedEditBox3.Mask = mask; }
private void addAddressBtn_Click(object sender, EventArgs e) { ucAddress.Visible = true; addressGroupBox.Visible = true; addAddressBtn.Visible = false; atriumDB.AddressRow ar = (atriumDB.AddressRow)FM.GetAddress().Add(CurrentRow()); //CurrentRow().AddressCurrentID = ar.AddressId; //ar.ContactId = CurrentRow().OfficerId; int adrpos = addressBindingSource.Find("AddressId", CurrentRow().AddressCurrentID); addressBindingSource.Position = adrpos; }
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); }
private void btnAddAddress_Click(object sender, EventArgs e) { ucAddress1.Visible = true; btnAddAddress.Visible = false; //UIHelper.EnableControls(addressBindingSource, true); //int contactId= CurrentRow().ContactId; //atriumDB.ContactRow cr = (atriumDB.ContactRow)FM.DB.Contact.Select("ContactId=" + contactId.ToString())[0]; // FM.GetAddress().Load(); atriumDB.AddressRow ar = (atriumDB.AddressRow)FM.GetAddress().Add(CurrentRowContact()); int adrpos = addressBindingSource.Find("AddressId", CurrentRowContact().AddressCurrentID); addressBindingSource.Position = adrpos; }
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 Save() { if (FM.LeadOfficeMng.DB.Officer.HasErrors) { UIHelper.TableHasErrorsOnSaveMessBox(FM.LeadOfficeMng.DB); } else { try { int linkId = CurrentRow().OfficerId; officerDelegateGridEX.UpdateData(); officerRoleGridEX.UpdateData(); contactEmailGridEX.UpdateData(); this.officerBindingSource.EndEdit(); this.officerDelegateBindingSource.EndEdit(); this.officerRoleBindingSource.EndEdit(); this.contactEmailBindingSource.EndEdit(); this.memberProfileBindingSource.EndEdit(); addressBindingSource.EndEdit(); atLogic.BusinessProcess bp = FM.GetBP(); bp.AddForUpdate(FM.LeadOfficeMng.GetOfficer()); bp.AddForUpdate(FM.GetAddress()); bp.AddForUpdate(FM.LeadOfficeMng.GetOfficerRole()); bp.AddForUpdate(FM.LeadOfficeMng.GetOfficerDelegate()); bp.AddForUpdate(FM.LeadOfficeMng.GetContactEmail()); bp.AddForUpdate(FM.LeadOfficeMng.GetMemberProfile()); bp.Update(); ApplyBR(true); officerBindingSource.Position = officerBindingSource.Find("OfficerId", linkId); } catch (Exception x) { throw x; } } }
private void DeleteAddress() { try { if (UIHelper.ConfirmDelete()) { CurrentRowAddress().Delete(); addressBindingSource.EndEdit(); atLogic.BusinessProcess bp = FM.GetBP(); bp.AddForUpdate(FM.GetAddress()); bp.Update(); } } catch (Exception x) { throw x; } }
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 void bindOfficeData(lmDatasets.officeDB.OfficeDataTable dt) { ucMultiDropDown1.SetDataBinding(FM.Codes("OfficeList"), ""); ucMultiDropDown2.SetDataBinding(FM.Codes("OfficeType"), ""); ucMultiDropDown3.SetDataBinding(FM.Codes("AppointmentType"), ""); ucMultiDropDown4.SetDataBinding(FM.Codes("CurrencyCode"), ""); UIHelper.ComboBoxInit("Department", mccDepartment, FM); UIHelper.ComboBoxInit(FM.Codes("OfficeList"), mccBranch, FM); UIHelper.ComboBoxInit(FM.Codes("TaxRate"), mccDefaultTaxRate, FM); officeBindingSource.DataSource = dt.DataSet; officeBindingSource.DataMember = dt.TableName; DataView dv; if (CurrentRow().IsAddressIdNull()) { atriumDB.AddressRow addr = (atriumDB.AddressRow)FM.GetAddress().Add(CurrentRow()); dv = new DataView(FM.DB.Address, "AddressId=" + addr.AddressId.ToString(), "", DataViewRowState.CurrentRows); } else { dv = new DataView(FM.DB.Address, "AddressId=" + CurrentRow().AddressId.ToString(), "", DataViewRowState.CurrentRows); } this.addressBindingSource.DataSource = dv; ucAddress1.FM = FM; ucAddress1.DataSource = addressBindingSource; dt.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged); FM.DB.Address.ColumnChanged += new DataColumnChangeEventHandler(dt_ColumnChanged); FM.LeadOfficeMng.GetOffice().OnUpdate += new atLogic.UpdateEventHandler(ucOfficeInfo_OnUpdate); FM.GetAddress().OnUpdate += new atLogic.UpdateEventHandler(ucOfficeInfo_OnUpdate); }
private void fileContactBindingSource_CurrentChanged(object sender, EventArgs e) { try { atriumDB.FileContactRow fcr = CurrentRow(); if (fcr==null|| fcr.IsNull("FileContactid")) return; TogglePartyEditableMode(false); switch (fcr.ContactClass) { case "O": verifyContactType(true, false); UIHelper.ComboBoxInit("ContactTypeFile", ucMultiDropDown1, FM); break; case "P": displayParticipant(); UIHelper.ComboBoxInit("Test", ucMultiDropDown1, FM); //verifyContactType(false, true); break; default: verifyContactType(false,false); UIHelper.ComboBoxInit("ContactType", ucMultiDropDown1, FM); break; } atriumDB.ContactRow pr = CurrentRowContact(); if (pr == null || pr.IsNull("ContactId")) return; contactBindingSource.Position = contactBindingSource.Find("ContactId", fcr.ContactId); if (!CurrentRowContact().IsAddressCurrentIDNull() && (CurrentRow().IsPositionCodeNull() || CurrentRow().PositionCode !="TM")) { atriumDB.AddressRow adr = FM.DB.Address.FindByAddressId(CurrentRowContact().AddressCurrentID); if (adr == null) FM.GetAddress().Load(CurrentRowContact().AddressCurrentID); addressBindingSource.Filter = ""; addressBindingSource.Position = addressBindingSource.Find("AddressId", CurrentRowContact().AddressCurrentID.ToString()); ucAddress1.Visible = true; btnAddAddress.Visible = false; } else { //addressBindingSource.Filter = "contactid=0"; if(fcr.ContactClass=="P" || fcr.ContactClass=="B") btnAddAddress.Visible = true; else btnAddAddress.Visible = false; ucAddress1.Visible = false; } if (!CurrentRow().IsPositionCodeNull() && CurrentRow().PositionCode == "TM") { btnAddAddress.Visible = false; ucAddress1.Visible = false; } ApplySecurity(fcr); } catch (Exception x) { UIHelper.HandleUIException(x); } }