473,414 Members | 1,954 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

need some suggesions

145 100+
PAY PERIOD NAVIGATION
=====================
I need to have 2 combo boxes (cboFrom and cboTo). these two boxes need to fill with fromdate and todate from a table "tblPayPeriods".

sample pic is attached.



1. I would like default data to be this month and year.
2. I would like put 2 buttons (btnPreviousPeriod and btnNextPeriod). When user clicks on this I would like repopulate the textboxes with respetive from and to date.

I am kinda lost as to what approach I should take. and How will I do it?

I found this article, is this too much coding. I need as little coding as possible because I am going to have lots of coding for this page.
http://www.syncfusion.com/FAQ/aspnet/web_c8c.aspx
Apr 24 '09 #1
3 1217
dorandoran
145 100+
I decided to have one drop down box and my store proc looks like below.
select cast(convert(varchar,MSG.fromdate,101) + ' - ' + convert(varchar,MSG.todate,101) as char(50)) PayPeriod
from dbo.MESSAGES MSG
where (year(fromdate)=@pYear)

I can populate the drop down list with this store procedure. but I dont know how to add the logic to display current pay period (for example, every month we have 2 pay period, 1/1/2009 to 1/15/2009 and 1/16/2009 to 1/31/2009). the drop down list already contains all 2009 pay period (24 records). I like to display 4/16/2009 to 4/30/2009 by default cause thats the month we are in. hope it's making sense.

I also need to program previous and next pay period button? Need some direction please..
Apr 24 '09 #2
dorandoran
145 100+
This works.
protected void btnNextPeriod_Click(object sender, EventArgs e)
{
int intCurrentItem = ddlPayPeriod.SelectedIndex;
ddlPayPeriod.SelectedIndex = intCurrentItem + 1;

}
protected void btnPreviouPeriod_Click(object sender, EventArgs e)
{
int intCurrentItem = ddlPayPeriod.SelectedIndex;
ddlPayPeriod.SelectedIndex = intCurrentItem - 1;

}

==============================================
I would like to fill 2 labels when the selected index change. The fileds are fromdate and todate to lblfrom and lblto.
Apr 24 '09 #3
dorandoran
145 100+
This forum is SUPER slow. I wasnt asking for code snippet. Just wanted some suggesion. I finally got it work. Here is the working code.
Expand|Select|Wrap|Line Numbers
  1.     protected void Page_Load(object sender, EventArgs e)
  2.     {
  3.         //btnPreviouPeriod.Text = "Previous" + "\r" + "Period  ";
  4.         //btnNextPeriod.Text = " Next " + "\r" + "Period";
  5.  
  6.          fillPeriod();       
  7.  
  8.     }
  9.  
  10.     void fillPeriod()
  11.     {
  12.         ddlPayPeriod.DataTextField = "payperiod" ;
  13.         ddlPayPeriod.DataValueField = "payperiod";
  14.         clsTimeCardReports tcr = new clsTimeCardReports();        
  15.         ddlPayPeriod.DataSource = tcr.GetPayPeriods();
  16.         ddlPayPeriod.DataBind();
  17.         string fromValue = ddlPayPeriod.SelectedValue.ToString();
  18.         lblDataFrom.Text = fromValue.Substring(0, 10);
  19.         string toValue = ddlPayPeriod.SelectedValue.ToString();
  20.         lblDataTo.Text = toValue.Substring(13 , 10);
  21.     }
  22.     protected void btnNextPeriod_Click(object sender, EventArgs e)
  23.     {
  24.         int intCurrentItem = ddlPayPeriod.SelectedIndex;
  25.         ddlPayPeriod.SelectedIndex = intCurrentItem + 1;
  26.         string fromValue = ddlPayPeriod.SelectedValue.ToString();
  27.         lblDataFrom.Text = fromValue.Substring(0, 10);
  28.         string toValue = ddlPayPeriod.SelectedValue.ToString();
  29.         lblDataTo.Text = toValue.Substring(13, 10);
  30.  
  31.  
  32.     }
  33.     protected void btnPreviouPeriod_Click(object sender, EventArgs e)
  34.     {
  35.         int intCurrentItem = ddlPayPeriod.SelectedIndex;
  36.         ddlPayPeriod.SelectedIndex = intCurrentItem - 1;
  37.         string fromValue = ddlPayPeriod.SelectedValue.ToString();
  38.         lblDataFrom.Text = fromValue.Substring(0, 10);
  39.         string toValue = ddlPayPeriod.SelectedValue.ToString();
  40.         lblDataTo.Text = toValue.Substring(13, 10);
  41.  
  42.  
  43.     }
  44.  
Apr 24 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Sofia | last post by:
My name is Sofia and I have for many years been running a personals site, together with my partner, on a non-profit basis. The site is currently not running due to us emigrating, but during its...
6
by: Robert Maas, see http://tinyurl.com/uh3t | last post by:
System login message says PHP is available, so I tried this: http://www.rawbw.com/~rem/HelloPlus/h.php It doesn't work at all. Browser just shows the source. What am I doing wrong?
0
by: Gregory Nans | last post by:
hello, i need some help to 'tree-ify' a string... for example i have strings such as : s = """A(here 's , B(A ) silly test) C(to show D(what kind) of stuff i need))""" and i need to...
7
by: Mike Kamermans | last post by:
I hope someone can help me, because what I'm going through at the moment trying to edit XML documents is enough to make me want to never edit XML again. I'm looking for an XML editor that has a...
8
by: JustSomeGuy | last post by:
I need to write an new class derived from the list class. This class stores data in the list to the disk if an object that is added to the list is over 1K in size. What methods of the std stl...
3
by: Bob.Henkel | last post by:
I write this to tell you why we won't use postgresql even though we wish we could at a large company. Don't get me wrong I love postgresql in many ways and for many reasons , but fact is fact. If...
2
by: Michael R. Pierotti | last post by:
Dim reg As New Regex("^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$") Dim m As Match = reg.Match(txtIPAddress.Text) If m.Success Then 'No need to do anything here Else MessageBox.Show("You need to enter a...
1
by: lipsa | last post by:
hello all, i need help from u regarding my career move.actually i hd training in .NET when i joined my company.bt right nw i m working in ASP/SQL Server.and i m enjoying it.and i feel there z lots n...
0
by: U S Contractors Offering Service A Non-profit | last post by:
Brilliant technology helping those most in need Inbox Reply U S Contractors Offering Service A Non-profit show details 10:37 pm (1 hour ago) Brilliant technology helping those most in need ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.