Пример #1
0
		// ------------------------------------------------------------------

		/// <summary>
		/// Load an object by a given ID.
		/// </summary>
		public static TicketEvent GetByID(
			int id )
		{
			DataRow row = AdoNetSqlHelper.ExecuteRow(
				"GetTicketEventByID",
				new AdoNetSqlParamCollection(
				AdoNetSqlParamCollection.CreateParameter( "@ID", id )
				) );

			if ( row == null )
			{
				return null;
			}
			else
			{
				TicketEvent o = new TicketEvent();
				o.Load( row );

				if ( o.IsEmpty )
				{
					return null;
				}
				else
				{
					return o;
				}
			}
		}
Пример #2
0
		public TicketEditForm(
			DBObjects.Ticket item )
		{
			this.item = item;

			// Create auto-event if required.
			if ( item.IsEmpty )
			{
				autoEventItem = new DBObjects.TicketEvent();
				autoEventItem.Description = autoEventItemEmptyDescription;
			}

			InitializeComponent();
		}
Пример #3
0
		/// <summary>
		/// Load all for the given parent.
		/// </summary>
		public static TicketEvent[] GetForTicket(
			Ticket parentObject )
		{
			DataTable table = AdoNetSqlHelper.ExecuteTable(
				"GetTicketEventsByTicketID",
				new AdoNetSqlParamCollection(
				AdoNetSqlParamCollection.CreateParameter( "@ID", parentObject.ID )
				) );

			if ( table == null )
			{
				return null;
			}
			else
			{
				ArrayList result = new ArrayList();

				foreach ( DataRow row in table.Rows )
				{
					TicketEvent o = new TicketEvent();
					o.Load( row );

					if ( !o.IsEmpty )
					{
						result.Add( o );
					}
				}

				if ( result.Count <= 0 )
				{
					return null;
				}
				else
				{
					return (TicketEvent[])result.ToArray(
						typeof( TicketEvent ) );
				}
			}
		}
Пример #4
0
		private void newEventToolStripMenuItem_Click( 
			object sender, 
			EventArgs e )
		{
			// Must store parent before adding child.
			Store();

			DBObjects.TicketEvent evt = new DBObjects.TicketEvent();
			evt.TicketID = item.ID;

			TicketEventEditForm form = new TicketEventEditForm( item, evt );
			if ( form.ShowDialog( this ) == DialogResult.OK )
			{
				FillTicketEventList();
			}
		}
Пример #5
0
		public static Ticket[] GetAssignedToUser(
			User user,
			TicketEvent.TicketEventState state )
		{
			if ( user == null )
			{
				return null;
			}
			else
			{
				DataTable table = AdoNetSqlHelper.ExecuteTable(
					"GetTicketsAssignedToUserSamNameWithState",
					new AdoNetSqlParamCollection(
					AdoNetSqlParamCollection.CreateParameter( "@UserSamName", user.SamName ),
					AdoNetSqlParamCollection.CreateParameter( "@State", state.ToString() )
					) );

				if ( table == null )
				{
					return null;
				}
				else
				{
					ArrayList result = new ArrayList();

					foreach ( DataRow row in table.Rows )
					{
						Ticket o = new Ticket();
						o.Load( row );

						if ( !o.IsEmpty )
						{
							result.Add( o );
						}
					}

					if ( result.Count <= 0 )
					{
						return null;
					}
					else
					{
						return (Ticket[])result.ToArray(
							typeof( Ticket ) );
					}
				}
			}
		}
Пример #6
0
		// ------------------------------------------------------------------

		public TicketEventContactTypeWrapper(
			TicketEvent.TicketEventContactType contactType )
		{
			this.contactType = contactType;
		}
Пример #7
0
		// ------------------------------------------------------------------

		public TicketEventStateWrapper(
			TicketEvent.TicketEventState state )
		{
			this.state = state;
		}