Ejemplo n.º 1
0
        protected void getContactItems(string uid, Dictionary <string,string> mapObj)
        {
            String str;
            getItemsRequest req = new getItemsRequest();
            getItemsResponse resp;

            Filter Flt = new Filter();
            FilterEntry FEN = new FilterEntry();
            FEN.op = FilterOp.eq;
            FEN.field = "@type";
            FEN.value = "Contact";
            Flt.element = FEN;
            req.filter = Flt;

            req.container = uid;

            resp = ws.getItemsRequest(req);
            //  resp = ws.getItemRequest(req);
            if (0 == resp.status.code)
            {
                str = "Items: for Contact folder ";
                if (null != resp.items)
                {
                    str += resp.items.Length;

                    int cnt = resp.items.Length;
                    cnt = cnt - 1;

                    while (cnt >= 0)
                    {

                        Contact mt = (Contact)resp.items[cnt];

                        str += mt.officeInfo;
                        str += "\n";
                        str += mt.name;
                        cnt--;
                        if (mt.officeInfo != null)
                        mapObj.Add("Location", mt.officeInfo.location.ToString());
                        if (mt.officeInfo != null)
                            mapObj.Add("Organization", mt.officeInfo.organization.ToString());
                        if (mt.officeInfo != null)
                            mapObj.Add("Title", mt.officeInfo.title.ToString());
                        if (mt.name != null)
                        mapObj.Add("Name", mt.name.ToString());
                        if (mt.personalInfo != null)
                        mapObj.Add("birthday", mt.personalInfo.birthday.ToString());
                        if (mt.phoneList != null)
                        {
                            int count = mt.phoneList.phone.Length;
                            while (count > 0)
                            {
                                mapObj.Add("Phone" + mt.phoneList.phone[count-1].type.ToString(), mt.phoneList.phone[count-1].Value.ToString());
                                count--;
                            }
                        }
                        if (mt.imList != null)
                        mapObj.Add("imList", mt.imList.ToString());
                        if (mt.fullName.lastName != null)
                        mapObj.Add("LastName", mt.fullName.lastName.ToString());
                        if (mt.fullName.firstName != null)
                            mapObj.Add("FirstName", mt.fullName.firstName.ToString());
                        if (mt.fullName.middleName != null)
                            mapObj.Add("MiddleName", mt.fullName.middleName.ToString());
                        if (mt.addressList != null)
                        mapObj.Add("address", mt.addressList.address.ToString());
                        if (mt.addressList != null)
                            mapObj.Add("mailingaddress", mt.addressList.mailingAddress.ToString());
                        if (mt.contacts != null)
                        mapObj.Add("Contacts", mt.contacts.ToString());

                    }

                    str += resp.status.code.ToString();
                }
                System.Console.WriteLine(str);
            }
            else
            {

                System.Console.WriteLine(resp.status.description);

            }
        }
Ejemplo n.º 2
0
        protected void getItems(string uid)
        {
            String str;
            getItemsRequest req = new getItemsRequest();
            getItemsResponse resp;

            /* WebReference.getItemRequest req = new WebReference.getItemRequest();

             WebReference.getItemResponse resp;*/

            /* WebReference.getQuickMessagesRequest req = new WebReference.getQuickMessagesRequest();

             WebReference.getQuickMessagesResponse resp;

             DateTime dt;*/

            //req.startDate = DateTime.Parse("09/09/2011");

            //   resp = ws.getQuickMessagesRequest(req);
            //  req.container = uid;
            // req.id = uid;
            // req.view = "modified";*/

            req.container = uid;

            resp = ws.getItemsRequest(req);
            //  resp = ws.getItemRequest(req);
            if (0 == resp.status.code)
            {
                str = "Items subjects in folder are : ";
                if (null != resp.items)
                {
                    str += resp.items.Length;

                    int cnt = resp.items.Length;
                    cnt = cnt - 1;
                    while (cnt >= 0)
                    {

                        Mail mt = (Mail)resp.items[cnt];

                        str += mt.subject;

                        cnt--;
                    }

                    /*WebReference.Mail mt1 = (WebReference.Mail)resp.items[1];
                    str += mt1.subject;

                    WebReference.Mail mt2 = (WebReference.Mail)resp.items[2];
                    str += mt2.subject;

                    str += resp.items[0].id;
                    str += resp.items[1].id;
                    str += resp.items[2].id;*/
                    str += resp.status.code.ToString();
                }
                System.Console.WriteLine(str);
            }
            else
            {
                //lblStatus.Text = resp.status.code.ToString();
                System.Console.WriteLine( resp.status.description);
            }
        }
