private void getProjectData()
        {
            try
            {
                ProjectService.PrjAPIService local = new ProjectService.PrjAPIService();
                local.Url = serviceUtil.getPpolURL() + "/cxf/PrjAPI";

                prjList = local.getAllProjects(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword());

                if (prjList == null || prjList.list.Length == 0)
                {
                    MessageBox.Show("Projects are not found in your PlanPlus Online account.");
                }
                else
                {
                    this.grdProjects.Rows.Clear();
                    for (int i = 0; i < prjList.list.Length; i++)
                    {
                        ProjectService.project project = (ProjectService.project)prjList.list[i];


                        this.grdProjects.Rows.Add();
                        this.grdProjects.Rows[i].Cells[0].Value = project.projectId;
                        this.grdProjects.Rows[i].Cells[1].Value = project.projectName;
                        this.grdProjects.Rows[i].Cells[2].Value = project.description;
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }
Beispiel #2
0
        private void getProjectData()
        {
            try
            {
                ProjectService.PrjAPIService local = new ProjectService.PrjAPIService();
                local.Url = serviceUtil.getPpolURL() + "/cxf/PrjAPI";

                prjList = local.getAllProjects(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword());

                if (prjList == null || prjList.list.Length == 0)
                {
                    this.cbProjects.Items.Add("Projects are not found in your PlanPlus Online account.");
                }
                else
                {
                    this.cbProjects.Items.Add("");
                    for (int i = 0; i < prjList.list.Length; i++)
                    {
                        ProjectService.project project = (ProjectService.project)prjList.list[i];
                        this.cbProjects.Items.Add(project.projectId + "-" + project.projectName);
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }
        private void getContact()
        {
            try
            {
                string fromName = "";


                using (var mItem = ClassFactory.Instance.Outlook.GetCurrentInspectorItem())
                {
                    if (mItem != null)
                    {
                        var senderEmailAddress = mItem.SenderEmailAddress;
                        if (!string.IsNullOrEmpty(senderEmailAddress))
                        {
                            fromName            = senderEmailAddress;
                            this.txtNewOpp.Text = mItem.Subject;
                            senderName          = mItem.SenderName;
                        }
                    }
                }



                var local = new Legacy.PPOLService.PsnNoteAPIService();

                local.Url = serviceUtil.getPpolURL() + "/cxf/PsnNoteAPI";

                psn = local.findContactByEmail(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword(), fromName);



                if (psn != null)
                {
                    if (psn.errorMessage == "SUCCESS")
                    {
                        this.txtContactName.Text = psn.displayName;
                    }
                    else
                    {
                        if (psn.errorMessage.Trim().Contains("Account"))
                        {
                            MessageBox.Show(psn.errorMessage);
                            this.Close();
                        }
                        else
                        {
                            this.lblContactMsg.Text = "Contact was not found in PlanPlus Online. You can search and associate a contact, Otherwise system will create new contact.";
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }
        private void loadComboData()
        {
            try
            {
                MiscService.MiscAPIService local = new MiscService.MiscAPIService();
                local.Url = serviceUtil.getPpolURL() + "/cxf/MiscAPI";

                contactOptions = local.getContactOptions(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword());
                if (contactOptions != null)
                {
                    contactCategory    = contactOptions.categoryList;
                    contactPhoneType   = contactOptions.phoneTypeList;
                    contactAddressType = contactOptions.addressTypeList;



                    if (contactCategory != null)
                    {
                        for (int i = 0; i < contactCategory.Length; i++)
                        {
                            MiscService.contactCategory category = contactCategory[i];
                            this.cbClassification.Items.Add(category.name);
                        }
                        cbClassification.SelectedIndex = 0;
                    }
                    if (contactPhoneType != null)
                    {
                        for (int i = 0; i < contactPhoneType.Length; i++)
                        {
                            MiscService.contactPhoneType phone = contactPhoneType[i];
                            this.cbPhone1.Items.Add(phone.name);
                            this.cbPhone2.Items.Add(phone.name);
                            this.cbPhone3.Items.Add(phone.name);
                        }
                        cbPhone1.SelectedIndex = 0;
                        cbPhone2.SelectedIndex = 0;
                        cbPhone3.SelectedIndex = 0;
                    }
                    if (contactAddressType != null)
                    {
                        for (int i = 0; i < contactAddressType.Length; i++)
                        {
                            MiscService.contactAddressType address = contactAddressType[i];
                            this.cbAddress.Items.Add(address.name);
                        }
                        cbAddress.SelectedIndex = 0;
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }
        private void getApptData()
        {
            try
            {
                AppointmentService.ApptAPIService local = new AppointmentService.ApptAPIService();
                local.Url = serviceUtil.getPpolURL() + "/cxf/ApptAPI";

                appointmentOptions = local.getApptOptions(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword());
                if (appointmentOptions != null)
                {
                    appointmentCategory   = appointmentOptions.apptCategoryList;
                    appointmentImportance = appointmentOptions.apptImportanceList;
                    appointmentStatus     = appointmentOptions.apptStatusList;
                    appointmentType       = appointmentOptions.apptTypeList;



                    if (appointmentCategory != null)
                    {
                        this.cbCategory.Items.Add("");
                        for (int i = 0; i < appointmentCategory.Length; i++)
                        {
                            AppointmentService.apptCategory category = appointmentCategory[i];
                            this.cbCategory.Items.Add(category.name);
                        }
                    }
                    if (appointmentImportance != null)
                    {
                        this.cbImportance.Items.Add("");
                        for (int i = 0; i < appointmentImportance.Length; i++)
                        {
                            AppointmentService.apptImportance importance = appointmentImportance[i];
                            this.cbImportance.Items.Add(importance.name);
                        }
                    }
                    if (appointmentStatus != null)
                    {
                        this.cbStatus.Items.Add("");
                        for (int i = 0; i < appointmentStatus.Length; i++)
                        {
                            AppointmentService.apptStatus status = appointmentStatus[i];
                            this.cbStatus.Items.Add(status.name);
                        }
                    }
                    if (appointmentType != null)
                    {
                        this.cbType.Items.Add("");
                        for (int i = 0; i < appointmentType.Length; i++)
                        {
                            AppointmentService.apptType type = appointmentType[i];
                            this.cbType.Items.Add(type.name);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }
Beispiel #6
0
        private void loadComboData()
        {
            try
            {
                TaskService.TaskAPIService local = new TaskService.TaskAPIService();
                local.Url = serviceUtil.getPpolURL() + "/cxf/TaskAPI";

                tskOptions = local.getTaskOptions(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword());
                if (tskOptions != null)
                {
                    tskPriority = tskOptions.taskPriorityList;
                    tskStatus   = tskOptions.taskStatusList;
                    if (tskPriority != null)
                    {
                        this.cbPriority.Items.Add("");
                        for (int i = 0; i < tskPriority.Length; i++)
                        {
                            TaskService.taskPriority priority = tskPriority[i];
                            this.cbPriority.Items.Add(priority.name);
                        }
                    }
                    if (tskStatus != null)
                    {
                        this.cbStatus.Items.Add("");
                        for (int i = 0; i < tskStatus.Length; i++)
                        {
                            TaskService.taskStatus status = tskStatus[i];
                            this.cbStatus.Items.Add(status.name);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }
        private void btnGoContact_Click(object sender, EventArgs e)
        {
            try
            {
                ContactService.PsnAPIService local = new ContactService.PsnAPIService();
                local.Url = serviceUtil.getPpolURL() + "/cxf/PsnAPI";

                ppolContacts = local.search(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword(), this.txtSrcContact.Text);

                if (ppolContacts == null || ppolContacts.Length == 0)
                {
                    if (this.txtSrcContact.Text.Trim() == "")
                    {
                        ShowError("Contacts are not found in your PlanPlus Online account.", MessageBoxIcon.Warning);
                    }
                    else
                    {
                        ShowError("Contact name(s) containing '" + this.txtSrcContact.Text + "' are not found in your PlanPlus Online account.", MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    this.grdUsers.Rows.Clear();
                    for (int i = 0; i < ppolContacts.Length; i++)
                    {
                        ContactService.ppolContact contact = ppolContacts[i];
                        if (contact.id < 1)
                        {
                            ShowError(contact.errorMessage);
                        }

                        this.grdUsers.Rows.Add();
                        this.grdUsers.Rows[i].Cells[0].Value = contact.id;
                        this.grdUsers.Rows[i].Cells[1].Value = contact.displayName;
                        this.grdUsers.Rows[i].Cells[2].Value = contact.primaryEmail;
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }
Beispiel #8
0
        private void loadGroupUsers(int userGroupId)
        {
            try
            {
                try
                {
                    this.cbContactList.SelectedIndex = 0;
                    this.txtSrchUser.Text            = "";
                    this.txtSrcContact.Text          = "";
                }
                catch (Exception e1)
                {
                }
                this.listType = 1;
                UserGroupService.UserGroupAPIService local = new UserGroupService.UserGroupAPIService();
                local.Url = serviceUtil.getPpolURL() + "/cxf/UserGroupAPI";
                fwkUsers  = local.getUsersByGroup(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword(), userGroupId);
                this.grdUsers.Rows.Clear();
                if (fwkUsers != null)
                {
                    for (int i = 0; i < fwkUsers.Length; i++)
                    {
                        UserGroupService.fwkUserEO fwkUser = fwkUsers[i];

                        this.grdUsers.Rows.Add();
                        this.grdUsers.Rows[i].Cells[0].Value = false;
                        this.grdUsers.Rows[i].Cells[1].Value = fwkUser.displayName;
                        this.grdUsers.Rows[i].Cells[2].Value = fwkUser.emailAddress;
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }