public static void FillFormDataFromApplicant(Int64 AEventPartnerKey, Int64 APartnerKey, TFormDataApplicant AFormDataApplicant, TFormLetterInfo AFormLetterInfo, Int64 ASiteKey = 0, Int32 ALocationKey = 0) { TDBTransaction ReadTransaction = null; DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.ReadCommitted, TEnforceIsolationLevel.eilMinimum, ref ReadTransaction, delegate { FillFormDataFromApplicant(AEventPartnerKey, APartnerKey, AFormDataApplicant, AFormLetterInfo, ReadTransaction, ASiteKey, ALocationKey); }); }
public static void FillFormDataFromApplicant(Int64 AEventPartnerKey, Int64 APartnerKey, TFormDataApplicant AFormDataApplicant, TFormLetterInfo AFormLetterInfo, Int64 ASiteKey = 0, Int32 ALocationKey = 0) { TDBTransaction ReadTransaction = new TDBTransaction(); DBAccess.ReadTransaction( ref ReadTransaction, delegate { FillFormDataFromApplicant(AEventPartnerKey, APartnerKey, AFormDataApplicant, AFormLetterInfo, ReadTransaction, ASiteKey, ALocationKey); }); }
public static void FillFormDataFromApplicant(Int64 AEventPartnerKey, Int64 APartnerKey, TFormDataApplicant AFormDataApplicant, TFormLetterInfo AFormLetterInfo, TDBTransaction AReadTransaction, Int64 ASiteKey = 0, Int32 ALocationKey = 0) { TPartnerClass PartnerClass; String ShortName; TStdPartnerStatusCode PartnerStatusCode; if (AFormDataApplicant == null) { return; } if (MCommonMain.RetrievePartnerShortName(APartnerKey, out ShortName, out PartnerClass, out PartnerStatusCode, AReadTransaction)) { // first retrieve all personnel information TFormLettersPersonnelWebConnector.FillFormDataFromPersonnel(APartnerKey, AFormDataApplicant, AFormLetterInfo, AReadTransaction, ASiteKey, ALocationKey); // retrieve Applicant information PmShortTermApplicationTable ShortTermAppTable; PmShortTermApplicationRow ShortTermAppRow; PmShortTermApplicationRow template = new PmShortTermApplicationTable().NewRowTyped(false); template.PartnerKey = APartnerKey; template.StConfirmedOption = AEventPartnerKey; ShortTermAppTable = PmShortTermApplicationAccess.LoadUsingTemplate(template, AReadTransaction); if (ShortTermAppTable.Count > 0) { ShortTermAppRow = (PmShortTermApplicationRow)ShortTermAppTable.Rows[0]; AFormDataApplicant.EventPartnerKey = AEventPartnerKey.ToString("0000000000"); AFormDataApplicant.ArrivalDate = ShortTermAppRow.Arrival; AFormDataApplicant.ArrivalTime = new DateTime(ShortTermAppRow.Arrival == null ? 0 : ((DateTime)ShortTermAppRow.Arrival).Year, ShortTermAppRow.Arrival == null ? 0 : ((DateTime)ShortTermAppRow.Arrival).Month, ShortTermAppRow.Arrival == null ? 0 : ((DateTime)ShortTermAppRow.Arrival).Day, ShortTermAppRow.ArrivalHour, ShortTermAppRow.ArrivalMinute, 0); AFormDataApplicant.ArrivalFlightNumber = ShortTermAppRow.FromCongTravelInfo; AFormDataApplicant.ArrivalComment = ShortTermAppRow.ArrivalComments; AFormDataApplicant.DepartureDate = ShortTermAppRow.Departure; AFormDataApplicant.DepartureTime = new DateTime(ShortTermAppRow.Departure == null ? 0 : ((DateTime)ShortTermAppRow.Arrival).Year, ShortTermAppRow.Departure == null ? 0 : ((DateTime)ShortTermAppRow.Arrival).Month, ShortTermAppRow.Departure == null ? 0 : ((DateTime)ShortTermAppRow.Arrival).Day, ShortTermAppRow.DepartureHour, ShortTermAppRow.DepartureMinute, 0); AFormDataApplicant.DepartureFlightNumber = ShortTermAppRow.ToCongTravelInfo; AFormDataApplicant.DepartureComment = ShortTermAppRow.DepartureComments; AFormDataApplicant.EventRole = ShortTermAppRow.StCongressCode; AFormDataApplicant.CampaignType = ShortTermAppRow.ConfirmedOptionCode.Substring(5, 6); AFormDataApplicant.FellowshipGroup = ShortTermAppRow.StFgCode; TPartnerClass PartnerClassDummy = new TPartnerClass(); AFormDataApplicant.ChargedFieldKey = ShortTermAppRow.StFieldCharged.ToString("0000000000"); string chargedFieldName = ""; if (!ShortTermAppRow.IsStCurrentFieldNull()) { TPartnerServerLookups.GetPartnerShortName(ShortTermAppRow.StCurrentField, out chargedFieldName, out PartnerClassDummy); } AFormDataApplicant.SendingFieldName = chargedFieldName; /*ApplicantFormData.SendingFieldKey = ShortTermAppRow.StCurrentField.ToString("0000000000"); * * * string sendingFieldName; * TPartnerServerLookups.GetPartnerShortName(ShortTermAppRow.StCurrentField, out sendingFieldName, out PartnerClassDummy); * ApplicantFormData.SendingFieldName = sendingFieldName;*/ //TODO: SendingFieldKey & -name; ReceivingFieldKey & -name PmGeneralApplicationTable GeneralAppTable; PmGeneralApplicationRow GeneralAppRow; GeneralAppTable = PmGeneralApplicationAccess.LoadByPrimaryKey(APartnerKey, ShortTermAppRow.ApplicationKey, ShortTermAppRow.RegistrationOffice, AReadTransaction); if (GeneralAppTable.Count > 0) { GeneralAppRow = (PmGeneralApplicationRow)GeneralAppTable.Rows[0]; AFormDataApplicant.RegistrationDate = GeneralAppRow.GenAppDate; AFormDataApplicant.ApplicationComment = GeneralAppRow.Comment; } } } }