예제 #1
0
        ///<summary></summary>
        public static void Delete(long bugId)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                Meth.GetVoid(MethodBase.GetCurrentMethod(), bugId);
                return;
            }
            JobLinks.DeleteForType(JobLinkType.Bug, bugId);
            //Create an ODThread so that we can safely change the database connection settings without affecting the calling method's connection.
            ODThread odThread = new ODThread(new ODThread.WorkerDelegate((ODThread o) => {
                //Always set the thread static database connection variables to set the serviceshq db conn.
#if DEBUG
                new DataConnection().SetDbT("localhost", "bugs", "root", "", "", "", DatabaseType.MySql, true);
#else
                new DataConnection().SetDbT("server", "bugs", "root", "", "", "", DatabaseType.MySql, true);
#endif
                Crud.BugCrud.Delete(bugId);
            }));

            odThread.AddExceptionHandler(new ODThread.ExceptionDelegate((Exception e) => { }));            //Do nothing
            odThread.Name = "bugsDeleteThread";
            odThread.Start(true);
            if (!odThread.Join(THREAD_TIMEOUT))
            {
                return;
            }
        }
예제 #2
0
 ///<summary></summary>
 public static void Delete(long bugId)
 {
     if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
     {
         Meth.GetVoid(MethodBase.GetCurrentMethod(), bugId);
         return;
     }
     JobLinks.DeleteForType(JobLinkType.Bug, bugId);
     DataAction.RunBugsHQ(() => Crud.BugCrud.Delete(bugId), false);
 }