Exemplo n.º 1
0
        protected override void BeforeUpdate(DataRow dr)
        {
            atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)dr;

            // 2014-04-27 JLL
            // There still exists the issue of cleaning up unwanted fileoffice rows that were added in AfterChange, where contactid/contacttype were updated.
            // Some FileOffice records might have been added through AfterChange and should be cleaned up here, before updating.
            // assumption cannot be made that if fileoffice added row does not match up officeid-wise with added contact, that it can be deleted
            // it is possible that a fileoffice row was added without the use of a filecontact new record, meaning it's meant to be there without a filecontact record
            // how do we know the difference between a user changing contactid on filecontact, and a fileoffice record that was created on purpose.


            //if (fcr.IsOfficeIdNull())
            //{
            //    //update person
            //    //make sure it is not a debtor too!
            //    if (!this.IsADebtor(fcr.ContactId) )
            //    {
            //        atriumDB.ContactRow cr = myA.GetPerson().Load(fcr.ContactId);

            //        cr.LastName = fcr.LastName;
            //        cr.FirstName = fcr.FirstName;
            //        if (fcr.IsTelephoneExtensionNull())
            //            cr.SetTelephoneExtensionNull();
            //        else
            //            cr.TelephoneExtension = fcr.TelephoneExtension;

            //        cr.TelephoneNumber = fcr.TelephoneNumber;

            //    }
            //}
        }
Exemplo n.º 2
0
        private void btnAddIssue_Click(object sender, EventArgs e)
        {
            try
            {
                SST.SSTCaseRow sstR = SSTM.DB.SSTCase[0];
                if (SSTM.GetSSTCaseMatter().CanAdd(sstR))
                {
                    lmDatasets.SST.SSTCaseMatterRow SSTMNewRow = (lmDatasets.SST.SSTCaseMatterRow)SSTM.GetSSTCaseMatter().Add(sstR);
                    atriumDB.FileContactRow         FCR        = myFM.GetFileContact().GetByRole("FTM");
                    if (promptIssueMode || promptNoIssueMode || (FCR != null && FM.AtMng.WorkingAsOfficer.ContactId == FCR.ContactId))
                    {
                        SSTMNewRow.ConfirmedByMemberId = FM.AtMng.WorkingAsOfficer.ContactId;
                    }

                    sSTCaseMatterBindingSource.Position = sSTCaseMatterBindingSource.Find("SSTCaseMatterId", SSTMNewRow.SSTCaseMatterId);
                    this.ucIssueSelectBoxRF1.OpenBrowseIssueDialog();
                    OnValidated(new EventArgs());
                }
                SetYesNoButtons();
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
Exemplo n.º 3
0
        protected override void BeforeDelete(DataRow dr)
        {
            atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)dr;

            if (!fcr.HideInToc)
            {
                System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
                xd.InnerXml = fcr.EFileRow.FileStructXml;
                System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@supertype='contact' and @id=" + fcr.FileContactid.ToString() + "]");
                RemoveFileContactFromXML(xe);
                fcr.EFileRow.FileStructXml = xd.InnerXml;
            }

            if (!fcr.IsNull("ContactType") && !fcr.IsNull("ContactId"))
            {
                if (fcr.ContactType == myA.AtMng.GetSetting(AppStringSetting.LeadPLContactType))
                {
                    fcr.EFileRow.SetLeadParalegalIDNull();
                    fcr.EFileRow.EndEdit();
                }
                if (fcr.ContactType == myA.AtMng.GetSetting(AppStringSetting.LeadLawyerContactype))
                {
                    fcr.EFileRow.SetLeadLawyerIDNull();
                    fcr.EFileRow.EndEdit();
                }
            }
        }
Exemplo n.º 4
0
        private void AddUpdateLeadOfficeContact(CLAS.FileHistoryRow fhr)
        {
            OfficeManager om = myA.FM.AtMng.GetOffice(fhr.OfficeId);

            officeDB.OfficerRow[] OfficerRow = (officeDB.OfficerRow[])om.DB.Officer.Select("OfficerCode='" + om.CurrentOffice.OfficeCode + ".REC'", "");
            if (OfficerRow.Length == 0)
            {
                throw new AtriumException("Officer Record for Officer Code: {0}.REC could not be found. Office does not have a proper Reception Officer.  Contact an administrator.", om.CurrentOffice.OfficeCode);
            }
            //verify if FLO contact type exists already
            atriumDB.FileContactRow[] LeadOfficeContact = (atriumDB.FileContactRow[])myA.FM.DB.FileContact.Select("ContactType='FLO'", "");
            if (LeadOfficeContact.Length == 1)
            {
                //found it, need to update it to new office
                LeadOfficeContact[0].StartDate = DateTime.Today;
                LeadOfficeContact[0].ContactId = OfficerRow[0].ContactId;
            }
            else
            {
                //create a new one.  FLO should be set to only onePerFile otherwise this code will run when there is more than one LFO
                atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)myA.FM.GetFileContact().Add(myA.FM.CurrentFile);
                fcr.ContactId   = OfficerRow[0].ContactId;
                fcr.ContactType = "FLO";
            }
        }
