Hi
I am developing an application (using C# and SQL SERVER 2005) for calculating fine in an library.
The fine calculated should not included Sundays.
I have used the following code to calculate the fine.
But the code includes all the sundays and hence Fine is charged for all the sundays.
private void btnFine_Click(object sender, EventArgs e)
{
DueDate = Convert.ToDateTime(txtDueDate.Text);
ReturnedOn = Convert.ToDateTime(dateTimePicker1.Value);
TimeSpan t = ReturnedOn - DueDate;
int DelayInReturn = t.Days;
if (DelayInReturn > 0)
{
fine = DelayInReturn * 10;
}
MessageBox.Show(Convert.ToString(fine));
}
Can any body help me out in calculating the fine excluding the sundays?
Please help me out!
Thanks in advance!