TimeColumn Class

Represents a column of type Time

Definition

Namespace: Firefly.Box.Data
Assembly: Firefly.Box (in Firefly.Box.dll) Version: debug-master-v:33791
C#
public class TimeColumn : TypedColumnBase<Time>
Inheritance
Object    ColumnBase    TypedColumnBaseTime    TimeColumn

Remarks

This class manages all the interaction between the user code, and the database storage of this TimeColumn

Example

This example demonstrates the usage of pubs
This example is based on test data. The code for the entities included in this test data can be found in the documentation of Entity
C#
using System.Text;
using Firefly.Box.Data;
using Firefly.Box;
using Firefly.Box.Data.Advanced;
using Firefly.Box.Data.DataProvider;

namespace TestFirefly.Box.Documentation
{
    /// <summary>
    /// This data base is based on tables from the Microsoft demo database "pubs". It's scripts can be downloaded from:
    /// http://www.microsoft.com/downloads/details.aspx?familyid=06616212-0356-46a0-8da2-eebc53a68034&displaylang=en
    /// </summary>

    public class Pubs
    {
        public class Employees : Entity
        {
            [PrimaryKey]
            internal readonly TextColumn Id = new TextColumn("emp_id", "9", "Id");
            internal readonly TextColumn FirstName = new TextColumn("fname", "20", "First name");
            internal readonly TextColumn MiddleInitial = new TextColumn("minit", "1", "Middle initial");
            internal readonly TextColumn LastName = new TextColumn("lname", "30", "Last name");
            internal readonly JobId JobId = new JobId();
            internal readonly JobLevel JobLevel = new JobLevel();
            internal readonly PublisherId PublisherId = new PublisherId();