Exemplo n.º 5
0
        public override bool CanDelete(DataRow dr)
        {
            bool ok = false;

            atriumDB.FileContactRow ddr = (atriumDB.FileContactRow)dr;

            atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanDelete(ddr.FileId, atSecurity.SecurityManager.Features.FileContact);
            bool canOverride = myA.AtMng.SecurityManager.CanOverride(myA.CurrentFileId, atSecurity.SecurityManager.Features.FileContact) == atSecurity.SecurityManager.ExPermissions.Yes;

            if (perm != atSecurity.SecurityManager.LevelPermissions.No)
            {
                ok = true;
            }

            if (ddr.ContactType == "FLL" || ddr.ContactType == "FLPL")
            {
                if (canOverride)
                {
                    ok = true;
                }
                else
                {
                    ok = false;
                }
            }

            return(ok);
        }
Exemplo n.º 6
0
        protected override void BeforeUpdate(DataRow row)
        {
            base.BeforeUpdate(row);
            atriumDB.ContactRow dr = (atriumDB.ContactRow)row;

            //find the related filecontact record and force an update on it by setting updateDate = DateTime.Now.ToUniversalTime();
            atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)myA.DB.FileContact.Select("ContactId=" + dr.ContactId.ToString())[0];
            if (fcr != null)
            {
                fcr.updateDate = DateTime.Now.ToUniversalTime();
            }
            if (row.RowState != DataRowState.Added && (!row["SIN", DataRowVersion.Original].Equals(row["SIN", DataRowVersion.Current]) || !row["LastName", DataRowVersion.Original].Equals(row["LastName", DataRowVersion.Current]) || !row["FirstName", DataRowVersion.Original].Equals(row["FirstName", DataRowVersion.Current])))
            {
                if (!row.IsNull(myPersonDT.LastNameColumn, DataRowVersion.Original) && !row.IsNull(myPersonDT.FirstNameColumn, DataRowVersion.Original))
                {
                    this.myA.GetAKA();

                    atriumDB.AKARow drAka = this.myA.DB.AKA.NewAKARow();
                    this.myA.DB.AKA.AddAKARow(drAka);
                    drAka.BeginEdit();
                    drAka.LastName  = row["LastName", DataRowVersion.Original].ToString();
                    drAka.FirstName = row["FirstName", DataRowVersion.Original].ToString();
                    drAka.SIN       = row["SIN", DataRowVersion.Original].ToString();
                    drAka.ContactId = (int)row["ContactId"];
                    drAka.EndEdit();
                }
                //this.myA.GetAKA().Update();
                //drAka.AcceptChanges();
            }
        }
Exemplo n.º 7
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            atriumDB.FileContactRow dr = (atriumDB.FileContactRow)ddr;
            switch (dc.ColumnName)
            {
            case "ContactType":
                if (!myA.CheckDomain(dr.ContactType, myA.Codes("ContactType")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Contact Type");
                }

                //if contact type is once per file see if it it on any other records
                bool once = false;
                once = (bool)myA.Codes("ContactType").Select("ContactTypeCode='" + dr.ContactType + "'")[0]["OncePerFile"];
                if (once)
                {
                    foreach (atriumDB.FileContactRow fcr1 in myFileContactDT)
                    {
                        if (!fcr1.IsNull("ContactType") && fcr1.ContactType == dr.ContactType && dr.FileContactid != fcr1.FileContactid)
                        {
                            throw new AtriumException("A contact of type, {0}, already exists on this file.  You cannot add another.", dr.ContactType);
                        }
                    }
                }
                break;

            default:
                break;
            }
        }
Exemplo n.º 8
0
        private void EditReschedule(int NawACSeriesId)
        {
            try
            {
                //check to see if appt has a hearing
                if (CurrentRow() != null)
                {
                    atriumBE.FileManager contextFM = FM.AtMng.GetFile(CurrentRow().FileId);

                    atriumDB.FileContactRow FCR = contextFM.GetFileContact().GetByRole("FTM");
                    bool isTM = false;

                    if (FCR != null)
                    {
                        isTM = (FCR.ContactId == FM.AtMng.WorkingAsOfficer.ContactId);
                    }

                    if (ApptIsHearing() && isTM)
                    {
                        UIHelper.CannotEditAppointment();
                    }
                    else
                    {
                        //Create Step to handle editing Appointment

                        fACWizard facwr;
                        //Launch AcWizard Constructor to Edit Appointment
                        if (!IsOfficerCal)
                        {
                            this.FileForm().ReadOnly = true;
                            GetOriginalRecurrenceAppointment(FM);
                            facwr = new fACWizard(FM, NawACSeriesId, CurrentRow().ApptId);
                            this.FileForm().HookupWizClose(facwr);
                            facwr.Show();
                        }
                        else
                        {
                            atriumBE.FileManager fmCurrent = FM.AtMng.GetFile(CurrentRow().FileId);
                            GetOriginalRecurrenceAppointment(fmCurrent);
                            facwr = new fACWizard(fmCurrent, NawACSeriesId, CurrentRow().ApptId);
                            facwr.ShowDialog();
                            facwr.Close();
                        }
                    }
                }
                else
                {
                    AddNewAppointment(NawACSeriesId);
                }
            }
            catch (Exception x)
            {
                if (this.FileForm() != null)
                {
                    this.FileForm().ReadOnly = false;
                }
                UIHelper.HandleUIException(x);
            }
        }
