Exemplo n.º 1
0
 public static ShowWeeklyPlan CreateShowWeeklyPlan(WeekSummary weekSummary, WeekTarget weekTarget, Department department)
 {
     var showWeeklyPlan = new ShowWeeklyPlan();
     if (!weekSummary.Null())
     {
         showWeeklyPlan.ID = weekSummary.ID;
         showWeeklyPlan.Description = weekSummary.Description;
         showWeeklyPlan.CreateTime = weekSummary.CreateTime.ToString("yy-MM-dd HH:mm");
         showWeeklyPlan.TargetTime = weekSummary.WeekNum;
     }
     if (!weekTarget.Null())
     {
         showWeeklyPlan.Target = weekTarget.Target ?? " ";
         showWeeklyPlan.Progress = weekTarget.Progress;
         showWeeklyPlan.TargetTime = weekTarget.WeekNum;
     }
     if (!department.Null())
     {
         showWeeklyPlan.DepartmentName = department.Name;
     }
     DateTime beginTime;
     DateTime endTime;
     DateTimeUtility.GetWeekDays(showWeeklyPlan.TargetTime, out beginTime, out endTime);
     showWeeklyPlan.BeginTime = beginTime.ToString("yy-MM-dd");
     showWeeklyPlan.EndTime = endTime.ToString("yy-MM-dd");
     return showWeeklyPlan;
 }
Exemplo n.º 2
0
 public static UpdateWeekSummary CreateSummary(Guid? weekId, WeekSummary weekSummary)
 {
     var updateWeekSummary = new UpdateWeekSummary();
     updateWeekSummary.ID = weekId.GetValueOrDefault();
     if (!weekSummary.Null())
     {
         updateWeekSummary.Description = weekSummary.Description;
         updateWeekSummary.DepartmentId = weekSummary.DepartmentId;
     }
     return updateWeekSummary;
 }