473,402 Members | 2,064 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,402 software developers and data experts.

Calander Function

Hi
I am looking for help in elimating weekend and public holidays whilst using
the calendar object in a form. The following is the code so far. Any help
would be apprecialted.

<code>
private void UpdateStage_Click(object sender, System.EventArgs e)
{
double dblJD1 = Convert.ToDouble(JD1.Text);
double dblDD1 = Convert.ToDouble(DD1.Text);
double dblTD1 = (dblJD1 + dblDD1);
TD1.Text = dblTD1.ToString();
CD1.Text = DateAdder(StartDate1.Text,dblTD1);

}

private void FillStartDates(object sender, System.EventArgs e)
{
DateTime StartTime = JobStartCalendar.SelectedDate;
string strStartTime = StartTime.Day + "/" + StartTime.Month + "/" +
StartTime.Year;
StartDate1.Text = strStartTime;

}
public string DateAdder(string Date,double DaysToAdd)
{
string [] DateStuff = Date.Split('/');
int DateDay = Convert.ToInt32(DateStuff[0]);
int DateMonth = Convert.ToInt32(DateStuff[1]);
int DateYear = Convert.ToInt32(DateStuff[2]);
DateTime CurrentTime = new DateTime(DateYear,DateMonth,DateDay);
DateTime NewDate = CurrentTime.AddDays(DaysToAdd);
string strNewDate = NewDate.Day + "/" + NewDate.Month + "/" + NewDate.Year;
return strNewDate;
</code>
Nov 16 '05 #1
1 3291
We appear to have fixed the problem outselves ... so not to worry.
Cheers

"smart-Est" wrote:
Hi
I am looking for help in elimating weekend and public holidays whilst using
the calendar object in a form. The following is the code so far. Any help
would be apprecialted.

<code>
private void UpdateStage_Click(object sender, System.EventArgs e)
{
double dblJD1 = Convert.ToDouble(JD1.Text);
double dblDD1 = Convert.ToDouble(DD1.Text);
double dblTD1 = (dblJD1 + dblDD1);
TD1.Text = dblTD1.ToString();
CD1.Text = DateAdder(StartDate1.Text,dblTD1);

}

private void FillStartDates(object sender, System.EventArgs e)
{
DateTime StartTime = JobStartCalendar.SelectedDate;
string strStartTime = StartTime.Day + "/" + StartTime.Month + "/" +
StartTime.Year;
StartDate1.Text = strStartTime;

}
public string DateAdder(string Date,double DaysToAdd)
{
string [] DateStuff = Date.Split('/');
int DateDay = Convert.ToInt32(DateStuff[0]);
int DateMonth = Convert.ToInt32(DateStuff[1]);
int DateYear = Convert.ToInt32(DateStuff[2]);
DateTime CurrentTime = new DateTime(DateYear,DateMonth,DateDay);
DateTime NewDate = CurrentTime.AddDays(DaysToAdd);
string strNewDate = NewDate.Day + "/" + NewDate.Month + "/" + NewDate.Year;
return strNewDate;
</code>

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Michael Evanchik | last post by:
Im not getting any error messages but the event is not going off when i click the button it just posts back to the same page. I know this code has worked outside of Calanders with the same code. ...
0
by: Brian Henry | last post by:
is there a way to just show a calander control, and now allow people to click on the links with out disableing it so its all gray? thanks!
1
by: eakmeemana | last post by:
does some one know a full calander control,full-screen event calendar application with a monthly view, weekly view, daily view etc. I need it to list events that occur on the different dates. The...
3
by: Kurt Schroeder | last post by:
Hi, quick question: this, calSelect1.SelectedDate.DayOfWeek, will return the numeric day ofthe week for a given calander called calSelect1. is there a function or method that can give me the text...
0
by: si_owen | last post by:
Hi folks, I have a working calendar control on twp pages. one page to add events to a date, stored in database. and a second page to purely view the events in a gridview, which displays the...
0
by: lalit | last post by:
Hi all, I would like to make the the calender cery similar to google event calander in python. can any one help me where i will get library that uses AJAX is this feasible reg, Lalit
4
by: remya1000 | last post by:
I'm using ASP with MSAccess as database. i have two text box and one button in my page. and i need to select dates from calander and display it in this two textbox. but i dont need to place a...
7
by: Jassim Rahma | last post by:
is there any way to steel the outlook calander control and use in my windows for application?
16
manoj9849967222
by: manoj9849967222 | last post by:
Hi All I have two Textbox "Textbox1" & "Textbox2" i want to use a calander control to populate the textbox. But i dontknow how to use the calander control. could any one suggest how to...
4
by: sudagnr | last post by:
Hi, a calander control should be visible when i click on image button and on selection of date on a calander control should dispaly in a text box. this should be done in client side. Can...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.