Exemplo n.º 9
0
        private void DumpParticipants()
        {
            myA.DB.ADMSEParticipant.Clear();
            myA.DB.ADMSEParticipant.AcceptChanges();

            foreach (atriumDB.ContactRow pr in myA.FM.DB.Contact)
            {
                if (pr.ContactClass == "P")
                {
                    SST.ADMSEParticipantRow apr = (SST.ADMSEParticipantRow)myA.GetADMSEParticipant().Add(null);
                    if (!pr.IsFirstNameNull())
                    {
                        apr.FirstName = pr.FirstName;
                    }
                    if (!pr.IsLastNameNull())
                    {
                        apr.LastName = pr.LastName;
                    }
                    //if (!pr.IsPartyTypeCodeNull())
                    //    apr.ParticipantTypeM = pr.PartyTypeCode;
                    apr["SIN"]            = pr["SIN"];
                    apr["BusinessNumber"] = pr["BusinessNumber"];
                    apr["LegalName"]      = pr["LegalName"];
                    apr["OperatingAs"]    = pr["OperatingAs"];

                    if (!pr.IsTelephoneNumberNull())
                    {
                        apr["TelephoneNumber"] = pr["TelephoneNumber"];
                    }
                    apr.LangCdM = pr.LanguageCode;
                    //    apr.AppealSeqId = myA.DB.SSTCase[0].ReconsiderationID;

                    try
                    {
                        atriumDB.FileContactRow fcr = pr.GetFileContactRows()[0];
                        apr.ParticipantTypeM = fcr.ContactType;
                        SST.FilePartyRow fpr = (SST.FilePartyRow)myA.DB.FileParty.Select("FileContactId=" + fcr.FileContactid.ToString())[0];
                        apr.IsAppellant = fpr.IsAppellant;
                    }
                    catch (Exception x)
                    {
                        apr.IsAppellant = false;
                    }

                    if (!pr.IsAddressCurrentIDNull())
                    {
                        atriumDB.AddressRow ar = myA.FM.DB.Address.FindByAddressId(pr.AddressCurrentID);
                        apr["AddressLine1"]  = ar["Address1"];
                        apr["AddressLine2"]  = ar["Address2"];
                        apr["AddressLine3"]  = ar["Address3"];
                        apr["City"]          = ar["City"];
                        apr["ProvinceCodeM"] = ar["ProvinceCode"];
                        apr["PostalCode"]    = ar["PostalCode"];
                        apr["CountryM"]      = ar["CountryCode"];
                    }
                }
            }
        }
Exemplo n.º 10
0
 protected override void AfterUpdate(DataRow dr)
 {
     atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)dr;
     System.Xml.XmlDocument  xd  = new System.Xml.XmlDocument();
     xd.InnerXml = fcr.EFileRow.FileStructXml;
     MyXml(fcr, xd);
     fcr.EFileRow.FileStructXml = xd.InnerXml;
     //myA.EFile.Update();
 }
Exemplo n.º 11
0
        public bool IsAnAtriumUser(atriumDB.FileContactRow fcr)
        {
            if (!fcr.IsContactClassNull() && fcr.ContactClass.ToUpper() == "O")
            {
                //should we dig deeper?  valid user vs officer?
                // it is possible to have contact that are officers that aren't users making the BF to that contacttype go to no one.

                return(true);
            }
            return(false);
        }
Exemplo n.º 12
0
 private void Delete()
 {
     atriumDB.FileContactRow fcr = CurrentRow();
     if (fcr != null)
     {
         if (MessageBox.Show(String.Format(LawMate.Properties.Resources.AreYouSureYouWantToRemoveFromYourAddressBook, fcr.FirstName, fcr.LastName), LawMate.Properties.Resources.RemoveContactFromAddressBook, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.Yes)
         {
             fcr.Delete();
             DoSave();
         }
     }
 }
Exemplo n.º 13
0
        public override bool CanEdit(DataRow dr)
        {
            bool ok = false;

            atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)dr;
            atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanUpdate(fcr.FileId, atSecurity.SecurityManager.Features.FileContact);
            if (perm != atSecurity.SecurityManager.LevelPermissions.No)
            {
                ok = true;
            }

            return(ok);
        }
Exemplo n.º 14
0
        public atriumDB.FileContactRow Add(int contactId, string contactType)
        {
            if (myA.DB.FileContact.Select("ContactId=" + contactId.ToString()).Length == 0)
            {
                //add filecontact
                atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)Add(myA.CurrentFile);
                fcr.ContactId   = contactId;
                fcr.ContactType = contactType;
                fcr.Active      = true;
                fcr.StartDate   = DateTime.Today;
            }

            return((atriumDB.FileContactRow)myA.DB.FileContact.Select("ContactId=" + contactId.ToString())[0]);
        }
Exemplo n.º 15
0
        protected override void AfterAdd(DataRow row)
        {
            atriumDB.FileContactRow dr = (atriumDB.FileContactRow)row;
            string ObjectName          = this.myFileContactDT.TableName;

            dr.FileContactid            = this.myA.AtMng.PKIDGet(ObjectName, 10);
            dr.StartDate                = DateTime.Today;
            dr.Active                   = true;
            dr.NoReassign               = false;
            dr.AllowAdministrativeEmail = false;
            dr.HideInToc                = false;
            dr.CallCount                = 0;
            dr.InterpreterBooked        = false;
            //if(!dr.EFileRow.IsOpponentIDNull())
            //    dr.ContactId=dr.EFileRow.OpponentID;
        }
