Exemplo n.º 1
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);
            }
        }
 /// <remarks/>
 public void transferEmailAsTaskAsync(string arg0, string arg1, string arg2, prjTask arg3, object userState)
 {
     if ((this.transferEmailAsTaskOperationCompleted == null))
     {
         this.transferEmailAsTaskOperationCompleted = new System.Threading.SendOrPostCallback(this.OntransferEmailAsTaskOperationCompleted);
     }
     this.InvokeAsync("transferEmailAsTask", new object[] {
         arg0,
         arg1,
         arg2,
         arg3
     }, this.transferEmailAsTaskOperationCompleted, userState);
 }
 /// <remarks/>
 public void transferEmailAsTaskAsync(string arg0, string arg1, string arg2, prjTask arg3)
 {
     this.transferEmailAsTaskAsync(arg0, arg1, arg2, arg3, null);
 }
        public prjTask transferEmailAsTask([System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string arg0, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string arg1, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] string arg2, [System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)] prjTask arg3)
        {
            object[] results = this.Invoke("transferEmailAsTask", new object[] {
                arg0,
                arg1,
                arg2,
                arg3
            });

            return((prjTask)(results[0]));
        }