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; } } }
private void AddOtherParty(MapBE map, DataRow drp) { atriumDB.ContactRow pr = null; //search for party if (!drp.IsNull("ID_SIN")) { string SIN = drp["ID_SIN"].ToString(); myA.FM.GetPerson().LoadBySIN(SIN); var ps = from p in myA.FM.DB.Contact where !p.IsSINNull() && p.SIN == SIN select p; if (ps.Count() == 1) { pr = ps.Single(); } } if (pr == null) { //create party pr = (atriumDB.ContactRow)myA.FM.GetPerson().Add(null); pr.SIN = drp["ID_SIN"].ToString(); } pr.ContactClass = "P"; //if (drp.IsNull("NAME_INDVDL_LST")) // pr.LastName = "Resources"; //else pr.LastName = drp["NAME_INDVDL_LST"].ToString(); //if (drp.IsNull("NAME_INDVDL_FRST")) // pr.FirstName = "Human"; //else 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()); pr.TelephoneNumber = drp["NMBR_TLPHN_AR_CD_H"].ToString() + "-" + drp["NMBR_TLPHN_LCL_H"].ToString(); //create address atriumDB.AddressRow ar = (atriumDB.AddressRow)myA.FM.GetAddress().Add(pr); // 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(); // pr.AddressCurrentID = ar.AddressId; //create filecontact atriumDB.FileContactRow fcrp = (atriumDB.FileContactRow)myA.FM.GetFileContact().Add(myA.FM.CurrentFile); fcrp.ContactId = pr.ContactId; fcrp.ContactType = pr.PartyTypeCode; //create fileparty SST.FilePartyRow fpr = (SST.FilePartyRow)myA.GetFileParty().Add(myA.FM.CurrentFile); // fpr.PartyId = pr.PartyId; // fpr.ContactTypeCode = pr.PartyTypeCode; fpr.IsPending = true; fpr.FileContactId = fcrp.FileContactid; }