예제 #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Weeks EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToWeeks(Week week)
 {
     base.AddObject("Weeks", week);
 }
예제 #2
0
 private Week setupWeek(DateTime weekEnding)
 {
     Week wk;
     wk = t.Weeks.SingleOrDefault(f => f.WeekEnding == weekEnding);
     if (wk == default(Week))
     {
         wk = new Week();
         wk.WeekEnding = DateTime.Parse(tbWeekEnding.Text);
         wk.CreatedBy = "davide";
         wk.ModifiedBy = "davide";
         wk.DateModified = DateTime.Now;
         wk.DateCreated = DateTime.Now;
         wk.WeekGuid = Guid.NewGuid();
         t.Weeks.AddObject(wk);
     }
     return wk;
 }
예제 #3
0
 /// <summary>
 /// Create a new Week object.
 /// </summary>
 /// <param name="weekId">Initial value of the WeekId property.</param>
 /// <param name="weekGuid">Initial value of the WeekGuid property.</param>
 /// <param name="dateCreated">Initial value of the DateCreated property.</param>
 /// <param name="dateModified">Initial value of the DateModified property.</param>
 /// <param name="createdBy">Initial value of the CreatedBy property.</param>
 /// <param name="modifiedBy">Initial value of the ModifiedBy property.</param>
 /// <param name="weekEnding">Initial value of the WeekEnding property.</param>
 public static Week CreateWeek(global::System.Int32 weekId, global::System.Guid weekGuid, global::System.DateTime dateCreated, global::System.DateTime dateModified, global::System.String createdBy, global::System.String modifiedBy, global::System.DateTime weekEnding)
 {
     Week week = new Week();
     week.WeekId = weekId;
     week.WeekGuid = weekGuid;
     week.DateCreated = dateCreated;
     week.DateModified = dateModified;
     week.CreatedBy = createdBy;
     week.ModifiedBy = modifiedBy;
     week.WeekEnding = weekEnding;
     return week;
 }
예제 #4
0
 private void setupClientWeek(Client cl, Week wk)
 {
     cw = t.ClientWeeks.SingleOrDefault(f => f.ClientId == cl.ClientId && f.WeekId == wk.WeekId);
     if (cw == default(ClientWeek))
     {
         cw = new ClientWeek();
         cw.ClientId = cl.ClientId;
         cw.WeekId = wk.WeekId;
         cw.CreatedBy = "davide";
         cw.ModifiedBy = "davide";
         cw.DateModified = DateTime.Now;
         cw.DateCreated = DateTime.Now;
         cw.ClientWeekGuid = Guid.NewGuid();
         t.ClientWeeks.AddObject(cw);
     }
     setupClientWeek(cw, false);
 }