Ejemplo n.º 3
0
        protected void getItems(string uid)
        {
            String           str;
            getItemsRequest  req = new getItemsRequest();
            getItemsResponse resp;

            /* WebReference.getItemRequest req = new WebReference.getItemRequest();
             *
             * WebReference.getItemResponse resp;*/


            /* WebReference.getQuickMessagesRequest req = new WebReference.getQuickMessagesRequest();
             *
             * WebReference.getQuickMessagesResponse resp;
             *
             * DateTime dt;*/



            //req.startDate = DateTime.Parse("09/09/2011");

            //   resp = ws.getQuickMessagesRequest(req);
            //  req.container = uid;
            // req.id = uid;
            // req.view = "modified";*/

            req.container = uid;


            resp = ws.getItemsRequest(req);
            //  resp = ws.getItemRequest(req);
            if (0 == resp.status.code)
            {
                str = "Items subjects in folder are : ";
                if (null != resp.items)
                {
                    str += resp.items.Length;

                    int cnt = resp.items.Length;
                    cnt = cnt - 1;
                    while (cnt >= 0)
                    {
                        Mail mt = (Mail)resp.items[cnt];

                        str += mt.subject;

                        cnt--;
                    }

                    /*WebReference.Mail mt1 = (WebReference.Mail)resp.items[1];
                     * str += mt1.subject;
                     *
                     * WebReference.Mail mt2 = (WebReference.Mail)resp.items[2];
                     * str += mt2.subject;
                     *
                     * str += resp.items[0].id;
                     * str += resp.items[1].id;
                     * str += resp.items[2].id;*/
                    str += resp.status.code.ToString();
                }
                System.Console.WriteLine(str);
            }
            else
            {
                //lblStatus.Text = resp.status.code.ToString();
                System.Console.WriteLine(resp.status.description);
            }
        }
Ejemplo n.º 4
0
        protected void getContactItems(string uid, Dictionary <string, string> mapObj)
        {
            String           str;
            getItemsRequest  req = new getItemsRequest();
            getItemsResponse resp;

            Filter      Flt = new Filter();
            FilterEntry FEN = new FilterEntry();

            FEN.op      = FilterOp.eq;
            FEN.field   = "@type";
            FEN.value   = "Contact";
            Flt.element = FEN;
            req.filter  = Flt;

            req.container = uid;

            resp = ws.getItemsRequest(req);
            //  resp = ws.getItemRequest(req);
            if (0 == resp.status.code)
            {
                str = "Items: for Contact folder ";
                if (null != resp.items)
                {
                    str += resp.items.Length;

                    int cnt = resp.items.Length;
                    cnt = cnt - 1;


                    while (cnt >= 0)
                    {
                        Contact mt = (Contact)resp.items[cnt];


                        str += mt.officeInfo;
                        str += "\n";
                        str += mt.name;
                        cnt--;
                        if (mt.officeInfo != null)
                        {
                            mapObj.Add("Location", mt.officeInfo.location.ToString());
                        }
                        if (mt.officeInfo != null)
                        {
                            mapObj.Add("Organization", mt.officeInfo.organization.ToString());
                        }
                        if (mt.officeInfo != null)
                        {
                            mapObj.Add("Title", mt.officeInfo.title.ToString());
                        }
                        if (mt.name != null)
                        {
                            mapObj.Add("Name", mt.name.ToString());
                        }
                        if (mt.personalInfo != null)
                        {
                            mapObj.Add("birthday", mt.personalInfo.birthday.ToString());
                        }
                        if (mt.phoneList != null)
                        {
                            int count = mt.phoneList.phone.Length;
                            while (count > 0)
                            {
                                mapObj.Add("Phone" + mt.phoneList.phone[count - 1].type.ToString(), mt.phoneList.phone[count - 1].Value.ToString());
                                count--;
                            }
                        }
                        if (mt.imList != null)
                        {
                            mapObj.Add("imList", mt.imList.ToString());
                        }
                        if (mt.fullName.lastName != null)
                        {
                            mapObj.Add("LastName", mt.fullName.lastName.ToString());
                        }
                        if (mt.fullName.firstName != null)
                        {
                            mapObj.Add("FirstName", mt.fullName.firstName.ToString());
                        }
                        if (mt.fullName.middleName != null)
                        {
                            mapObj.Add("MiddleName", mt.fullName.middleName.ToString());
                        }
                        if (mt.addressList != null)
                        {
                            mapObj.Add("address", mt.addressList.address.ToString());
                        }
                        if (mt.addressList != null)
                        {
                            mapObj.Add("mailingaddress", mt.addressList.mailingAddress.ToString());
                        }
                        if (mt.contacts != null)
                        {
                            mapObj.Add("Contacts", mt.contacts.ToString());
                        }
                    }

                    str += resp.status.code.ToString();
                }
                System.Console.WriteLine(str);
            }
            else
            {
                System.Console.WriteLine(resp.status.description);
            }
        }
Ejemplo n.º 5
0
 /// <remarks/>
 public void getItemsRequestAsync(getItemsRequest getItemsRequest1, object userState)
 {
     if ((this.getItemsRequestOperationCompleted == null)) {
         this.getItemsRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetItemsRequestOperationCompleted);
     }
     this.InvokeAsync("getItemsRequest", new object[] {
                 getItemsRequest1}, this.getItemsRequestOperationCompleted, userState);
 }
Ejemplo n.º 6
0
 /// <remarks/>
 public void getItemsRequestAsync(getItemsRequest getItemsRequest1)
 {
     this.getItemsRequestAsync(getItemsRequest1, null);
 }
Ejemplo n.º 7
0
 /// <remarks/>
 public System.IAsyncResult BegingetItemsRequest(getItemsRequest getItemsRequest1, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("getItemsRequest", new object[] {
                 getItemsRequest1}, callback, asyncState);
 }