public void deleteMeetingTasks(MeetingTasks mt)
 {
     using (PrioritizerUnitOfWork uow = UnitOfWork)
     {
         uow.Context.MeetingTasks.DeleteObject(mt);
         uow.Commit();
     }
 }
 public void applyChangesMeetingTasks(MeetingTasks mt)
 {
     using (PrioritizerUnitOfWork uow = UnitOfWork)
     {
         uow.Context.MeetingTasks.ApplyChanges(mt);
         uow.Commit();
     }
 }
コード例 #3
0
        public static Tasks Clone(this Tasks Entity)
        {
            //var Type = Entity.GetType();
            //var Clone = Activator.CreateInstance(Type);
            Tasks Clone = new Tasks();

            /*foreach (var Property in Type.GetProperties(BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly | BindingFlags.SetProperty))
             * {
             *  if (Property.PropertyType.IsGenericType && Property.PropertyType.GetGenericTypeDefinition() == typeof(EntityReference<>)) break;
             *  if (Property.PropertyType.IsGenericType && Property.PropertyType.GetGenericTypeDefinition() == typeof(EntityCollection<>)) break;
             *  if (Property.PropertyType.IsSubclassOf(typeof(EntityObject))) break;
             *
             *  if (Property.CanWrite && Property.Name != "ID")
             *  {
             *      Property.SetValue(Clone, Property.GetValue(Entity, null), null);
             *  }
             * }*/
            Clone.priority        = Entity.priority;
            Clone.projectID       = Entity.projectID;
            Clone.remarks         = Entity.remarks;
            Clone.requesterID     = Entity.requesterID;
            Clone.taskName        = Entity.taskName;
            Clone.dateEntered     = DateTime.Now;
            Clone.taskStatusID    = 1;
            Clone.userID          = Entity.userID;
            Clone.updateRequester = Entity.updateRequester;
            Clone.dueDate         = Entity.dueDate;


            var sourceTaskMeeting = NewPrioritizer.ProxyClient.getMeetingTaskByID(Entity.ID);

            if (sourceTaskMeeting != null)
            {
                MeetingTasks meetingTask = new MeetingTasks();
                meetingTask.StartTracking();
                meetingTask.MeetingID = sourceTaskMeeting.MeetingID;
                //repository.MeetingTasks.AddObject(meetingTask);
                meetingTask.TaskID = Clone.ID;
                Clone.MeetingTasks.Add(meetingTask);
                //repository.MeetingTasks.AddObject(meetingTask);
            }


            return((Tasks)Clone);
        }