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);
            }
        }
Пример #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);
            }
        }
Пример #3
0
        private void btnTransfer_Click(object sender, EventArgs e)
        {
            try
            {
                ProjectService.PrjAPIService local = new ProjectService.PrjAPIService();
                local.Url = serviceUtil.getPpolURL() + "/cxf/PrjAPI";
                ProjectService.prjTask inPrjTask = new ProjectService.prjTask();
                inPrjTask.taskName = this.txtDesc.Text;
                int index = -1;

                int prjIndex = this.cbProjects.SelectedIndex;
                if (prjIndex < 1)
                {
                    MessageBox.Show("A valid project need to be selected to transfer an email to a project task.");
                    this.cbProjects.Focus();
                }
                else
                {
                    ProjectService.project proj = (ProjectService.project)prjList.list[prjIndex - 1];
                    inPrjTask.project = proj;
                    index             = this.cbPriority.SelectedIndex;
                    if (index > 0)
                    {
                        ProjectService.prjTaskPriority selPriority = tskPriority[index - 1];
                        inPrjTask.priority = selPriority.key;
                        //  inPrjTask.fcABC = selPriority.key;
                    }
                    index = this.cbStatus.SelectedIndex;
                    if (index > 0)
                    {
                        ProjectService.prjTaskStatus selStatus = tskStatus[index - 1];
                        inPrjTask.status = selStatus.key;
                        //    inPrjTask.fcStatus = selStatus.key;
                    }
                    index = this.cbOwner.SelectedIndex;
                    if (index > 0)
                    {
                        UserGroupService.fwkUserEO selOwner = fwkUsers[index - 1];
                        inPrjTask.ownerId = selOwner.userId;
                    }
                    inPrjTask.startDate = this.dtpStart.Value.Month.ToString() + "/" + this.dtpStart.Value.Day.ToString() + "/" + this.dtpStart.Value.Year;
                    inPrjTask.endDate   = this.dtpDue.Value.Month.ToString() + "/" + this.dtpDue.Value.Day.ToString() + "/" + this.dtpDue.Value.Year;

                    inPrjTask.desc = this.rtbDetail.Text;

                    ProjectService.prjTask tsk = local.transferEmailAsTask(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword(), inPrjTask);

                    MessageBox.Show("Email was transferred to task '" + tsk.taskName + "' successfully.");

                    this.Close();
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }
Пример #4
0
        private void loadComboData()
        {
            try
            {
                ProjectService.PrjAPIService local = new ProjectService.PrjAPIService();
                local.Url = serviceUtil.getPpolURL() + "/cxf/PrjAPI";

                tskOptions = local.getTaskOptions(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword());
                if (tskOptions != null)
                {
                    tskPriority = tskOptions.prjTaskPriorityList;
                    tskStatus   = tskOptions.prjTaskStatusList;
                    tskType     = tskOptions.prjTaskTypeList;

                    if (tskPriority != null)
                    {
                        this.cbPriority.Items.Add("");
                        for (int i = 0; i < tskPriority.Length; i++)
                        {
                            ProjectService.prjTaskPriority priority = tskPriority[i];
                            this.cbPriority.Items.Add(priority.name);
                        }
                    }
                    if (tskStatus != null)
                    {
                        this.cbStatus.Items.Add("");
                        for (int i = 0; i < tskStatus.Length; i++)
                        {
                            ProjectService.prjTaskStatus status = tskStatus[i];
                            this.cbStatus.Items.Add(status.name);
                        }
                    }
                    if (tskType != null)
                    {
                        this.cbType.Items.Add("");
                        for (int i = 0; i < tskType.Length; i++)
                        {
                            ProjectService.prjTaskType type = tskType[i];
                            this.cbType.Items.Add(type.name);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.grdProjects.SelectedRows.Count > 0 &&
                    this.grdProjects.SelectedRows[0].Index !=
                    this.grdProjects.Rows.Count - 1)
                {
                    int              rowSelected  = this.grdProjects.SelectedRows[0].Index;
                    DataGridViewRow  gridViewRow  = this.grdProjects.Rows[rowSelected];
                    DataGridViewCell gridViewCell = gridViewRow.Cells[0];
                    int              cellValue    = (int)gridViewCell.Value;

                    //Microsoft.Office.Interop.Outlook.MailItem mItem =
                    //    (Microsoft.Office.Interop.Outlook.MailItem)Globals.ThisAddIn.Application.ActiveInspector().CurrentItem;

                    ProjectService.PrjAPIService local = new ProjectService.PrjAPIService();
                    local.Url = serviceUtil.getPpolURL() + "/cxf/PrjAPI";
                    ProjectService.message msg = new ProjectService.message();

                    using (var mItem = ClassFactory.Instance.Outlook.GetCurrentInspectorItem())
                    {
                        if (mItem != null)
                        {
                            msg.date    = mItem.SentOn.ToLongDateString();
                            msg.subject = mItem.Subject;
                            msg.content = mItem.HTMLBody;
                        }
                    }

                    ProjectService.project prj    = (ProjectService.project)prjList.list[rowSelected];
                    ProjectService.project rtnPrj = local.attachEmailAsNote(serviceUtil.getPpolAccount(), serviceUtil.getUserName(), serviceUtil.getPassword(), prj, msg);

                    MessageBox.Show(String.Format("Attached email as note to the project: " + cellValue + "-" + (string)gridViewRow.Cells[1].Value));

                    this.Close();
                }
                else
                {
                    MessageBox.Show("Select an project to attach");
                }
            }
            catch (Exception ex)
            {
                ClassFactory.Instance.ConnectionProblem(ex);
            }
        }