Exemplo n.º 16
0
        private void fileContactGridEX_LoadingRow(object sender, Janus.Windows.GridEX.RowLoadEventArgs e)
        {
            try
            {
                // gridex isParty value list:
                // 1 - appellant
                // 2 - respondent
                // 3 - added party
                // 4 - none of the above

               int fcId = (int)e.Row.Cells["FileContactid"].Value;
               if (FM.GetSSTMng() != null)
               {
                   foreach (SST.FilePartyRow fpr in FM.GetSSTMng().DB.FileParty)
                   {
                       if (fpr.RowState != DataRowState.Deleted && !fpr.IsFileContactIdNull() && fpr.FileContactId == fcId)
                       {
                           if (fpr.IsPending)
                               e.Row.Cells["IsPending"].Value = true;

                           if (fpr.IsAppellant)
                               e.Row.Cells["IsParty"].Value = 1;
                           else if (fpr.IsRespondent)
                               e.Row.Cells["IsParty"].Value = 2;
                           else
                               e.Row.Cells["IsParty"].Value = 3;
                           return;
                       }
                       else
                           e.Row.Cells["IsParty"].Value = 4;
                   }
               }
               else
               {
                   atriumDB.FileContactRow fcr = FM.DB.FileContact.FindByFileContactid(fcId);
                   if(fcr.ContactClass=="O")
                       e.Row.Cells["IsOfficer"].Value = true;
                   else
                       e.Row.Cells["IsOfficer"].Value = false;
               }

            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
Exemplo n.º 17
0
        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));
        }
Exemplo n.º 18
0
        public atriumDB.FileContactRow AddRecipToFile(docDB.RecipientRow r, bool save, string contactType)
        {
            FileManager fm = myA.FM;

            atriumDB.FileContactRow fcr = fm.GetFileContact().Add(r, contactType);;


            if (save)
            {
                BusinessProcess bp = fm.GetBP();
                bp.AddForUpdate(fm.GetFileOffice());
                bp.AddForUpdate(fm.GetPerson());
                bp.AddForUpdate(fm.GetFileContact());
                bp.AddForUpdate(fm.EFile);
                bp.Update();
            }

            return(fcr);
        }
Exemplo n.º 19
0
        public atriumDB.FileContactRow Add(officeDB.OfficerRow or, string contactType)
        {
            //if(myA.DB.FileContact.Rows.Count==0)
            //    LoadByFileId(myA.CurrentFile.FileId);

            if (myA.DB.FileContact.Select("ContactId=" + or.OfficerId.ToString()).Length == 0)
            {
                //add filecontact
                atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)Add(myA.CurrentFile);
                fcr.ContactId   = or.OfficerId;
                fcr.ContactType = contactType;
                fcr.Active      = true;
                fcr.StartDate   = DateTime.Today;

                fcr.OfficeId = or.OfficeId;
            }

            return((atriumDB.FileContactRow)myA.DB.FileContact.Select("ContactId=" + or.OfficerId.ToString())[0]);
        }
Exemplo n.º 20
0
        public void ExecuteRule(BEManager _fm, appDB.ddRuleRow thisRule, DataRow rowToCheck, DataColumn columnToCheck, string msg)
        {
            FileManager fm = (FileManager)_fm;

            atriumDB.FileContactRow dr = (atriumDB.FileContactRow)rowToCheck;
            //if contact type is once per file see if it it on any other records
            bool once = false;

            once = (bool)fm.Codes("ContactType").Select("ContactTypeCode='" + dr.ContactType + "'")[0]["OncePerFile"];
            if (once)
            {
                foreach (atriumDB.FileContactRow fcr1 in dr.Table.Rows)
                {
                    if (!fcr1.IsNull("ContactType") && fcr1.ContactType == dr.ContactType && dr.FileContactid != fcr1.FileContactid)
                    {
                        throw new AtriumException(msg, dr.ContactType);
                    }
                }
            }
        }
Exemplo n.º 21
0
        private void AddAttendeeToTimeline(TimeLineField ContactField, atriumDB.AttendeeRow atr)
        {
            var fcx = from fc in myFM.DB.FileContact
                      where fc.ContactId == atr.ContactId
                      select fc;

            if (fcx.Count() == 1)
            {
                atriumDB.FileContactRow fcr = fcx.Single();
                ContactField.ValueList.Add(new TimeLineValueListItem(atr.ContactId, fcr.DisplayName, 0));
            }
            else
            {
                atriumDB.ContactRow cr = myFM.GetPerson().Load(atr.ContactId);
                ContactField.ValueList.Add(new TimeLineValueListItem(atr.ContactId, cr.DisplayName, 0));
                //TODO find contact
            }

            myFM.GetAppointment().LoadByContactIdDates(atr.ContactId, RangeStartDate, RangeEndDate);

            AddDummyAppointmentForFileContacts(atr);
        }
