Skip to content

Commit

Permalink
日历备忘修改
Browse files Browse the repository at this point in the history
  • Loading branch information
kwwwvagaa committed Aug 27, 2020
1 parent 93c5d1c commit 641fdbc
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 112 deletions.
220 changes: 111 additions & 109 deletions HZH_Controls/HZH_Controls/Controls/DateTime/UCCalendarNotes.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion HZH_Controls/HZH_Controls/Controls/Step/UCStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public string[] Steps
get { return m_steps; }
set
{
if (m_steps == null || m_steps.Length < 1)
if (value == null || value.Length < 1)
return;
m_steps = value;
Refresh();
Expand Down
4 changes: 2 additions & 2 deletions HZH_Controls/Test/UC/UCTestCalendarNotes.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions HZH_Controls/Test/UC/UCTestCalendarNotes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ private List<NoteEntity> GetShowData(List<TestEntity> dbSource)
thisDt = thisDt.AddDays(7);
}
}
else if (item.LoopType == 3)
{
DateTime thisDt = item.BeginDateTime;
while (thisDt <= item.EndDateTime)
{
DateTime noteBeginTime = DateTime.Parse(thisDt.ToString("yyyy-MM-dd") + " " + item.LoopBeginTime.ToString("HH:mm:ss"));
DateTime noteEndTime = noteBeginTime.Add(item.LoopDuration);
if (noteBeginTime >= item.BeginDateTime && noteEndTime < item.EndDateTime)//是否在整个计划范围时间内
{
lst.Add(new NoteEntity() { Title = item.Title, Note = item.Msg, BeginTime = noteBeginTime, EndTime = noteEndTime, DataSource = item });
}
thisDt = thisDt.AddMonths(1);
}
}
//月,年类似周
}

Expand All @@ -103,6 +117,7 @@ private List<NoteEntity> GetShowData(List<TestEntity> dbSource)
private bool ucCalendarNotes1_ClickNote(NoteEntity note)
{
TestEntity entity = (TestEntity)note.DataSource;

//对entity进行修改、删除操作
entity.Title += "修改1次;";
//加载数据
Expand All @@ -113,6 +128,7 @@ private bool ucCalendarNotes1_ClickNote(NoteEntity note)
MessageBox.Show("修改成功");
return true;
}


private void ucCalendarNotes1_AddClick(DateTime beginTime)
{
Expand Down

0 comments on commit 641fdbc

Please sign in to comment.