Exemple #1
0
        public static string Support_Tickets_Folder()
        {
            try
            {
                if (string.IsNullOrEmpty(_Support_Tickets_Folder))
                {
                    if (MySQL_ITIS.openConnection() == false)
                    {
                        throw new Exception("MySQL Connection is not open!");
                    }

                    MySqlCommand cmd = new MySqlCommand("SELECT NEWENVIRONMENT.PATH FROM IT_WORKSTATIONS.NEWENVIRONMENT WHERE NEWENVIRONMENT.KEY LIKE 'Support_Tickets_Attachments_Folder';")
                    {
                        Connection = MySQL_ITIS.conn
                    };
                    MySqlDataReader rdr = cmd.ExecuteReader();
                    if (rdr.Read())
                    {
                        _Support_Tickets_Folder = rdr.GetString("path");
                    }

                    cmd.Dispose();
                    MySQL_ITIS.conn.Close();
                    MySQL_ITIS.conn.Dispose();
                }

                return(_Support_Tickets_Folder);
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("Error : " + ex.Message, "CSF TICKETING", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
                return(null);
            }
        }
Exemple #2
0
        private static void Get_SupportTickets_Credential()
        {
            try
            {
                if (MySQL_ITIS.openConnection() == false)
                {
                    throw new Exception("MySQL Connection is not open.");
                }

                MySqlCommand cmd = new MySqlCommand("SELECT * FROM it_workstations.network_shared_credentials where network_shared_credentials.key LIKE 'Support_Tickets';")
                {
                    Connection = MySQL_ITIS.conn
                };
                MySqlDataReader rdr = cmd.ExecuteReader();

                if (rdr.Read())
                {
                    SupportTickets_Domain   = rdr.GetString("Domain");
                    SupportTickets_UserName = rdr.GetString("Username");
                    SupportTickets_Password = rdr.GetString("Password");
                }

                cmd.Dispose();
                MySQL_ITIS.conn.Close();
                MySQL_ITIS.conn.Dispose();
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("Error : " + ex.Message, "CSF TICKETING", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Error);
                return;
            }
        }
Exemple #3
0
        public static bool isIT_Support()
        {
            try
            {
                bool _Result = false;

                //if (!string.IsNullOrEmpty(_isIT_Support))
                //    return _isIT_Support.Equals("YES", StringComparison.OrdinalIgnoreCase) ? true : false;

                if (MySQL_ITIS.openConnection() == false)
                {
                    throw new Exception("MySQL Connection not open!");
                }

                MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand("SELECT count(*) as COUNT FROM IT_WORKSTATIONS.IT_USERS WHERE IT_USERS.NAME = @Param1;");
                cmd.Parameters.AddWithValue("@Param1", Pub.MyDisplayName());
                cmd.Connection = MySQL_ITIS.conn;
                MySqlDataReader r = cmd.ExecuteReader();

                if (r.Read())
                {
                    _isIT_Support = r.GetInt16("COUNT") == 1 ? "YES" : "NO";
                    _Result       = r.GetInt16("COUNT") == 1 ? true : false;
                }

                //cmd.Connection.Close();
                //cmd.Connection.Dispose();
                cmd.Dispose();

                MySQL_ITIS.conn.Close();
                MySQL_ITIS.conn.Dispose();

                return(_Result);
            }
            catch (Exception ex)
            {
                System.Windows.MessageBox.Show("Error : " + ex.Message);
                return(false);
            }
        }