StrataFrame Forum
Back
Login
Login
Home
»
Updates and Information
»
StrataFrame Users Contributed Samples
»
Date Range Selector user control
Date Range Selector user control
Post Reply
Like
2
Date Range Selector user control
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
RSS Feed
Goto Topics Forum
Author
Message
Edhy Rijo
E
Edhy Rijo
posted 13 Years Ago
ANSWER
Topic Details
Share Topic
E
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
Hi All,
I am very exited with recent announcement of the StrataFrame Team for the
2012 Roadmap
so with that in mind I would like to share with the community my first ever workable
user control, it is a VB.
This DateRangeSelector user controls allows you to select a pre-defined date periods like Today, This Week-To-Date, This Year, Last Year and many more as well as a Custom Date that will allow the end user to select Start and End dates.
Useful features:
Selected date will used StrataFrame functionality to store that selection in the Registry if the Form's RegistryRepositoryKey is filled.
Public properties to pre-select a date range or each Start and End date values. Look at the "+Progytech: Actions" group in the property sheet.
A SelectedValueChanged event is triggered whenever the date range period has changed. Use this event to fill your BOs or requery your listviews.
The StrataFrame custom error provider is used to validate that the date range is good before passing the values to any method.
Internally we are expecting the based class used as MicroFour.StrataFrame.UI.Windows.Forms.
StandardForm
but feel free to use your own base class.
For learning purpose, I tried to keep this sample project as simple as possible, but in the bizOrders.vb business object I am using a Custom Field Property to show the Customer Name and this field is filled from the FillByDateRange() method in this BO which uses a SQL Query with a JOIN condition to grab the Customer Name as cfp_CustomerName and take advantage of StrataFrame Custom Field Properties functinality.
I hope this sample can be useful to the community and please, feel free to exchange your comments, suggestions and any enhancements to make this User Control better.
Enjoy!!!
Edhy Rijo
Attachments
DateRangeSelector.zip
(
238 views,
141.00 KB
)
Edited
13 Years Ago by
Edhy Rijo
Reply
Like
2
Ivan George Borges
Ivan George Borges
posted 13 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
Well done Edhy!
Here is the Enum I populate mine with, there are some you might want to implement:
''' <summary>
''' Pre-defined Dates Interval
''' </summary>
''' <remarks></remarks>
Public Enum PreDefinedPeriods As Integer
<EnumDisplayValue("PFNTEnum - DefinedBelow", True)> _
DefinedBelow = 1
<EnumDisplayValue("PFNTEnum - Today", True)> _
Today = 2
<EnumDisplayValue("PFNTEnum - LifeToDate", True)> _
LifeToDate = 3
<EnumDisplayValue("PFNTEnum - LifeToFuture", True)> _
LifeToFuture = 4
<EnumDisplayValue("PFNTEnum - TodayToFuture", True)> _
TodayToFuture = 5
<EnumDisplayValue("PFNTEnum - CurrentWeek", True)> _
CurrentWeek = 6
<EnumDisplayValue("PFNTEnum - CurrentMonth", True)> _
CurrentMonth = 7
<EnumDisplayValue("PFNTEnum - CurrentQuarter", True)> _
CurrentQuarter = 8
<EnumDisplayValue("PFNTEnum - CurrentYear", True)> _
CurrentYear = 9
<EnumDisplayValue("PFNTEnum - MonthToDate", True)> _
MonthToDate = 10
<EnumDisplayValue("PFNTEnum - QuarterToDate", True)> _
QuarterToDate = 11
<EnumDisplayValue("PFNTEnum - YearToDate", True)> _
YearToDate = 12
<EnumDisplayValue("PFNTEnum - LastWeek", True)> _
LastWeek = 13
<EnumDisplayValue("PFNTEnum - LastMonth", True)> _
LastMonth = 14
<EnumDisplayValue("PFNTEnum - LastQuarter", True)> _
LastQuarter = 15
<EnumDisplayValue("PFNTEnum - LastYear", True)> _
LastYear = 16
<EnumDisplayValue("PFNTEnum - NextWeek", True)> _
NextWeek = 17
<EnumDisplayValue("PFNTEnum - NextMonth", True)> _
NextMonth = 18
End Enum
Reply
Like
2
Russell Scott Brown
Russell Scott Brown
posted 13 Years Ago
ANSWER
Post Details
Share Post
Group: Forum Members
Posts: 124,
Visits: 597
Very slick and useful.
Thanks Edhy!
Russ Brown (Using C#2010/SQL Server 2008)
Reply
Like
1
Edhy Rijo
E
Edhy Rijo
posted 13 Years Ago
ANSWER
Post Details
Share Post
E
Group: StrataFrame Users
Posts: 2.4K,
Visits: 23K
Thanks Ivan, Russell,
Ivan, about your Enum, there are some like LifeToDate which I don't quite understand, but i believe these are specific to your application, right?
For now I just implemented the ones I needed so the end user would not be overwhelm with options not applicable to the application.
Edhy Rijo
Reply
Like
3
Ivan George Borges
Ivan George Borges
posted 13 Years Ago
ANSWER
Post Details
Share Post
Group: StrataFrame MVPs
Posts: 1.9K,
Visits: 21K
Life to Date would be everything from the past till today.
Life to Future would be everything from the past till everything in the future. So, everything.
And Today to Future, of course, from Today onwards.
Reply
Like
2
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Like
2
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search