title: DayPilot SQL - Copying appointments that dont have a Date
body: <p>currently I have a master rota which is storing appointments along with the TIME and DAY but not DATE.  The SQL Server database looks like the below for the master rota appointments It is created via the DAYPILOT calendar control</p>
  
  <p><a href="https://i.stack.imgur.com/PljQI.png"><img src="https://i.stack.imgur.com/PljQI.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/kp7WU.png"><img src="https://i.stack.imgur.com/kp7WU.png" alt="enter image description here"></a>
  As you can see there is time stored but not a DATE but it is storing the Day. E.G Day 0 is Sunday, Day 1 is Monday etc....</p>
  
  <p>I would like to add a button to the UI which will copy across the appointments from the master rota on to the LIVE rota taking into account the DATES</p>
  
  <p>E.G an appoinment from the master rota on Day 1 (Monday) should be inserted into the LIVE rota table but adding in the DATE of the current week from the Daypilot calendar control E.G the Assignment start in the LIVE ROTA table would be 2016-01-16 09:30.  It would need to check for the current date of the week in the daypilot calendar and then insert into the LIVE Table.</p>
  
  <p>Is this possible? How can I check for the current DATE and ensure that the DATE matches the correct day using the day field from the DB? E.G Day 0, Day 1 etc..?</p>
  
  <p>Current SQL for master rota creation</p>
  
  <pre><code>public void CreateAssignment(DateTime start, DateTime end, int location, int     week, string person, string note, DayOfWeek day)
      {
          using (DbConnection con = CreateConnection())
          {
              con.Open();
              //string id = "";
  
              var cmd = CreateCommand("insert into [master_rota] ([AssignmentStart], [AssignmentEnd], [LocationId], [PersonId], [AssignmentNote], week, day) values (@start, @end, @location, @person, @note, @Week, @day)", con);
              AddParameterWithValue(cmd, "start", start.TimeOfDay);
              AddParameterWithValue(cmd, "end", end.TimeOfDay);
              AddParameterWithValue(cmd, "location", location);
              AddParameterWithValue(cmd, "week", week);
              AddParameterWithValue(cmd, "person", person);
              AddParameterWithValue(cmd, "note", note);
              if (day == DayOfWeek.Saturday)
              {
                  AddParameterWithValue(cmd, "day", day - 6);
              }
              else
              AddParameterWithValue(cmd, "day", day + 1);
  
              cmd.ExecuteScalar();
  
          }
      }
  </code></pre>