Exemplo n.º 22
0
        private void filePartyBindingSource_CurrentChanged(object sender, EventArgs e)
        {
            try
            {
                atriumDB.FileContactRow fcr = CurrentRow();

                if (fcr == null || fcr.IsNull("FileContactId"))
                {
                    return;
                }
                TogglePartyEditableMode(false);
                partyBindingSource.Position = partyBindingSource.Find("ContactId", fcr.ContactId.ToString());

                ApplySecurity(fcr);

                //check for address record and set binding source position
                atriumDB.ContactRow pr = CurrentRowParty();
                if (pr == null || pr.IsNull("ContactId"))
                {
                    return;
                }



                if (!pr.IsAddressCurrentIDNull() && CurrentRowAddress() != null)
                {
                    addressBindingSource.Position = addressBindingSource.Find("AddressId", pr.AddressCurrentID.ToString());
                    gbAddress.Visible             = true;
                }
                else
                {
                    gbAddress.Visible = false;
                }
            }
            catch (Exception x)
            {
                UIHelper.HandleUIException(x);
            }
        }
Exemplo n.º 23
0
        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;
            }

        }
Exemplo n.º 24
0
        private void LoadAttendeeContacts()
        {
            InitContactTable();

            foreach (atriumDB.AttendeeRow attrow in FM.DB.Attendee.Rows)
            {
                var fcx = from fc in FM.DB.FileContact
                          where fc.ContactId == attrow.ContactId
                          select fc;

                if (fcx.Count() == 1)
                {
                    atriumDB.FileContactRow fcr = fcx.Single();
                    DataRow[] crow = (DataRow[])contactDT.Select("contactId=" + fcr.ContactId);
                    if (crow.Length < 1)
                    {
                        contactDT.Rows.Add(fcr.ContactId, fcr.DisplayName);
                    }
                }
                else
                {
                    DataRow[]           crow = (DataRow[])contactDT.Select("contactId=" + attrow.ContactId);
                    atriumDB.ContactRow cr   = null;
                    if (crow.Length == 0)
                    {
                        cr = FM.GetPerson().Load(attrow.ContactId);
                        contactDT.Rows.Add(cr.ContactId, cr.DisplayName);
                    }
                }
            }
            contactDT.AcceptChanges();

            DataView contactDV = new DataView(contactDT);

            attendeeGridEX.DropDowns["ddContact"].SetDataBinding(contactDV, "");
        }
Exemplo n.º 25
0
        private void CreateAppeal(int fileAppealedId)
        {
            FileManager fmOrig  = myA.AtMng.GetFile(fileAppealedId);
            SSTManager  sstOrig = fmOrig.GetSSTMng();

            SST.SSTCaseRow scr = mySSTCaseDT[0];
            //copy sstcasematter

            if (!sstOrig.DB.SSTCase[0].IsDecisionSentDateNull())
            {
                scr.OrigDecisionDate = sstOrig.DB.SSTCase[0].DecisionSentDate;
            }


            //is leave to app0eal required!!
            if (sstOrig.DB.SSTCase[0].OutcomeId == 5 || sstOrig.DB.SSTCase[0].OutcomeId == 18)
            {
                scr.LeaveToAppealNotRequired = true;
            }
            else
            {
                scr.LeaveToAppealNotRequired = false;
            }

            scr.ProgramId = sstOrig.DB.SSTCase[0].ProgramId;
            if (!sstOrig.DB.SSTCase[0].IsAccountIdNull())
            {
                scr.AccountId = sstOrig.DB.SSTCase[0].AccountId;
            }

            foreach (SST.SSTCaseMatterRow scmr in sstOrig.DB.SSTCaseMatter)
            {
                SST.SSTCaseMatterRow newScmr = (SST.SSTCaseMatterRow)myA.GetSSTCaseMatter().Add(scr);
                if (!scmr.IsIssueIdNull())
                {
                    newScmr.IssueId = scmr.IssueId;
                }
                if (!scmr.IsAccountIdNull())
                {
                    newScmr.AccountId = scmr.AccountId;
                }

                newScmr.ProgramId = scmr.ProgramId;
            }

            //copy contacts/parties
            foreach (atriumDB.FileContactRow fcr in fmOrig.DB.FileContact)
            {
                if (fcr.ContactClass == "P")
                {
                    atriumDB.FileContactRow newFcr = (atriumDB.FileContactRow)myA.FM.GetFileContact().Add(myA.FM.CurrentFile);
                    newFcr.ContactId   = fcr.ContactId;
                    newFcr.ContactType = fcr.ContactType;

                    SST.FilePartyRow fpr    = (SST.FilePartyRow)sstOrig.DB.FileParty.Select("Filecontactid=" + fcr.FileContactid.ToString())[0];
                    SST.FilePartyRow newFpr = (SST.FilePartyRow)myA.GetFileParty().Add(scr);
                    newFpr.IsAppellant   = fpr.IsAppellant;
                    newFpr.IsRespondent  = fpr.IsRespondent;
                    newFpr.IsPending     = true;
                    newFpr.FileContactId = newFcr.FileContactid;
                }
            }
        }
