In command line, go to .Net Framework folder:
C:\Windows\Microsoft.NET\Framework\v4.0.30319
Run following line:
installutil C:\folder name\ServiceHost.exe
Uninstall:
installutil /u C:\folder name\ServiceHost.exe
If want to install service with different display name:
sc create "Your Service Name" binpath= "fullpath of your exe file"
Thursday, August 8, 2013
Thursday, August 1, 2013
Tuesday, July 30, 2013
How to get Open ticket number for one queue in OTRS MySQL database by .Net ?
using MySql.Data.MySqlClient;
public class MySQLDBConnector
{
private MySqlConnection connection;
private string server;
private string database;
private string uid;
private string password;
//Constructor
public MySQLDBConnector()
{
Initialize();
}
//Initialize values
private void Initialize()
{
server = "10.0.x.x"; // "otrs.chatham.teksavvy.ca";
database = "otrs";
uid = "xxxx";
password = "xxxx";
string connectionString = "SERVER=" + server + ";Port=3306;" + "DATABASE=" +
database + ";" + "UID=" + uid + ";" + "PASSWORD=" + password + ";";
connection = new MySqlConnection(connectionString);
}
//open connection to database
public bool OpenConnection()
{
try
{
connection.Open();
return true;
}
catch (MySqlException ex)
{
switch (ex.Number)
{
}
return false;
}
}
public int Count()
{
string query = @"select count(*) from ticket inner join queue on ticket.queue_id= queue.id inner join ticket_state on ticket_state.id = ticket.ticket_state_id
where queue.name ='Junk' and ticket.ticket_state_id = 4";
;
int Count = -1;
//Open Connection
if (this.OpenConnection() == true)
{
//Create Mysql Command
MySqlCommand cmd = new MySqlCommand(query, connection);
//ExecuteScalar will return one value
Count = int.Parse(cmd.ExecuteScalar() + "");
//close Connection
connection.Close();
return Count;
}
else
{
return Count;
}
}
}
Monday, July 29, 2013
How to get Open ticket count for specic queue in OTRS by SQL query?
select count(*) from ticket
inner join queue on ticket.queue_id= queue.id
inner join ticket_state on ticket_state.id = ticket.ticket_state_id
where queue.name ='Postmaster' and ticket.ticket_state_id = 4
inner join queue on ticket.queue_id= queue.id
inner join ticket_state on ticket_state.id = ticket.ticket_state_id
where queue.name ='Postmaster' and ticket.ticket_state_id = 4
Subscribe to:
Posts (Atom)