            public Employees():base("employee",DataSource)
            {
            }
            public void InitializeWithTestData()
            {
                Truncate();
                Insert("A-C71970F", "Aria", "", "Cruz", 10, 87, "1389");
                Insert("A-R89858F", "Annette", "", "Roulet", 6, 152, "9999");
                Insert("AMD15433F", "Ann", "M", "Devon", 3, 200, "9952");
                Insert("ARD36773F", "Anabela", "R", "Domingues", 8, 100, "0877");
                Insert("CFH28514M", "Carlos", "F", "Hernadez", 5, 211, "9999");
                Insert("CGS88322F", "Carine", "G", "Schmitt", 13, 64, "1389");
                Insert("DBT39435M", "Daniel", "B", "Tonini", 11, 75, "0877");
                Insert("DWR65030M", "Diego", "W", "Roel", 6, 192, "1389");
                Insert("ENL44273F", "Elizabeth", "N", "Lincoln", 14, 35, "0877");
                Insert("F-C16315M", "Francisco", "", "Chang", 4, 227, "9952");
                Insert("GHT50241M", "Gary", "H", "Thomas", 9, 170, "0736");
                Insert("H-B39728F", "Helen", "", "Bennett", 12, 35, "0877");
                Insert("HAN90777M", "Helvetius", "A", "Nagy", 7, 120, "9999");
                Insert("HAS54740M", "Howard", "A", "Snyder", 12, 100, "0736");
                Insert("JYL26161F", "Janine", "Y", "Labrune", 5, 172, "9901");
                Insert("KFJ64308F", "Karin", "F", "Josephs", 14, 100, "0736");
                Insert("KJJ92907F", "Karla", "J", "Jablonski", 9, 170, "9999");
                Insert("L-B31947F", "Lesley", "", "Brown", 7, 120, "0877");
                Insert("LAL21447M", "Laurence", "A", "Lebihan", 5, 175, "0736");
                Insert("M-L67958F", "Maria", "", "Larsson", 7, 135, "1389");
                Insert("M-P91209M", "Manuel", "", "Pereira", 8, 101, "9999");
                Insert("M-R38834F", "Martine", "", "Rance", 9, 75, "0877");
                Insert("MAP77183M", "Miguel", "A", "Paolino", 11, 112, "1389");
                Insert("MAS70474F", "Margaret", "A", "Smith", 9, 78, "1389");
                Insert("MFS52347M", "Martin", "F", "Sommer", 10, 165, "0736");
                Insert("MGK44605M", "Matti", "G", "Karttunen", 6, 220, "0736");
                Insert("MJP25939M", "Maria", "J", "Pontes", 5, 246, "1756");
                Insert("MMS49649F", "Mary", "M", "Saveley", 8, 175, "0736");
                Insert("PCM98509F", "Patricia", "C", "McKenna", 11, 150, "9999");
                Insert("PDI47470M", "Palle", "D", "Ibsen", 7, 195, "0736");
                Insert("PHF38899M", "Peter", "H", "Franken", 10, 75, "0877");
                Insert("PMA42628M", "Paolo", "M", "Accorti", 13, 35, "0877");
                Insert("POK93028M", "Pirkko", "O", "Koskitalo", 10, 80, "9999");
                Insert("PSA89086M", "Pedro", "S", "Afonso", 14, 89, "1389");
                Insert("PSP68661F", "Paula", "S", "Parente", 8, 125, "1389");
                Insert("PTC11962M", "Philip", "T", "Cramer", 2, 215, "9952");
                Insert("PXH22250M", "Paul", "X", "Henriot", 5, 159, "0877");
                Insert("R-M53550M", "Roland", "", "Mendel", 11, 150, "0736");
                Insert("RBM23061F", "Rita", "B", "Muller", 5, 198, "1622");
                Insert("SKO22412M", "Sven", "K", "Ottlieb", 5, 150, "1389");
                Insert("TPO55093M", "Timothy", "P", "O'Rourke", 13, 100, "0736");
                Insert("VPA30890F", "Victoria", "P", "Ashworth", 6, 140, "0877");
                Insert("Y-L77953M", "Yoshi", "", "Latimer", 12, 32, "1389");
            }
            public void Insert(Text id,Text firstName,Text middleInitial,Text lastName,int jobid,int jobLevel,string publisherId)
            {
                Employees e = new Employees();
                BusinessProcess bp = new BusinessProcess();
                bp.From = e;
                bp.AddAllColumns();
                bp.Activity = Activities.Insert;
                bp.ForFirstRow(delegate()
                          {
                              e.Id.Value = id;
                              e.FirstName.Value = firstName;
                              e.MiddleInitial.Value = middleInitial;
                              e.LastName.Value = lastName;
                              e.JobId.Value = jobid;
                              e.JobLevel.Value = jobLevel;
                              e.PublisherId.Value = publisherId;
                          });
            }
        }
        public class Jobs : Entity
        {
            [PrimaryKey]
            internal readonly JobId Id = new JobId();
            internal readonly TextColumn Description = new TextColumn("Job_desc", "50", "Description");
            internal readonly JobLevel MinLevel = new JobLevel("min_lvl"){Caption = "Min Level"};
            internal readonly JobLevel MaxLevel = new JobLevel("max_lvl"){Caption = "Max Level"};
            public Jobs():base("jobs",DataSource)
            {
            }
            public void InitializeWithTestData()
            {
                Truncate();
                Insert(1, "New Hire - Job not specified", 10, 10);
                Insert(2, "Chief Executive Officer", 200, 250);
                Insert(3, "Business Operations Manager", 175, 225);
                Insert(4, "Chief Financial Officier", 175, 250);
                Insert(5, "Publisher", 150, 250);
                Insert(6, "Managing Editor", 140, 225);
                Insert(7, "Marketing Manager", 120, 200);
                Insert(8, "Public Relations Manager", 100, 175);
                Insert(9, "Acquisitions Manager", 75, 175);
                Insert(10, "Productions Manager", 75, 165);
                Insert(11, "Operations Manager", 75, 150);
                Insert(12, "Editor", 25, 100);
                Insert(13, "Sales Representative", 25, 100);
                Insert(14, "Designer", 25, 100);
            }


            public void Insert(int jobId,Text description,int minLevel,int maxLevel)
            {
                Jobs j = new Jobs();
                BusinessProcess bp = new BusinessProcess();
                bp.From = j;
                bp.AddAllColumns();
                bp.Activity = Activities.Insert;
                bp.ForFirstRow(delegate()
                          {
                              j.Id.Value = jobId;
                              j.Description.Value = description;
                              j.MinLevel.Value = minLevel;
                              j.MaxLevel.Value = maxLevel;
                          });
            }
        }
        public class Publishers : Entity
        {
            [PrimaryKey]
            internal readonly PublisherId Id = new PublisherId();
            internal readonly TextColumn Name = new TextColumn("pub_name", "40", "Name");
            internal readonly TextColumn City = new TextColumn("City", "20");
            internal readonly TextColumn State = new TextColumn("State", "2");
            internal readonly TextColumn Country = new TextColumn("Country");
            public Publishers():base("Publishers",DataSource)
            {
            }
            public void InitializeWithTestData()
            {
                Truncate();
                Insert("0736", "New Moon Books", "Boston", "MA", "USA");
                Insert("0877", "Binnet & Hardley", "Washington", "DC", "USA");
                Insert("1389", "Algodata Infosystems", "Berkeley", "CA", "USA");
                Insert("1622", "Five Lakes Publishing", "Chicago", "IL", "USA");
                Insert("1756", "Ramona Publishers", "Dallas", "TX", "USA");
                Insert("9901", "GGG&G", "Mnchen", "", "Germany");
                Insert("9952", "Scootney Books", "New York", "NY", "USA");
                Insert("9999", "Lucerne Publishing", "Paris", "", "France");
            }

