Click here to Skip to main content
15,902,764 members

Comments by Ashokk88 (Top 11 by date)

Ashokk88 14-Feb-18 1:20am View    
DateTime t1 = Convert.ToDateTime(txt_from_date.Text);
DateTime t2 = Convert.ToDateTime(txt_to_date.Text);
double comp_days;
while (t1 <= t2)
{
if(chk_from.Checked == true || chk_to.Checked == true)
{
comp_days = 0.5;
}
else
{
comp_days = 1;
}

....Insert codings....

t1 = t1.AddDays(1);
}
Ashokk88 14-Feb-18 1:19am View    
If I use if condition inside while loop it consider as half day for all the days(Between from date and to date). I want like if check box for start date selected, for the start date one it should consider 0.5 and for remaining day it should be 1.
Ashokk88 13-Feb-18 2:37am View    
yes, Im saving the date in datetime format and in another field saving value as 0.5 for half day and 1 for full day.
Ashokk88 13-Feb-18 1:33am View    
I want to save day as 0.5 if from date or to date is half day only.
For example-
From date 13/02/2018 (half day selected)
To date 15/02/2018
In my table i want to save like for date 13/02/2018 as 0.5 and
(14/02/2018, 15/02/2018) as 1
Ashokk88 13-Feb-18 0:24am View    
DateTime t1 = Convert.ToDateTime(txt_from_date.Text);
DateTime t2 = Convert.ToDateTime(txt_to_date.Text);
double comp_days;
while (t1 <= t2)
{
...insert into table code....
t1 = t1.AddDays(1);
}


I want to add half day details if user select the respective check box.