Witam wszystkim,
Jestem bardzo początkującym w C# i potrzebuję Waszej pomocy. chcę odjąć jedną godzinę od drugiej to nawet mi się udało ale od wyniku potrzebuje odjąć przerwę i tu zaczyna się problem bo jedną wartość mam w datetime a drugą timespan i nie mogę nic zrobić
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void okButton_Click(object sender, EventArgs e)
{
DateTime started = DateTime.ParseExact(startedTextBox.Text, "HH.mm", null);
DateTime finished = DateTime.ParseExact(finishedTextBox.Text, "HH.mm", null);
DateTime breakTime = DateTime.ParseExact(breakTextBox.Text, "HH.mm", null);
TimeSpan totalNoBreak = finished.Subtract(started);
TimeSpan total = totalNoBreak.Subtract(breakTime);
totalTextBox.Text = total.ToString();
}
}