//TODO: Use Mediator Patterns public SecondaryFormPoints(SecondaryIncident secondaryIncident) { _SunstarThreeDigitUnit = secondaryIncident.Sunstar3DigitUnit; _NatureOfCall = secondaryIncident.NatureOfCall; _Location = secondaryIncident.Location; _MapGrid = secondaryIncident.MapGrid; _FdUnitAndTacCh = secondaryIncident.FDUnitsAndTacCh; _Documented1 = secondaryIncident.ScriptingDocumented; _SevMin = secondaryIncident.SevenMin; _TwelveMin = secondaryIncident.TwelveMin; _EtaLocationAsked = secondaryIncident.ETALocationAsked; _Documented2 = secondaryIncident.ETADocumented; _ProactiveRoutingGiven = secondaryIncident.ProactiveRoutingGiven; _CorrectRouting = secondaryIncident.CorrectRouting; _Documented3 = secondaryIncident.RoutingDocumented; _PreArrivalGiven = secondaryIncident.PreArrivalGiven; _Documented4 = secondaryIncident.EMDDocumented; _DisplayedServiceAttitude = secondaryIncident.DisplayedServiceAttitude; _UsedCorrectVolTone = secondaryIncident.UsedCorrectVolumeTone; _UsedProhibitedBehavior = secondaryIncident.UsedProhibitedBehavior; }
public static void SecondaryIncident_Update(SecondaryIncident input) { SqlConnection connection = new SqlConnection(_ConnectionString); SqlCommand command = new SqlCommand("SecondaryIncident_Update", connection); command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@SecondaryIncidentId", input.SecondaryIncidentId); command.Parameters.AddWithValue("@ChannelId", input.Channel.ChannelId); command.Parameters.AddWithValue("@DispatcherId", input.Dispatcher.DispatcherId); command.Parameters.AddWithValue("@ShiftId", input.Shift.ShiftId); command.Parameters.AddWithValue("@DateTime", input.DateTime); command.Parameters.AddWithValue("@Sunstar3DigitNumber", input.Sunstar3DigitUnit); command.Parameters.AddWithValue("@NatureOfCall", input.NatureOfCall); command.Parameters.AddWithValue("@Location", input.Location); command.Parameters.AddWithValue("@MapGrid", input.MapGrid); command.Parameters.AddWithValue("@FDUnitsAndTacCh", input.FDUnitsAndTacCh); command.Parameters.AddWithValue("@ScriptingDocumented", input.ScriptingDocumented); command.Parameters.AddWithValue("@SevenMin", input.SevenMin); command.Parameters.AddWithValue("@TwelveMin", input.TwelveMin); command.Parameters.AddWithValue("@ETALocationAsked", input.ETALocationAsked); command.Parameters.AddWithValue("@ETADocumented", input.EMDDocumented); command.Parameters.AddWithValue("@ProactiveRoutingGiven", input.ProactiveRoutingGiven); command.Parameters.AddWithValue("@CorrectRouting", input.CorrectRouting); command.Parameters.AddWithValue("@RoutingDocumented", input.RoutingDocumented); command.Parameters.AddWithValue("@PreArrivalGiven", input.PreArrivalGiven); command.Parameters.AddWithValue("@EMDDocumented", input.EMDDocumented); command.Parameters.AddWithValue("@DisplayedServiceAttitude", input.DisplayedServiceAttitude); command.Parameters.AddWithValue("@UsedCorrectVolumeTone", input.UsedCorrectVolumeTone); command.Parameters.AddWithValue("@UsedProhibitedBehavior", input.UsedProhibitedBehavior); command.Parameters.AddWithValue("@PatchedChannels", input.PatchedChannels); command.Parameters.AddWithValue("@Phone", input.Phone); SqlUtility.ExecuteNonQuery(command); }
public static SecondaryIncident GetSecondaryIncident(Guid incidentId) { SecondaryIncident returnValue = new SecondaryIncident(); DataSet secondaryIncidentDataSet = Data.Provider.SecondaryIncident_SelectById(incidentId); returnValue.SecondaryIncidentId = new Guid(secondaryIncidentDataSet.Tables[0].Rows[0]["SecondaryIncidentId"].ToString()); returnValue.Channel = GetChannel(int.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["ChannelId"].ToString())); returnValue.Dispatcher = GetDispatcher(secondaryIncidentDataSet.Tables[0].Rows[0]["DispatcherId"].ToString()); returnValue.Shift = GetShift(int.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["ShiftId"].ToString())); returnValue.DateTime = DateTime.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["DateTime"].ToString()); returnValue.Sunstar3DigitUnit = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["Sunstar3DigitNumber"].ToString()); returnValue.Location = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["Location"].ToString()); returnValue.MapGrid = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["MapGrid"].ToString()); returnValue.NatureOfCall = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["NatureOfCall"].ToString()); returnValue.FDUnitsAndTacCh = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["FDUnitsAndTacCh"].ToString()); returnValue.ScriptingDocumented = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["ScriptingDocumented"].ToString()); returnValue.SevenMin = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["SevenMin"].ToString()); returnValue.TwelveMin = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["TwelveMin"].ToString()); returnValue.ETALocationAsked = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["ETALocationAsked"].ToString()); returnValue.ETADocumented = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["ETADocumented"].ToString()); returnValue.ProactiveRoutingGiven = secondaryIncidentDataSet.Tables[0].Rows[0]["ProactiveRoutingGiven"].ToString(); returnValue.CorrectRouting = secondaryIncidentDataSet.Tables[0].Rows[0]["CorrectRouting"].ToString(); returnValue.RoutingDocumented = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["RoutingDocumented"].ToString()); returnValue.PreArrivalGiven = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["PreArrivalGiven"].ToString()); returnValue.EMDDocumented = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["EMDDocumented"].ToString()); returnValue.DisplayedServiceAttitude = secondaryIncidentDataSet.Tables[0].Rows[0]["DisplayedServiceAttitude"].ToString(); returnValue.UsedCorrectVolumeTone = secondaryIncidentDataSet.Tables[0].Rows[0]["UsedCorrectVolumeTone"].ToString(); returnValue.UsedProhibitedBehavior = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["UsedProhibitedBehavior"].ToString()); returnValue.PatchedChannels = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["PatchedChannels"].ToString()); returnValue.Phone = bool.Parse(secondaryIncidentDataSet.Tables[0].Rows[0]["Phone"].ToString()); return returnValue; }