protected override void BeforeUpdate(DataRow row) { SST.ADMSEParticipantRow dr = (SST.ADMSEParticipantRow)row; //SST.SSTCaseRow scr=(SST.SSTCaseRow)myA.GetSSTCase().GetCurrentRow()[0]; //if (!dr.IsParticipantTypeMNull()) //{ // switch (scr.AppelantSourceId) // { // case 1: // dr.IsAppellant = dr.ParticipantTypeM == "PCL"; // break; // case 2: // dr.IsAppellant = dr.ParticipantTypeM == "PEMP"; // break; // case 3: // dr.IsAppellant = dr.ParticipantTypeM == "PEMA"; // break; // case 4: // dr.IsAppellant = dr.ParticipantTypeM == "PERA"; // break; // case 5: // dr.IsAppellant = dr.ParticipantTypeM == "POTA"; // break; // } //} }
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"]; } } } }
protected override void AfterAdd(DataRow row) { SST.ADMSEParticipantRow dr = (SST.ADMSEParticipantRow)row; string ObjectName = this.myDT.TableName; dr.Id = myA.AtMng.PKIDGet(ObjectName, 10); dr.TransferStatus = "UNPROCESSED"; dr.AtriumUser = myA.AtMng.OfficerLoggedOn.UserName; dr.SSTFileNumber = myA.FM.CurrentFile.FullFileNumber; dr.IsAppellant = false; }
protected override void AfterChange(DataColumn dc, DataRow row) { SST.ADMSEParticipantRow dr = (SST.ADMSEParticipantRow)row; switch (dc.ColumnName) { case "TelephoneNumber": if (!dr.IsTelephoneNumberNull()) { if (dr.TelephoneNumber.Length > 3) { string temp = dr.TelephoneNumber.Replace("(", ""); temp = temp.Replace(")", ""); temp = temp.Replace(" ", ""); temp = temp.Replace("-", ""); dr.AreaCode = temp.Substring(0, 3); dr.TelNumber = temp.Replace(dr.AreaCode, ""); } else { dr.TelNumber = dr.TelephoneNumber; } } break; case "CountryM": dr.Country = myA.AtMng.GetMap().MapOut("Country", dr.CountryM); break; case "ProvinceCodeM": dr.ProvinceCode = myA.AtMng.GetMap().MapOut("Province", dr.ProvinceCodeM); break; case "LangCdM": dr.LangCd = myA.AtMng.GetMap().MapOut("LanguageCode", dr.LangCdM); break; case "ParticipantTypeM": dr.ParticipantType = myA.AtMng.GetMap().MapOut("ContactType", dr.ParticipantTypeM); break; } }