private void _create_Click(object sender, EventArgs e)
        {
            if (summ.Text.Length == 0)
            {
                status("missing subject.");
                return;
            }
            if (SucceedUrl == string.Empty)
            {
                SucceedUrl = AssemblaTicket.GetTicketUrl(space.Text);
            }
            if (FailUrl == string.Empty)
            {
                FailUrl = null;
            }

            int id = AssemblaTicket.Create(space.Text, user.Text, pass.Text, summ.Text, desc.Text, TicketStatus.New, Priority.Normal);

            if (id != 0)
            {
                if (attach)
                {
                    if (!AssemblaDocument.Create(space.Text, user.Text, pass.Text, path + SSFILE, id))
                    {
                        status("screenshot failed.");
                    }
                }
                if (_attachdataasfile)
                {
                    if (!AssemblaDocument.Create(space.Text, user.Text, pass.Text, path + DATAFILE, id))
                    {
                        status("data attach failed.");
                    }
                }
                if (SucceedUrl != null)
                {
                    System.Diagnostics.Process.Start(SucceedUrl);
                }
                if (TicketSucceed != null)
                {
                    TicketSucceed();
                }
            }
            else
            {
                status("login failed.");
                if (TicketFailed != null)
                {
                    TicketFailed();
                }
                if (FailUrl != null)
                {
                    System.Diagnostics.Process.Start(FailUrl);
                }
            }
        }
        private void _create_Click(object sender, EventArgs e)
        {
            if (_summ.Text.Length == 0)
            {
                status("missing subject.");
                return;
            }
            int id = AssemblaTicket.Create(_space.Text, _user.Text, _pass.Text, _summ.Text, _desc.Text, AssemblaStatus.New, AssemblaPriority.Normal);

            if (id != 0)
            {
                if (attach)
                {
                    if (!AssemblaDocument.Create(_space.Text, _user.Text, _pass.Text, path + SSFILE, id))
                    {
                        status("screenshot failed.");
                    }
                }
                if (_attachdataasfile)
                {
                    if (!AssemblaDocument.Create(_space.Text, _user.Text, _pass.Text, path + DATAFILE, id))
                    {
                        status("data attach failed.");
                    }
                }
                System.Diagnostics.Process.Start(AssemblaTicket.GetTicketsUrl(_space.Text));
                if (TicketSucceed != null)
                {
                    TicketSucceed();
                }
            }
            else
            {
                status("login failed.");
                if (TicketFailed != null)
                {
                    TicketFailed();
                }
            }
        }
Exemple #3
0
 void _bw_DoWork(object sender, DoWorkEventArgs e)
 {
     while (_go)
     {
         if (e.Cancel)
         {
             break;
         }
         System.Threading.Thread.Sleep(_SLEEP);
         while (!_untrackedqueue.isEmpty && TrackEnabled)
         {
             if (e.Cancel)
             {
                 break;
             }
             // get item
             AssemblaTicket t     = _untrackedqueue.Read();
             string         space = t.Space == string.Empty ? Space : t.Space;
             string         un    = t.Username == string.Empty ? _un : t.Username;
             string         pw    = t._pw == string.Empty ? _pw : t._pw;
             if ((space == string.Empty) || (un == string.Empty))
             {
                 debug(t.ToString() + " space or login information not provided, ignoring ticket.");
                 continue;
             }
             try
             {
                 int tid = AssemblaTicket.Create(space, un, pw, t.Summary, t.Description, t.Status, t.Priority);
                 debug("created ticket: " + tid);
             }
             catch (Exception ex)
             {
                 debug("error uploading: " + t.ToString() + " " + ex.Message + ex.StackTrace);
             }
             System.Threading.Thread.Sleep((int)((double)_SLEEP / 10));
         }
     }
 }