Пример #1
0
        protected override void AfterAdd(DataRow row)
        {
            atriumDB.FileOfficeRow dr = (atriumDB.FileOfficeRow)row;
            string ObjectName         = this.myFileOfficeDT.TableName;

            dr.FileOfficeId = this.myA.AtMng.PKIDGet(ObjectName, 10);
            //dr.StartDate = DateTime.Today;
            dr.IsClient     = false;
            dr.IsLead       = false;
            dr.IsOwner      = false;
            dr.IsAgent      = false;
            dr.IsPrimary    = false;
            dr.PercentAlloc = 0;

            // dr.accesType = "OF"

            ////need to assign office based on debtor address
            //if (!dr.EFileRow.IsOpponentIDNull())
            //{
            //    object tempid = this.myA..AppMan.ExecuteScalar("AssignOfficeByCity", dr.FileId, dr.EFileRow.OpponentID);
            //    if (tempid == System.DBNull.Value)
            //        dr.OfficeId = this.myA.AtMng.OfficeLoggedOn.OfficeId;
            //    else
            //        dr.OfficeId = System.Convert.ToInt32(tempid);
            //}
        }
Пример #2
0
        public void MaintainAccessType(atriumDB.FileOfficeRow orCurrent, bool isOwner, bool isLead, bool isClient)
        {
            if (isLead)
            {
                orCurrent.IsLead = true;
                this.myA.CurrentFile.LeadOfficeId = orCurrent.OfficeId;
            }
            else
            {
                orCurrent.IsLead = false;
            }
            if (isOwner)
            {
                orCurrent.IsOwner = true;
                this.myA.CurrentFile.OwnerOfficeId = orCurrent.OfficeId;
            }

            foreach (atriumDB.FileOfficeRow or in this.myFileOfficeDT.Rows)
            {
                if (or.IsLead & or.FileOfficeId != orCurrent.FileOfficeId)
                {
                    or.IsLead = false;
                }
            }
        }
Пример #3
0
 private void fileOfficeBindingSource_CurrentChanged(object sender, EventArgs e)
 {
     if (CurrentRow() != null)
     {
         atriumDB.FileOfficeRow cbr = CurrentRow();
         ApplySecurity(cbr);
     }
 }
Пример #4
0
        protected override void AfterUpdate(DataRow dr)
        {
            atriumDB.FileOfficeRow r = (atriumDB.FileOfficeRow)dr;

            System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
            xd.InnerXml = r.EFileRow.FileStructXml;
            MyXml(r, xd);
            r.EFileRow.FileStructXml = xd.InnerXml;
            //myA.EFile.Update();
        }
Пример #5
0
        private void MyXml(atriumDB.FileOfficeRow r, System.Xml.XmlDocument xd)
        {
            System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='fileoffice' and @id=" + r.FileOfficeId.ToString() + "]");
            if (xe == null)
            {
                xe = xd.CreateElement("toc");
                xe.SetAttribute("type", "fileoffice");
            }
            xe.SetAttribute("id", r.FileOfficeId.ToString());
            xe.SetAttribute("officeid", r.OfficeId.ToString());


            string titlee = r.OfficeCode + " - " + r.OfficeName;
            string titlef = r.OfficeCode + " - " + r.OfficeNameFre;

            if (!r.IsOfficeFileNumNull())
            {
                titlee += " (" + r.OfficeFileNum + ")";
                titlef += " (" + r.OfficeFileNum + ")";
            }
            xe.SetAttribute("titlee", titlee);
            xe.SetAttribute("titlef", titlef);

            string tooltipe = "";
            string tooltipf = "";

            if (r.IsClient)
            {
                tooltipe = "Client Office";
                tooltipf = "Bureau client";
            }
            else if (r.IsLead)
            {
                tooltipe = "Lead Office";
                tooltipf = "Bureau responsable";
            }
            else if (r.IsOwner)
            {
                tooltipe = "Owner Office";
                tooltipf = "Bureau propriétaire du dossier";
            }

            //xe.SetAttribute("icon", "28"); //office icon

            xe.SetAttribute("tooltipe", tooltipe);
            xe.SetAttribute("tooltipf", tooltipf);

            if (xe.ParentNode == null)
            {
                System.Xml.XmlElement xes = EFileBE.XmlAddFld(xd, "basecontacts", "Contacts", "Contacts", 210);
                //System.Xml.XmlElement xes = EFileBE.XmlAddFld(xd, "fileoffice", "Offices", "Bureaux",320);
                xes.AppendChild(xe);
            }
        }
Пример #6
0
        protected override void AfterChange(DataColumn dc, DataRow ddr)
        {
            string ObjectName = this.myFileOfficeDT.TableName;

            atriumDB.FileOfficeRow dr = (atriumDB.FileOfficeRow)ddr;
            switch (dc.ColumnName)
            {
            default:
                break;
            }
        }
