コード例 #1
0
 /// <summary>
 /// Create a new SqlAppointments object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="start">Initial value of the Start property.</param>
 /// <param name="end">Initial value of the End property.</param>
 /// <param name="isAllDayEvent">Initial value of the IsAllDayEvent property.</param>
 /// <param name="type">Initial value of the Type property.</param>
 public static SqlAppointment CreateSqlAppointments(global::System.Guid id, global::System.DateTime start, global::System.DateTime end, global::System.Boolean isAllDayEvent, global::System.Int32 type)
 {
     SqlAppointment sqlAppointments = new SqlAppointment();
     sqlAppointments.Id = id;
     sqlAppointments.Start = start;
     sqlAppointments.End = end;
     sqlAppointments.IsAllDayEvent = isAllDayEvent;
     sqlAppointments.Type = type;
     return sqlAppointments;
 }
コード例 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the SqlAppointments EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSqlAppointments(SqlAppointment sqlAppointments)
 {
     base.AddObject("SqlAppointments", sqlAppointments);
 }
コード例 #3
0
 private bool FilterSqlAppointments(SqlAppointment entity)
 {
     return (entity.Id == this.SqlAppointmentId);
 }
コード例 #4
0
 private void DetachSqlAppointments1(SqlAppointment entity)
 {
     entity.SqlAppointments2 = null;
 }
コード例 #5
0
 private void AttachSqlAppointments1(SqlAppointment entity)
 {
     entity.SqlAppointments2 = this;
 }
コード例 #6
0
ファイル: Home.xaml.cs プロジェクト: Ratatui/MeetingScheduler
        void Scheduler_AppointmentCreated(Appointment addedAppointment)
        {
            var sqlAppointment = new SqlAppointment
            {
                Id = new Guid(addedAppointment.UniqueId),
                Start = addedAppointment.Start,
                End = addedAppointment.End,
                Subject = addedAppointment.Subject,
                Body = addedAppointment.Body,
                IsAllDayEvent = addedAppointment.IsAllDayEvent,
                Location = addedAppointment.Location,
                Url = addedAppointment.Url,
                Type = (int)AppointmentType.Regular,
                TimeZoneString = addedAppointment.TimeZone.ToString(),
                Importance = addedAppointment.Importance.ToString(),
                RecurrencePattern = addedAppointment.IsRecurring() ?
                                    RecurrencePatternHelper.RecurrencePatternToString(addedAppointment.RecurrenceRule.Pattern) :
                                    null,
            };

            foreach (var resource in addedAppointment.Resources)
            {
                var appResource = new AppointmentResource();
                appResource.Id = -1;
                appResource.SqlAppointments = sqlAppointment;
                appResource.Resource = this.domainContext.Resources.Single(r => r.Name == resource.ResourceName);
                sqlAppointment.AppointmentResources.Add(appResource);

                if (appResource.Resource.ResourceTypes.Name == "Team")
                    addedAppointment.Category = CategoryHelper.MakeCategory(appResource.Resource.Color);
            }
            this.domainContext.SqlAppointments.Add(sqlAppointment);
            (this.Scheduler.AppointmentsSource as ObservableCollection<Appointment>).Add(addedAppointment);
            //this.domainContext.SubmitChanges();
        }