Exemplo n.º 26
0
        public atriumDB.FileContactRow Add(docDB.RecipientRow or, string contactType)
        {
            //if (myA.DB.FileContact.Rows.Count == 0)
            //    LoadByFileId(myA.CurrentFile.FileId);

            if (or.IsOfficerIdNull())
            {
                //create free contact
                myA.GetPerson();
                atriumDB.ContactRow c = myA.DB.Contact.NewContactRow();
                myA.DB.Contact.AddContactRow(c);

                c.EmailAddress = or.Address;

                if (or.Name.Contains(","))
                {
                    c.LastName  = or.Name.Split(',')[0];
                    c.FirstName = or.Name.Split(',')[1];
                }
                else if (or.Name.Contains(" "))
                {
                    c.LastName  = or.Name.Split(' ')[1];
                    c.FirstName = or.Name.Split(' ')[0];
                }
                else
                {
                    c.FirstName = "[n/a]";
                    c.LastName  = or.Name;
                }

                //assign contactid to recip record
                or.OfficerId = c.ContactId;
                atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)Add(myA.CurrentFile);
                fcr.ContactId   = c.ContactId;
                fcr.ContactType = contactType;
                fcr.Active      = true;
                fcr.StartDate   = DateTime.Today;

                return(fcr);
            }
            else
            {
                if (myA.DB.FileContact.Select("ContactId=" + or.OfficerId.ToString()).Length == 0)
                {
                    //add filecontact
                    //atriumDB.FileContactRow[] fcrs = (atriumDB.FileContactRow[])myA.DB.FileContact.Select("ContactType='"+contactType+"'","", DataViewRowState.Added);
                    //atriumDB.FileContactRow fcr;
                    //if (fcrs.Length == 1)
                    //{
                    //    fcr = fcrs[0];
                    //}
                    //else
                    //{
                    atriumDB.FileContactRow fcr = (atriumDB.FileContactRow)Add(myA.CurrentFile);
                    fcr.ContactType = contactType;
                    fcr.ContactId   = or.OfficerId;
                    fcr.Active      = true;
                    fcr.StartDate   = DateTime.Today;
                    if (!or.IsOfficeIdNull())
                    {
                        fcr.OfficeId = or.OfficeId;
                    }
                }
                return((atriumDB.FileContactRow)myA.DB.FileContact.Select("ContactId=" + or.OfficerId.ToString())[0]);
            }
        }
Exemplo n.º 27
0
        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);
            }
        }
Exemplo n.º 28
0
        public atriumDB.ContactRow SwapBySIN(atriumDB.ContactRow pr, string SIN)
        {
            if (pr.RowState == DataRowState.Added)
            {
                //load exisiting party row
                LoadBySIN(SIN);

                myA.RaiseWarning(WarningLevel.Display, Properties.Resources.ExistingPartyFound, myA.AtMng.AppMan.AppName);

                var ps = from p in myPersonDT
                         where !p.IsSINNull() && p.SIN == SIN &&
                         pr.ContactId != p.ContactId
                         select p;

                atriumDB.ContactRow existingPerson = ps.Single();


                int currentContactId = pr.ContactId;


                //replace party row in related fields
                ACEngine ace = myA.CurrentActivityProcess.CurrentACE;
                if (ace.relTables.ContainsKey("Party0"))
                {
                    DataView dv = new DataView(myPersonDT, "ContactId=" + existingPerson.ContactId.ToString(), "", DataViewRowState.CurrentRows);

                    ace.relTables["Party0"].RowFilter = dv.RowFilter;
                }

                //swap address
                if (ace.relTables.ContainsKey("Address0") && !existingPerson.IsAddressCurrentIDNull())
                {
                    myA.DB.Address.FindByAddressId(pr.AddressCurrentID).Delete();
                    myA.GetAddress().Load(existingPerson.AddressCurrentID);
                    DataView dv = new DataView(myA.DB.Address, "AddressId=" + existingPerson.AddressCurrentID.ToString(), "", DataViewRowState.CurrentRows);
                    ace.relTables["Address0"].RowFilter = dv.RowFilter;
                }
                else if (ace.relTables.ContainsKey("Address0") && existingPerson.IsAddressCurrentIDNull())
                {
                    atriumDB.AddressRow adr = myA.DB.Address.FindByAddressId(pr.AddressCurrentID);
                    adr.ContactId = existingPerson.ContactId;
                    existingPerson.AddressCurrentID = adr.AddressId;
                }


                //change contact id on filecontact
                var fcs = from fc in myA.DB.FileContact
                          where !fc.IsNull("ContactId") && fc.ContactId == currentContactId
                          select fc;

                if (fcs.Count() == 1)
                {
                    atriumDB.FileContactRow fcr = fcs.Single();
                    fcr.ContactId = existingPerson.ContactId;
                }

                pr.Delete();
                //    pr.AcceptChanges();

                return(existingPerson);
            }
            else
            {
                return(pr);
            }
        }