Пример #7
0
        public override bool CanDelete(DataRow dr)
        {
            bool ok = false;

            atriumDB.FileOfficeRow fo = (atriumDB.FileOfficeRow)dr;
            atSecurity.SecurityManager.LevelPermissions perm = myA.AtMng.SecurityManager.CanDelete(fo.FileId, atSecurity.SecurityManager.Features.fileOffice);
            if (perm != atSecurity.SecurityManager.LevelPermissions.No)
            {
                ok = true;
            }

            return(ok);
        }
Пример #8
0
        protected override void BeforeDelete(DataRow dr)
        {
            atriumDB.FileOfficeRow fcr = (atriumDB.FileOfficeRow)dr;

            System.Xml.XmlDocument xd = new System.Xml.XmlDocument();
            xd.InnerXml = fcr.EFileRow.FileStructXml;
            System.Xml.XmlElement xe = (System.Xml.XmlElement)xd.SelectSingleNode("//toc[@type='fileoffice' and @id=" + fcr.FileOfficeId.ToString() + "]");
            if (xe != null && xe.ParentNode != null)
            {
                System.Xml.XmlElement parentNode  = (System.Xml.XmlElement)xe.ParentNode;
                System.Xml.XmlNode    removedNode = xe.ParentNode.RemoveChild(xe);
            }
            fcr.EFileRow.FileStructXml = xd.InnerXml;
        }
Пример #9
0
        public override void ApplySecurity(DataRow dr)
        {
            if (FileForm() != null && FileForm().ReadOnly)
            {
                return;
            }

            atriumDB.FileOfficeRow cbr = (atriumDB.FileOfficeRow)dr;
            UIHelper.EnableControls(fileOfficeBindingSource, FM.GetFileOffice().CanEdit(cbr));
            if (!InEditMode)
            {
                UIHelper.EnableCommandBarCommand(tsDelete, FM.GetFileOffice().CanDelete(cbr));
            }
        }
Пример #10
0
        protected override void BeforeChange(DataColumn dc, DataRow ddr)
        {
            atriumDB.FileOfficeRow dr = (atriumDB.FileOfficeRow)ddr;
            switch (dc.ColumnName)
            {
            case "OfficeId":
                if (dr.RowState != DataRowState.Added && !myA.CheckDomain(dr.OfficeId, myA.Codes("OfficeList")))
                {
                    throw new AtriumException(atriumBE.Properties.Resources.BadDomainValue, dc.ColumnName, dr.Table.TableName, "Office List");
                }
                break;

            default:
                break;
            }
        }
Пример #11
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;
            }
        }
Пример #12
0
        protected override void BeforeUpdate(DataRow row)
        {
            atriumDB.FileOfficeRow dr = (atriumDB.FileOfficeRow)row;

            //if the office already exisits do not add it

            if (this.myA.DB.FileOffice.Select("Fileid=" + dr.FileId.ToString() + " and officeid=" + dr.OfficeId.ToString()).Length > 1)
            {
                throw new AtriumException(atriumBE.Properties.Resources.DuplicateFileOfficeNumber);
            }

            //need to make sure all rows are loaded for this to work
            //don't load the rows here!!!!!!!!!
            decimal totPrcnt = 0;

            foreach (atriumDB.FileOfficeRow fr in dr.EFileRow.GetFileOfficeRows())
            {
                if (fr.IsClient)
                {
                    totPrcnt += fr.PercentAlloc;
                }
            }
            if (totPrcnt != 0 && totPrcnt != 100)
            {
                throw new AtriumException("Percent Allocation must add up to 100%");
            }

            //if another LO exists and has open accounts then do not allow the LO to change
            //if the office already exisits do not add it
//			bool found=false;
//			foreach(atriumDB.FileOfficeRow fr in dr.EFileRow.GetFileOfficeRows())
//			{
//				if(fr.OfficeId==dr.OfficeId)
//				{
//					fr.BeginEdit();
//					found=true;
//					fr.AccessType="LO";
//					fr.IsLead=true;
//					fr.EndEdit();
//
//				}
//			}
//			if(!found)
//			{
//				//add file office row
//
//				atriumDB.FileOfficeRow fr=(atriumDB.FileOfficeRow)this.myA.GetFileOffice().Add(dr.EFileRow);
//				fr.BeginEdit();
//				fr.OfficeId=dr.OfficeId;
//				fr.AccessType="LO";
//				fr.IsLead=true;
//				fr.EndEdit();
//
//
//			}
            if (dr.IsOwner)
            {
                //if (this.myA.IsFieldChanged(dr.Table.Columns["OfficeId"], dr) || this.myA.IsFieldChanged(dr.Table.Columns["AccessType"], dr))
                //{
                dr.EFileRow.OwnerOfficeId = dr.OfficeId;
                //}
            }
            if (dr.IsLead)
            {
                //JLL:2017-01-25 only update efile/leadoffice if changing values for officeid or accesstype on fileoffice row; otherwise, skip the update
                //if(this.myA.IsFieldChanged(dr.Table.Columns["OfficeId"],dr) || this.myA.IsFieldChanged(dr.Table.Columns["AccessType"],dr))
                //{
                dr.EFileRow.LeadOfficeId = dr.OfficeId;
                //this.myA.EFile.AssignOfficer(dr.EFileRow);
                //this.myA.EFile.SyncFileContact(dr.EFileRow,dr.EFileRow.LeadParalegalID,"PL");
                //}
            }
        }
