当前位置:编程学习 > C#/ASP.NET >>

如何用代码实现修改会议日程功能

ExchangeServiceBinding 做更新
在网上的找了一个例子,并进行了修改,执行到红色标记的时候,执行通过,但执行后返回值中错误信息为“属性对此对象类型无效。”
 
TaskType setStatusTask = new TaskType();
                setStatusTask.Status = TaskStatusType.Completed;
                setStatusTask.StatusSpecified = true;
 
                SetItemFieldType setItemField = new SetItemFieldType();
                setItemField.Item = new PathToUnindexedFieldType();
                (setItemField.Item as PathToUnindexedFieldType).FieldURI = UnindexedFieldURIType.taskStatus;
                setItemField.Item1 = setStatusTask;
 
                // Create a task item to hold an append update.
                TaskType appendToBodyTask = new TaskType();
                appendToBodyTask.Body = new BodyType();
                appendToBodyTask.Body.BodyType1 = BodyTypeType.Text;
                appendToBodyTask.Body.Value = "Adding some text to the body of this task. ";
 
                // Create the append update.
                AppendToItemFieldType appendToItemField = new AppendToItemFieldType();
                appendToItemField.Item = new PathToUnindexedFieldType();
                (appendToItemField.Item as PathToUnindexedFieldType).FieldURI = UnindexedFieldURIType.itemBody;
                appendToItemField.Item1 = appendToBodyTask;
 
                UpdateItemType updateItemRequest = new UpdateItemType();
                updateItemRequest.ItemChanges = new ItemChangeType[1];
                ItemChangeType itemChange = new ItemChangeType();
 
                itemChange.Item = ss;
                itemChange.Updates = new ItemChangeDescriptionType[2];
                itemChange.Updates[0] = setItemField;
                itemChange.Updates[1] = appendToItemField;
 
                updateItemRequest.SendMeetingInvitationsOrCancellations = CalendarItemUpdateOperationType.SendToChangedAndSaveCopy;
                updateItemRequest.SendMeetingInvitationsOrCancellationsSpecified = true;
                // Add the destination folder to the CreateItem request.
                updateItemRequest.SavedItemFolderId = new TargetFolderIdType();
                updateItemRequest.SavedItemFolderId.Item = folder;
 
                updateItemRequest.ItemChanges[0] = itemChange;
 
 
                try
                {
 
                    UpdateItemResponseType respose = esb.UpdateItem(updateItemRequest);
 
                    ArrayOfResponseMessagesType aormt = respose.ResponseMessages;
                    ResponseMessageType[] rmta = aormt.Items;
 
                    foreach (ResponseMessageType rmt in rmta)
                    {
                        ArrayOfRealItemsType itemArray = ((ItemInfoResponseMessageType)rmt).Items;
                        ItemType[] items = itemArray.Items;
 
                        // Get the item identifier and change key for each item.
                        foreach (ItemType item in items)
                        {
                            meetings.EnName = item.ItemId.Id;
                            Console.WriteLine("Item identifier: " + item.ItemId.Id);
                            Console.WriteLine("Item change key: " + item.ItemId.ChangeKey);
                        }
                    }
                }
                catch (Exception e)
                {
                    Console.WriteLine("Error Message: " + e.Message);
                }
--------------------编程问答-------------------- ////标题
                //updateItem.ItemChanges[1] = new ItemChangeType();
                //updateItem.ItemChanges[1].Item = ss;
                //updateItem.ItemChanges[1].Updates = new ItemChangeDescriptionType[1];

                //SetItemFieldType SubjectItem = new SetItemFieldType();
                //SubjectItem.Item = new PathToUnindexedFieldType();
                //((PathToUnindexedFieldType)SubjectItem.Item).FieldURI = UnindexedFieldURIType.itemSubject;

                //SubjectItem.Item1 = new ItemType();

                //((ItemType)SubjectItem.Item1).Subject = meetings.Subject;
                //updateItem.ItemChanges[1].Updates[0] = SubjectItem; --------------------编程问答-------------------- 你这是分享呢 还是分享呢 --------------------编程问答-------------------- 一大堆代码看着累

要不尝试下这个吧

Jquery实现超酷的日程安排插件
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,