            public void Insert(Text publisherId,Text name,Text city,Text state,Text country)
            {
                Publishers p = new Publishers();
                BusinessProcess bp = new BusinessProcess();
                bp.From = p;
                bp.AddAllColumns();
                bp.Activity = Activities.Insert;
                bp.ForFirstRow(delegate()
                          {
                              p.Id.Value = publisherId;
                              p.Name.Value = name;
                              p.City.Value = city;
                              p.State.Value = state;
                              p.Country.Value = country;
                          });
            }
        }
        static Pubs()
        {
            // a dataset datasource
            DataSource = new DataSetDataProvider();
            // An mssql datasource that access the pubs db
            /*DataSource =
                SQLDataProviderBase.CreateSqlClientDataProvider(
                    "Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=pubs;Data Source=(local)\\SQLEXPRESS;Connect Timeout=5;");*/
        }

        public static readonly DataSetDataProvider DataSource;

        public class JobId : NumberColumn
        {
            public JobId()
                : base("job_id", "2", "Job Id")
            {
            }
        }

        public class JobLevel : NumberColumn
        {
            public JobLevel(string name)
                : base(name ?? "job_lvl", "3", "Job level")
            {
            }
            public JobLevel()
                : this(null)
            {
            }
        }
        public class PublisherId : TextColumn
        {
            public PublisherId()
                : base("pub_id", "4", "publisher id")
            {
            }
        }
    }
}

Constructors

TimeColumnInitializes a new instance of the TimeColumn class
TimeColumn(String)Initializes a new instance of the TimeColumn class
TimeColumn(String, String)Initializes a new instance of the TimeColumn class
TimeColumn(String, String, String)Initializes a new instance of the TimeColumn class

Properties

__RecomputePath
(Inherited from ColumnBase)
AfterExpandGoToNextControl Returns an Boolean that represents additional settings for the Expand event
(Inherited from ColumnBase)
AllowNull Gets or sets whether this column allows null values in it's Value property
(Inherited from TypedColumnBasedataType)
CaptionGets or sets the ColumnBase's caption
(Inherited from ColumnBase)
DateColumnForDateTimeStorage 
DbReadOnly Determines if this column is only read from the database but not saved to it.
(Inherited from ColumnBase)
DefaultValue
(Inherited from TypedColumnBasedataType)
DisplayName
(Inherited from ColumnBase)
Entity Gets the Entity to which this column is bound.
(Inherited from ColumnBase)
ExcludeFromDbWhere
(Inherited from ColumnBase)
FormatTo be completed
(Inherited from TypedColumnBasedataType)
FormatInfo Used to provide additional info on the specified Format
(Inherited from ColumnBase)
Hour 
InputRange Get or sets this column's input range.
(Inherited from ColumnBase)
Minute 
NameGets or sets the ColumnBase's name
(Inherited from ColumnBase)
NullDisplayText Gets or sets the text that will be displayed if this column's Value is null.
(Inherited from ColumnBase)
OnChangeMarkRowAsChanged Determines if the UIController.RowChanged property will be set, when this column is changed.
(Inherited from ColumnBase)
OriginalValue
(Inherited from TypedColumnBasedataType)
Second 
Storage
(Inherited from TypedColumnBasedataType)
TotalSeconds 
Value
(Inherited from TypedColumnBasedataType)
WasSet
(Inherited from ColumnBase)

Methods

