public AddEmailActivityResponse AddEmailActivity(string sender, ActivityDataType dataType, int id, string message, string subject, DateTime dateCreated = new DateTime(), List<string> files = null, bool isResume = false) { Dictionary<string, string> data = new Dictionary<string, string>(); data["from"] = sender; data["data_type"] = CamelCaseToUnderscore(Enum.GetName(typeof(ActivityDataType), dataType)); data["id"] = id.ToString(); data["message"] = message; data["subject"] = subject; if (dateCreated != DateTime.MinValue) { data["date_created"] = DateTimeToUnixTimestamp(dateCreated); } data["is_resume"] = isResume.ToString().ToLower(); Dictionary<string, string> requestFiles = new Dictionary<string, string>(); int counter = 1; foreach (string file in files) { requestFiles.Add("file" + counter.ToString(), file); counter++; } AddEmailActivityResponse response = new AddEmailActivityResponse( MakeRequest("add_email_activity", data, requestFiles) ); return response; }
// Token: 0x0600149C RID: 5276 RVA: 0x0023B52C File Offset: 0x0023972C public override bool CheckValueChanged(ushort Key, ushort Val) { if (Key == 103) { EActivityCircleEventType eactivityCircleEventType = (EActivityCircleEventType)Val; if (eactivityCircleEventType != EActivityCircleEventType.EACET_SoloEvent) { if (eactivityCircleEventType != EActivityCircleEventType.EACET_InfernalEvent) { return(false); } Key = 104; } ActivityDataType activityDataType = ActivityManager.Instance.ActivityData[(int)Val]; ushort num = 0; for (int i = 0; i < 3; i++) { if (activityDataType.RequireScore[i] > 0u && activityDataType.EventScore >= (ulong)activityDataType.RequireScore[i]) { num += 1; } } if (this.RecordMark[(int)Key] >= num) { return(false); } Val = num; } else if (Key == 136) { switch (Val) { case 0: goto IL_DD; case 2: Key = 138; goto IL_DD; case 3: Key = 137; goto IL_DD; } return(false); IL_DD: ActivityDataType activityDataType2 = ActivityManager.Instance.KvKActivityData[(int)Val]; ushort num2 = 0; for (int j = 0; j < 3; j++) { if (activityDataType2.RequireScore[j] > 0u && activityDataType2.EventScore >= (ulong)activityDataType2.RequireScore[j]) { num2 += 1; } } if (this.RecordMark[(int)Key] >= num2) { return(false); } Val = num2; } else if (Key == 186) { EActivityKingdomEventType eactivityKingdomEventType = (EActivityKingdomEventType)Val; if (eactivityKingdomEventType == EActivityKingdomEventType.EAKET_SoloEvent) { Key = 187; } else if (eactivityKingdomEventType != EActivityKingdomEventType.EAKET_AllianceEvent) { return(false); } if (ActivityManager.Instance.IsInKvK(0, false)) { if (Key == 186) { Key = 137; } else { Key = 138; } } ActivityDataType activityDataType3 = ActivityManager.Instance.FIFAData[(int)Val]; ushort num3 = 0; for (int k = 0; k < 3; k++) { if (activityDataType3.RequireScore[k] > 0u && activityDataType3.EventScore >= (ulong)activityDataType3.RequireScore[k]) { num3 += 1; } } if (this.RecordMark[(int)Key] >= num3) { return(false); } Val = num3; } if (DataManager.MissionDataManager.GetMarkNarrativeType(Key) == _eMarkAimNarrativeType.Accumlate) { ushort[] recordMark = this.RecordMark; ushort num4 = Key; recordMark[(int)num4] = recordMark[(int)num4] + Val; } else if (this.RecordMark[(int)Key] < Val) { this.RecordMark[(int)Key] = Val; } if (!base.CheckValueChanged(Key, this.RecordMark[(int)Key])) { return(false); } GUIManager.Instance.UpdateUI(EGUIWindow.Door, 15, 0); return(true); }
public AddActivityResponse AddActivity(ActivityDataType dataType, int id, string notes, ActivityType activityType = ActivityType.Other, int joborderId = -1) { Dictionary<string, string> data = new Dictionary<string, string>(); data["data_type"] = CamelCaseToUnderscore(Enum.GetName(typeof(ActivityDataType), dataType)); data["id"] = id.ToString(); data["type"] = CamelCaseToUnderscore(Enum.GetName(typeof(ActivityType), activityType)); data["notes"] = notes; if (joborderId != -1) { data["joborder_id"] = joborderId.ToString(); } AddActivityResponse response = new AddActivityResponse(MakeRequest("add_activity", data)); return response; }
public static ActivityDataType MapActivity(NamedNullMappingDataReader readerEx) { ActivityDataType activity = new ActivityDataType(); activity.ActivityDescription = new ActivityDescriptionDataType(); activity.ActivityDescription.ActivityIdentifier = readerEx.GetString("ACTIVITYID"); activity.ActivityDescription.ActivityTypeCode = readerEx.GetString("ACTIVITYTYPECODE"); activity.ActivityDescription.ActivityMediaName = readerEx.GetString("ACTIVITYMEDIA"); activity.ActivityDescription.ActivityMediaSubdivisionName = readerEx.GetNullString("ACTIVITYMEDIASUBDIVISION"); activity.ActivityDescription.ActivityStartDate = readerEx.GetDateTime("ACTIVITYSTARTDATE"); activity.ActivityDescription.ActivityStartTime = GetNullTimeData(readerEx, "STARTTIME", "STARTTIMEZONE"); activity.ActivityDescription.ActivityEndDateSpecified = !readerEx.IsDBNull("ACTIVITYENDDATE"); if (activity.ActivityDescription.ActivityEndDateSpecified) { activity.ActivityDescription.ActivityEndDate = readerEx.GetDateTime("ACTIVITYENDDATE"); } activity.ActivityDescription.ActivityEndTime = GetNullTimeData(readerEx, "ENDTIME", "ENDTIMEZONE"); activity.ActivityDescription.ActivityRelativeDepthName = readerEx.GetNullString("RELATIVEDEPTH"); activity.ActivityDescription.ActivityDepthHeightMeasure = GetNullMeasureCompactData(readerEx, "DEPTHHEIGHTMEASURE", "DEPTHHEIGHTMEASUREUNIT"); activity.ActivityDescription.ActivityTopDepthHeightMeasure = GetNullMeasureCompactData(readerEx, "TOPDEPTHHEIGHTMEASURE", "TOPDEPTHHEIGHTMEASUREUNIT"); activity.ActivityDescription.ActivityBottomDepthHeightMeasure = GetNullMeasureCompactData(readerEx, "BOTTOMDEPTHHEIGHTMEASURE", "BOTTOMDEPTHHEIGHTMEASUREUNIT"); activity.ActivityDescription.ActivityDepthAltitudeReferencePointText = readerEx.GetNullString("DEPTHALTITUDEREFPOINT"); activity.ActivityDescription.MonitoringLocationIdentifier = readerEx.GetNullString("MONLOCID"); activity.ActivityDescription.ActivityCommentText = readerEx.GetNullString("ACTIVITYCOMMENT"); if (!readerEx.IsDBNull("LATITUDEMEASURE") || !readerEx.IsDBNull("LONGITUDEMEASURE") || !readerEx.IsDBNull("HORIZCOLLMETHOD") || !readerEx.IsDBNull("HORIZCOORDREFSYSDATUM")) { activity.ActivityLocation = new ActivityLocationDataType(); activity.ActivityLocation.LatitudeMeasure = ToDecimal(readerEx.GetString("LATITUDEMEASURE")); activity.ActivityLocation.LongitudeMeasure = ToDecimal(readerEx.GetString("LONGITUDEMEASURE")); activity.ActivityLocation.SourceMapScaleNumeric = readerEx.GetNullString("SOURCEMAPSCALE"); activity.ActivityLocation.HorizontalAccuracyMeasure = GetNullMeasureCompactData(readerEx, "HORIZACCURACYMEASURE", "HORIZACCURACYMEASUREUNIT"); activity.ActivityLocation.HorizontalCollectionMethodName = readerEx.GetString("HORIZCOLLMETHOD"); activity.ActivityLocation.HorizontalCoordinateReferenceSystemDatumName = readerEx.GetString("HORIZCOORDREFSYSDATUM"); } activity.BiologicalActivityDescription = new BiologicalActivityDescriptionDataType(); activity.BiologicalActivityDescription.AssemblageSampledName = readerEx.GetNullString("BIOACTIVITYASSEMBLAGESAMPD"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation = new BiologicalHabitatCollectionInformationDataType(); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.CollectionDuration = GetNullMeasureCompactData(readerEx, "BIOHABCOLLDURATIONMEASURE", "BIOHABCOLLDURATIONMEASUREUNIT"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.SamplingComponentName = readerEx.GetNullString("BIOHABSAMPCOMP"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.SamplingComponentPlaceInSeriesNumeric = readerEx.GetNullString("BIOHABSAMPCOMPPLACEINSERIES"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.ReachWidthMeasure = GetNullMeasureCompactData(readerEx, "BIOHABREACHLENGTHMEASURE", "BIOHABREACHLENGTHMEASUREUNIT"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.ReachLengthMeasure = GetNullMeasureCompactData(readerEx, "BIOHABREACHWIDTHMEASURE", "BIOHABREACHWIDTHMEASUREUNIT"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.PassCount = readerEx.GetNullString("BIOHABPASSCOUNT"); if (!readerEx.IsDBNull("BIOHABNETTYPE") || !readerEx.IsDBNull("BIOHABNETSURFACEAREAMEASURE") || !readerEx.IsDBNull("BIOHABNETSURFACEMEASUREUNIT") || !readerEx.IsDBNull("BIOHABNETMESHSIZEMEASURE") || !readerEx.IsDBNull("BIOHABNETMESHMEASUREUNIT")) { activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.NetInformation = new NetInformationDataType(); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.NetInformation.NetTypeName = readerEx.GetString("BIOHABNETTYPE"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.NetInformation.NetSurfaceAreaMeasure = GetNullMeasureCompactData(readerEx, "BIOHABNETSURFACEAREAMEASURE", "BIOHABNETSURFACEMEASUREUNIT"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.NetInformation.NetMeshSizeMeasure = GetNullMeasureCompactData(readerEx, "BIOHABNETMESHSIZEMEASURE", "BIOHABNETMESHMEASUREUNIT"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.NetInformation.BoatSpeedMeasure = GetNullMeasureCompactData(readerEx, "BIOHABNETBOATSPEEDMEASURE", "BIOHABNETBOATSPEEDMEASUREUNIT"); activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.NetInformation.CurrentSpeedMeasure = GetNullMeasureCompactData(readerEx, "BIOHABNETCURRSPEEDMEASURE", "BIOHABNETCURRSPEEDMEASUREUNIT"); } if ((activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.CollectionDuration == null) && string.IsNullOrEmpty(activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.SamplingComponentName) && string.IsNullOrEmpty(activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.SamplingComponentPlaceInSeriesNumeric) && (activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.ReachWidthMeasure == null) && (activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.ReachLengthMeasure == null) && string.IsNullOrEmpty(activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.PassCount) && (activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation.NetInformation == null)) { activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation = null; } activity.BiologicalActivityDescription.ToxicityTestType = readerEx.GetNullString("BIOACTIVITYTOXICITYTESTTYPE"); if (string.IsNullOrEmpty(activity.BiologicalActivityDescription.AssemblageSampledName) && string.IsNullOrEmpty(activity.BiologicalActivityDescription.ToxicityTestType) && (activity.BiologicalActivityDescription.BiologicalHabitatCollectionInformation == null)) { activity.BiologicalActivityDescription = null; } activity.SampleDescription = new SampleDescriptionDataType(); if (!readerEx.IsDBNull("SAMPCOLLMETHODID") || !readerEx.IsDBNull("SAMPCOLLMETHODIDCONTEXT") || !readerEx.IsDBNull("SAMPCOLLMETHOD")) { activity.SampleDescription.SampleCollectionMethod = new ReferenceMethodDataType(); activity.SampleDescription.SampleCollectionMethod.MethodIdentifier = readerEx.GetString("SAMPCOLLMETHODID"); activity.SampleDescription.SampleCollectionMethod.MethodIdentifierContext = readerEx.GetString("SAMPCOLLMETHODIDCONTEXT"); activity.SampleDescription.SampleCollectionMethod.MethodName = readerEx.GetString("SAMPCOLLMETHOD"); activity.SampleDescription.SampleCollectionMethod.MethodQualifierTypeName = readerEx.GetNullString("SAMPCOLLMETHODQUALIFIER"); activity.SampleDescription.SampleCollectionMethod.MethodDescriptionText = readerEx.GetNullString("SAMPCOLLMETHODDESC"); } activity.SampleDescription.SampleCollectionEquipmentName = readerEx.GetString("SAMPCOLLEQUIPMENT"); activity.SampleDescription.SampleCollectionEquipmentCommentText = readerEx.GetNullString("SAMPCOLLEQUIPMENTCOMMENT"); if (!readerEx.IsDBNull("SAMPPREPCONTTYPE") || !readerEx.IsDBNull("SAMPPREPCONTCOLOR") || !readerEx.IsDBNull("SAMPPREPCONTSAMPTRANSSTORDESC") || !readerEx.IsDBNull("SAMPPREPID") || !readerEx.IsDBNull("SAMPPREPIDCONTEXT") || !readerEx.IsDBNull("SAMPPREP")) { activity.SampleDescription.SamplePreparation = new SamplePreparationDataType(); if (!readerEx.IsDBNull("SAMPPREPID") || !readerEx.IsDBNull("SAMPPREPIDCONTEXT") || !readerEx.IsDBNull("SAMPPREP")) { activity.SampleDescription.SamplePreparation.SamplePreparationMethod = new ReferenceMethodDataType(); activity.SampleDescription.SamplePreparation.SamplePreparationMethod.MethodIdentifier = readerEx.GetString("SAMPPREPID"); activity.SampleDescription.SamplePreparation.SamplePreparationMethod.MethodIdentifierContext = readerEx.GetString("SAMPPREPIDCONTEXT"); activity.SampleDescription.SamplePreparation.SamplePreparationMethod.MethodName = readerEx.GetString("SAMPPREP"); activity.SampleDescription.SamplePreparation.SamplePreparationMethod.MethodQualifierTypeName = readerEx.GetNullString("SAMPPREPQUALIFIERTYPE"); activity.SampleDescription.SamplePreparation.SamplePreparationMethod.MethodDescriptionText = readerEx.GetNullString("SAMPPREPDESC"); } activity.SampleDescription.SamplePreparation.SampleContainerTypeName = readerEx.GetString("SAMPPREPCONTTYPE"); activity.SampleDescription.SamplePreparation.SampleContainerColorName = readerEx.GetString("SAMPPREPCONTCOLOR"); activity.SampleDescription.SamplePreparation.ChemicalPreservativeUsedName = readerEx.GetNullString("SAMPPREPCONTCHEMPRESERVUSED"); activity.SampleDescription.SamplePreparation.ThermalPreservativeUsedName = readerEx.GetNullString("SAMPPREPCONTTHERMALPRESERVUSED"); activity.SampleDescription.SamplePreparation.SampleTransportStorageDescription = readerEx.GetString("SAMPPREPCONTSAMPTRANSSTORDESC"); } if (activity.SampleDescription.SampleCollectionMethod == null) { DebugUtils.AssertDebuggerBreak(string.IsNullOrEmpty(activity.SampleDescription.SampleCollectionEquipmentName)); // SampleCollectionMethod is required activity.SampleDescription = null; } activity.ResultCount = readerEx.GetNullString("RESULTCOUNT"); // TODO: TMPACTIVITYTYPE and TMPPROJECTID not used return(activity); }