Пример #13
0
        private void EI_WS(SST.ADMSLookupRow ADMSr, MapBE map, ADMS.ADMS_LookupClient ws)
        {
            ACEngine ace = myA.FM.CurrentActivityProcess.CurrentACE;

            DataSet ds = ws.Get_ADMS_SST_Info(ADMSr.ReconID, ADMSr.SIN, ADMSr.BusinessNumber);

            if (ds.Tables.Contains("ERROR"))
            {
                //get status message
                ADMSr.Message = ds.Tables["ERROR"].Rows[0]["MESSAGE"].ToString();
                if (ADMSr.Message.ToUpper() == "SUCCESS")
                {
                    if (ds.Tables.Contains("ADMS_SST_INFO"))
                    {
                        DataTable dtR = ds.Tables["ADMS_SST_INFO"];
                        DataRow   dr  = dtR.Rows[0];

                        SST.SSTCaseRow scr = (SST.SSTCaseRow)myA.GetSSTCase().GetCurrentRow()[0];
                        //           scr.AppelantSourceId = System.Convert.ToInt32(map.MapIn("AppelantSource", dr["CODE_SRC"].ToString()));
                        scr.ReconsiderationID = ADMSr.ReconID;
                        if (!dr.IsNull("DATE_DCSN_ISD"))
                        {
                            scr.OrigDecisionDate = System.Convert.ToDateTime(dr["DATE_DCSN_ISD"]);
                        }

                        int officeid = System.Convert.ToInt32(map.MapIn("Office", dr["ID_OFC_ANCHR"].ToString()));
                        atriumDB.FileOfficeRow focr = myA.FM.GetFileOffice().AddOfficeToFile(officeid, false, false, false);
                        focr.OfficeFileNum = scr.ReconsiderationID.ToString();

                        //find the gd account
                        OfficeManager om = myA.AtMng.GetOffice(focr.OfficeId);

                        if (om.DB.Officer.Rows.Count == 0)
                        {
                            om.GetOfficer().LoadByOfficeId(focr.OfficeId);
                        }

                        var oGD = from o in om.DB.Officer
                                  where o.PositionCode == "GD"
                                  select o;

                        if (oGD.Count() == 1)
                        {
                            atriumDB.FileContactRow fcr = myA.FM.GetFileContact().Add(oGD.Single(), "FHGD");
                            fcr.HideInToc = true;
                        }
                        if (ds.Tables.Contains("ADMS_SST_INFO_PARTICIPANTS"))
                        {
                            // string participantType = map.MapIn("Source2Participant", dr["CODE_SRC"].ToString());
                            foreach (DataRow drp in ds.Tables["ADMS_SST_INFO_PARTICIPANTS"].Rows)
                            {
                                bool isAppellant = false;
                                if (!ADMSr.IsSINNull() && !drp.IsNull("ID_SIN") && ADMSr.SIN == drp["ID_SIN"].ToString())
                                {
                                    isAppellant = true;
                                }
                                else if (!ADMSr.IsBusinessNumberNull() && !drp.IsNull("ID_BSNS_NMBR"))
                                {
                                    isAppellant = IsEmployerAppellant(ADMSr, drp, isAppellant);
                                }
                                if (isAppellant)
                                {
                                    atriumDB.ContactRow     pr   = (atriumDB.ContactRow)ace.relTables["Party0"][0].Row;
                                    atriumDB.FileContactRow fcr4 = (atriumDB.FileContactRow)ace.relTables["FileContact4"][0].Row;
                                    SST.FilePartyRow        fpr  = (SST.FilePartyRow)ace.relTables["FileParty0"][0].Row;

                                    fpr.IsAppellant = true;

                                    pr.SIN          = drp["ID_SIN"].ToString();
                                    pr.ContactClass = "P";
                                    //if (pr.GetColumnError("SIN") == Properties.Resources.DebtDuplicateSIN)
                                    //changed test to test for Added as the column error would never be present on the exisiting contact after the swap
                                    if (pr.RowState != DataRowState.Added)
                                    {
                                        //TFS#54669 CJW 2013-09-20  called in PersonBE beforechange now
                                        //pr = myA.FM.GetPerson().SwapBySIN(pr, pr.SIN);

                                        pr   = (atriumDB.ContactRow)ace.relTables["Party0"][0].Row;
                                        fcr4 = (atriumDB.FileContactRow)ace.relTables["FileContact4"][0].Row;
                                        fpr  = (SST.FilePartyRow)ace.relTables["FileParty0"][0].Row;

                                        //alert user off swap
                                        ADMSr.Message = Properties.Resources.ExistingPartyFound;
                                    }
                                    pr.LastName     = drp["NAME_INDVDL_LST"].ToString();
                                    pr.FirstName    = drp["NAME_INDVDL_FRST"].ToString();
                                    pr.LanguageCode = map.MapIn("LanguageCode", drp["CODE_LNG"].ToString());

                                    pr.BusinessNumber = drp["ID_BSNS_NMBR"].ToString();
                                    pr.LegalName      = drp["NAME_ORG"].ToString();
                                    pr.OperatingAs    = drp["NAME_ORG_UNT"].ToString();

                                    pr.PartyTypeCode = map.MapIn("ContactType", drp["CODE_PRTCPNT_TYP"].ToString());

                                    fcr4.ContactId    = pr.ContactId;
                                    fcr4.ContactType  = pr.PartyTypeCode;
                                    fpr.FileContactId = fcr4.FileContactid;

                                    pr.TelephoneNumber = drp["NMBR_TLPHN_AR_CD_H"].ToString() + "-" + drp["NMBR_TLPHN_LCL_H"].ToString();
                                    if (!pr.IsAddressCurrentIDNull())
                                    {
                                        atriumDB.AddressRow ar = myA.FM.DB.Address.FindByAddressId(pr.AddressCurrentID);
                                        ar.ContactId         = pr.ContactId;
                                        ar.EffectiveTo       = DateTime.Today;
                                        ar.AddressSourceCode = "HRDC";
                                        ar.Address1          = drp["ADRS_LN_1"].ToString();
                                        ar.Address2          = drp["ADRS_LN_2"].ToString();
                                        ar.Address3          = drp["ADRS_LN_3"].ToString();
                                        string prov = map.MapIn("Province", drp["CODE_PRVNC_OR_ST"].ToString());
                                        if (prov != null)
                                        {
                                            DataTable dtProv = myA.FM.Codes("Province");
                                            DataRow   drs    = dtProv.Rows.Find(prov);

                                            if (drs != null)
                                            {
                                                ar.CountryCode = drs["CountryCode"].ToString();
                                            }
                                            else
                                            {
                                                ar.CountryCode = "CDN";
                                            }
                                        }
                                        else
                                        {
                                            ar.CountryCode = map.MapIn("Country", drp["NAME_CNTRY"].ToString());
                                            if (drp.IsNull("NAME_CNTRY") || ar.IsNull("CountryCode"))
                                            {
                                                ar.CountryCode = "CDN";
                                            }
                                        }
                                        ar.ProvinceCode = prov;
                                        ar.City         = drp["ADRS_MNCPLTY"].ToString();
                                        ar.PostalCode   = drp["CODE_PSTL_OR_ZIP"].ToString();
                                    }
                                }
                                else
                                {
                                    //add other participants automatically
                                    AddOtherParty(map, drp);
                                }
                            }
                        }
                    }
                }
                else if (ADMSr.Message.ToUpper() == "ERROR")
                {
                    //    ADMSr.SetColumnError("Message", ADMSr.Message);
                    ADMSr.Message = ds.Tables["ERROR"].Rows[0]["SQL"].ToString();
                    if (ADMSr.Message.StartsWith("ORA-01403"))
                    {
                        ADMSr.Message = "No matching reconsideration found in ADMS. / Aucune révision correspondante trouvée dans le SGPA.";
                    }
                    else if (ADMSr.Message.StartsWith("ORA-01422"))
                    {
                        ADMSr.Message = "More than one matching reconsideration found in ADMS. / Il y a plus qu'une révision correspondante trouvée dans le SGPA.";
                    }
                    else if (ADMSr.Message.StartsWith("ORA-1017"))
                    {
                        ADMSr.Message = "Configuration problem with ADMS EI web service.  Contact IT support. / Il y a un problème de configuration avec le service web A-E SGPA. Contactez le support TI.";
                    }
                    else if (ADMSr.Message.StartsWith("ORA-12154"))
                    {
                        ADMSr.Message = "Configuration problem with ADMS EI web service.  Contact IT support. / Il y a un problème de configuration avec le service web A-E SGPA. Contactez le support TI.";
                    }
                }
            }
        }