AddDeltaOf 
AddHours 
AddMinutes 
AddSeconds 
AdjustGetValue
(Inherited from TypedColumnBasedataType)
AdjustSetValue
(Inherited from TypedColumnBasedataType)
AreEqualOrdinal
(Inherited from TypedColumnBasedataType)
BindValue(FuncdataType) Binds the value of this column to the specified expression
(Inherited from TypedColumnBasedataType)
BindValue(TypedColumnBasedataType)
(Inherited from TypedColumnBasedataType)
BindValueToColumnChange Sets an expression that will be used for the value of this column
(Inherited from TypedColumnBasedataType)
CanYouBeQueried
(Inherited from ColumnBase)
Cast
(Overrides TypedColumnBasedataTypeCast(Object))
Compare
(Inherited from TypedColumnBasedataType)
CompareValueFromDbWithFilterValue
(Inherited from TypedColumnBasedataType)
DbAreEqual
(Inherited from TypedColumnBasedataType)
DbValueStartsWithFilterValue
(Inherited from TypedColumnBasedataType)
Equals
(Inherited from TypedColumnBasedataType)
FinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
ForceIncrementalSearchWhenCurrentValueMeetsCriteria
(Inherited from TypedColumnBasedataType)
GetHashCode
(Inherited from TypedColumnBasedataType)
GetTypeGets the Type of the current instance.
(Inherited from Object)
GetValueFromDB
(Inherited from TypedColumnBasedataType)
IsBetween(FuncdataType, dataType)Creates a filter that represents a between relation between this column and the values specified
(Inherited from TypedColumnBasedataType)
IsBetween(FuncdataType, TypedColumnBasedataType)Creates a filter that represents a between relation between this column and the values specified
(Inherited from TypedColumnBasedataType)
IsBetween(FuncdataType, FuncdataType)Creates a filter that represents a between relation between this column and the values specified
(Inherited from TypedColumnBasedataType)
IsBetween(dataType, dataType)
(Inherited from TypedColumnBasedataType)
IsBetween(dataType, TypedColumnBasedataType)Creates a filter that represents a between relation between this column and the values specified
(Inherited from TypedColumnBasedataType)
IsBetween(dataType, FuncdataType)Creates a filter that represents a between relation between this column and the values specified
(Inherited from TypedColumnBasedataType)
IsBetween(TypedColumnBasedataType, dataType)Creates a filter that represents a between relation between this column and the values specified
(Inherited from TypedColumnBasedataType)
IsBetween(TypedColumnBasedataType, TypedColumnBasedataType)Creates a filter that represents a between relation between this column and the values specified
(Inherited from TypedColumnBasedataType)
IsBetween(TypedColumnBasedataType, FuncdataType)Creates a filter that represents a between relation between this column and the values specified
(Inherited from TypedColumnBasedataType)
IsDifferentFrom(FuncdataType)
(Inherited from TypedColumnBasedataType)
IsDifferentFrom(dataType)
(Inherited from TypedColumnBasedataType)
IsDifferentFrom(TypedColumnBasedataType)
(Inherited from TypedColumnBasedataType)
IsEqualTo(FuncdataType)Creates a filter that represents the is equal to relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsEqualTo(dataType)Creates a filter that represents the is equal to relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsEqualTo(TypedColumnBasedataType)Creates a filter that represents the is equal to relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsGreaterOrEqualTo(FuncdataType)Creates a filter that represents the is greater or equal to relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsGreaterOrEqualTo(dataType)Creates a filter that represents the is greater or equal to relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsGreaterOrEqualTo(TypedColumnBasedataType)Creates a filter that represents the is greater or equal to relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsGreaterThan(FuncdataType)Creates a filter that represents the is greater than relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsGreaterThan(dataType)Creates a filter that represents the is greater than relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsGreaterThan(TypedColumnBasedataType)Creates a filter that represents the is greater than relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsLessOrEqualTo(FuncdataType)Creates a filter that represents the is less or equal to relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsLessOrEqualTo(dataType)Creates a filter that represents the is less or equal to relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsLessOrEqualTo(TypedColumnBasedataType)Creates a filter that represents the is less or equal to relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsLessThan(FuncdataType)Creates a filter that represents the is less than relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsLessThan(dataType)Creates a filter that represents the is less than relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsLessThan(TypedColumnBasedataType)Creates a filter that represents the is less than relation between this column and the value specified
(Inherited from TypedColumnBasedataType)
IsNull
(Inherited from TypedColumnBasedataType)
LoadFrom
(Inherited from TypedColumnBasedataType)
MemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
OnFormatChanged
(Inherited from TypedColumnBasedataType)
Parse
(Inherited from TypedColumnBasedataType)
ProcessUserInput
(Inherited from TypedColumnBasedataType)
ResetToDefaultValue
(Inherited from TypedColumnBasedataType)
SaveYourValueToDb
(Inherited from TypedColumnBasedataType)
ToString
(Inherited from TypedColumnBasedataType)
ToString(String)
(Inherited from TypedColumnBasedataType)
ToString(String, IFormatProvider)Formats the value of the current instance using the specified format.
(Inherited from ColumnBase)

Events

Expand Occurs when the user parks on a control that is bound to this column and invokes the ExpandCommand
(Inherited from ColumnBase)
ValueChanged Occurs when the Value of this column changes
(Inherited from TypedColumnBasedataType)

Operators

Extension Methods

ShouldBeTime
(Defined by Should)

See Also