Exemplo n.º 29
0
        private void MyXml(atriumDB.FileContactRow fcr, System.Xml.XmlDocument xd)
        {
            try
            {
                //JLL: MODIFIED 2009/07/24: take FileContact.Active into account - remove where not active
                bool removeNode = false;
                if (!fcr.HideInToc)
                {
                    System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@supertype='contact' and @id=" + fcr.FileContactid.ToString() + "]");

                    if (!fcr.Active)
                    {
                        removeNode = true;
                    }
                    else if (xe == null)
                    {
                        xe = xd.CreateElement("toc");
                        xe.SetAttribute("supertype", "contact");
                    }


                    if (removeNode)
                    {
                        RemoveFileContactFromXML(xe);
                    }
                    else
                    {
                        xe.SetAttribute("id", fcr.FileContactid.ToString());
                        //if (fcr.IsLastNameNull())
                        //{
                        //    xe.SetAttribute("titlee", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescEng.ToString() + ")", fcr.LegalName, ""));
                        //    xe.SetAttribute("titlef", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescFre.ToString() + ")", fcr.LegalName, ""));
                        //}
                        //else
                        //{
                        //    xe.SetAttribute("titlee", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescEng.ToString() + ")", fcr.LastName, fcr.FirstName));
                        //    xe.SetAttribute("titlef", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescFre.ToString() + ")", fcr.LastName, fcr.FirstName));
                        //}

                        xe.SetAttribute("titlee", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescEng.ToString() + ")", fcr.DisplayName, ""));
                        xe.SetAttribute("titlef", String.Format(atriumRes.FileContactXmlTitle + " (" + fcr.ContactTypeDescFre.ToString() + ")", fcr.DisplayName, ""));

                        if (fcr.ContactType == "FDB")
                        {
                            CLAS.DebtorRow debtor = myA.GetCLASMng().GetDebtor().CurrentDebtor;

                            xe.SetAttribute("type", "opponent");
                            //check for Contact/Notes
                            if (debtor != null && !debtor.IsNotesNull())
                            {
                                //tweek title
                                xe.SetAttribute("titlee", "*** " + xe.GetAttribute("titlee") + " ***");
                                xe.SetAttribute("titlef", "*** " + xe.GetAttribute("titlef") + " ***");
                                xe.SetAttribute("bold", "true");
                                xe.SetAttribute("tooltipe", "There are notes");
                                xe.SetAttribute("tooltipf", "Il y a des notes");
                            }
                            else
                            {
                                xe.SetAttribute("bold", "false");
                                xe.SetAttribute("tooltipe", "");
                                xe.SetAttribute("tooltipf", "");
                            }
                            //2014-06-11
                            //JLL
                            //calculate address country to determine icon
                            //assumes data is already loaded
                            //DOES NOT WORK WHEN OPENING A FILE; CONTACT ROW IS NULL ... ARG
                            if (debtor != null && !debtor.IsAddressCurrentIDNull())
                            {
                                atriumDB.AddressRow dbAddress = myA.DB.Address.FindByAddressId(debtor.AddressCurrentID);
                                if (dbAddress != null)
                                {
                                    string country = dbAddress.CountryCode;
                                    switch (country)
                                    {
                                    case "CDN":
                                        xe.SetAttribute("icon", "34");
                                        break;

                                    case "USA":
                                        xe.SetAttribute("icon", "35");
                                        break;

                                    default:
                                        xe.SetAttribute("icon", "36");
                                        break;
                                    }
                                }
                            }
                        }
                        else
                        {
                            xe.SetAttribute("type", "contact");
                        }

                        if (xe.GetAttribute("isParticipant") != "true" && !fcr.IsOfficeIdNull())
                        {
                            xe.SetAttribute("icon", "43"); //atrium officer; not necessarily a user
                        }
                        if (xe.ParentNode == null)
                        {
                            System.Xml.XmlElement xes = null;
                            if (fcr.IsOfficeIdNull())
                            {
                                xes = EFileBE.XmlAddFld(xd, "basecontacts", "Contacts", "Contacts", 210);
                                xes.AppendChild(xe);
                            }
                            else
                            {
                                System.Xml.XmlElement xe1 = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='fileoffice' and @officeid=" + fcr.OfficeId.ToString() + "]");
                                if (xe1 != null)
                                {
                                    xe1.AppendChild(xe);
                                }
                                else
                                {
                                    xes = EFileBE.XmlAddFld(xd, "basecontacts", "Contacts", "Contacts", 210);
                                    xes.AppendChild(xe);
                                }
                                //xes.AppendChild(xe);

                                //xes = EFileBE.XmlAddFld(xe1, "contacts", "Contacts", "Contacts", 320);
                                //else

                                //{
                                //JLL: Bug 2009/07/24
                                //When new contact is added through process (CM03.02), and no File Office record is present,
                                // it sticks File Contact record on first "contact" match on filestructxml document
                                //    xes = EFileBE.XmlAddFld(xd, "contacts", "Contacts", "Contacts", 320);
                                //}
                            }
                            //xes.AppendChild(xe);
                        }
                    }
                }
            }
            catch (Exception x)
            { }
        }
Exemplo n.º 30
0
        protected override void AfterChange(DataColumn dc, DataRow ddr)
        {
            atriumDB.FileContactRow dr = (atriumDB.FileContactRow)ddr;

            //JLL: Fires too often on contactid when it hasn't changed - because of ucContactSelect control

            switch (dc.ColumnName)
            {
            case FileContactFields.ContactType:
            case FileContactFields.ContactId:
                if (!dr.IsNull("ContactType") && dr.IsNull("ContactId"))
                {
                    if (!dr.NoReassign)     // only run it if noreassign not set JLL 2015-01-22
                    {
                        int id = myA.EFile.GetOfficerForContactType(dr.EFileRow, dr.ContactType);

                        if (id != 0)
                        {
                            dr.ContactId = id;
                            dr.EndEdit();
                        }
                    }
                }

                if (!dr.IsNull("ContactType") && !dr.IsNull("ContactId"))
                {
                    if (dr.ContactType == myA.AtMng.GetSetting(AppStringSetting.LeadPLContactType) && (dr.EFileRow.IsLeadParalegalIDNull() || dr.EFileRow.LeadParalegalID != dr.ContactId))
                    {
                        dr.EFileRow.LeadParalegalID = dr.ContactId;
                        dr.EFileRow.EndEdit();
                    }
                    if (dr.ContactType == myA.AtMng.GetSetting(AppStringSetting.OfficerContactType) && (dr.EFileRow.IsOfficerIdNull() || dr.EFileRow.OfficerId != dr.ContactId))
                    {
                        dr.EFileRow.OfficerId = dr.ContactId;
                        dr.EFileRow.EndEdit();
                    }    //if (dr.ContactType == "FLL" &&(dr.EFileRow.IsLeadLawyerIDNull() || dr.EFileRow.LeadLawyerID != dr.ContactId))
                         //{
                         //    dr.EFileRow.LeadLawyerID = dr.ContactId;
                         //    dr.EFileRow.EndEdit();
                         //}

                    //JLL: 2010/11/16 Can only have one Lead Lawyer on file
                    //update current Lead Lawyer to Assisting Lawyer, unless trying to update to same
                    if (dr.ContactType == myA.AtMng.GetSetting(AppStringSetting.LeadLawyerContactype))
                    {
                        foreach (atriumDB.FileContactRow fcr in myA.CurrentFile.GetFileContactRows())
                        {
                            if (!fcr.IsNull("ContactType") && dr != fcr && fcr.ContactType == "FLL" && fcr.Active)
                            {
                                if (dr.ContactId == fcr.ContactId)
                                {
                                    throw new AtriumException(String.Format(Properties.Resources.LeadLawyerAlreadyOnFile, myA.AtMng.AppMan.AppName));
                                }
                                else
                                {
                                    //found current - update to assisting and leave
                                    fcr.ContactType = "FAL";
                                    fcr.EndEdit();
                                    break;
                                }
                            }
                        }
                        if (dr.EFileRow.IsLeadLawyerIDNull() || dr.EFileRow.LeadLawyerID != dr.ContactId)
                        {
                            dr.EFileRow.LeadLawyerID = dr.ContactId;
                            dr.EFileRow.EndEdit();
                        }
                    }

                    //JLL: 2009/07/23 Can only have one Lead Client Contact on file
                    //update current Lead Client Contact to Secondary Client Contact
                    if (dr.ContactType == "FCC")
                    {
                        foreach (atriumDB.FileContactRow fcr in myA.CurrentFile.GetFileContactRows())
                        {
                            if (!fcr.IsNull("ContactType") && dr != fcr && fcr.ContactType == "FCC" && fcr.Active)
                            {
                                //if (dr.ContactId == fcr.ContactId)
                                //{

                                //    //We need to delete the duplicate somehow.
                                //    //to skip the error entirely means we end up with two contacts on the file that is the same person
                                //    // opinion/requestdocid beforeChange fires and adds another filecontact record when it is not needed
                                //    // maybe perform a check in opinion/requestdocid beforeChange to see if contactids match already and don't add if already OK
                                //    throw new AtriumException("The selected contact is already the Lead Client Contact on this file.  LawMate does not allow duplicate lead client contacts.");
                                //}
                                //else
                                //found current - update to secondary and leave
                                fcr.ContactType = "FSCC";
                                fcr.EndEdit();
                                break;
                            }
                        }
                    }
                }

                if (dr.RowState == DataRowState.Added & !dr.IsNull("ContactId") & !dr.IsNull("ContactType"))
                {
                    //find officeid

                    officeDB.OfficerRow orr = myA.AtMng.OfficeMng.GetOfficer().FindLoad(dr.ContactId);
                    if (orr != null)
                    {
                        //add office to file
                        //if (myA.DB.FileOffice.Rows.Count == 0)
                        //    myA.GetFileOffice().LoadByFileId(dr.FileId);

                        if (myA.DB.FileOffice.Select("OfficeID=" + orr.OfficeId.ToString()).Length == 0)
                        {
                            atriumDB.FileOfficeRow fo = (atriumDB.FileOfficeRow)myA.GetFileOffice().Add(myA.CurrentFile);
                            fo.OfficeId = orr.OfficeId;
                            if (dr.ContactType == "FCC" || dr.ContactType == "FHGD")
                            {
                                fo.IsClient = true;
                                object alloc = myA.DB.FileOffice.Compute("Sum(PercentAlloc)", "isclient=1");
                                if (alloc.GetType() == typeof(decimal))
                                {
                                    fo.PercentAlloc = 100 - System.Convert.ToDecimal(alloc);
                                }
                                else
                                {
                                    fo.PercentAlloc = 100;
                                }
                            }
                        }
                    }
                }
                break;

            case FileContactFields.EndDate:
                //JLL: 2009/07/23 - set active based on end date
                dr.Active    = dr.IsEndDateNull();
                dr.HideInToc = !dr.IsEndDateNull();
                dr.EndEdit();
                break;

            default:
                break;
            }
        }