public static String PopulateTable() { String result = ""; int UserID = Subscription.GetBossID(); string myConnectionString = "server=ibless.cx7whwbxrpt3.us-east-1.rds.amazonaws.com;uid=iBLESS_Trac;" + "pwd=marjaime1;database=iBLESS;"; try { using (MySqlConnection conn = new MySqlConnection()) { conn.ConnectionString = myConnectionString; conn.Open(); string stm = @"SELECT FirstName, LastName, `E-mail`, " + UserID + "_Arch.Type, Parent, " + UserID + "_Users.ID, IsInactive From User INNER JOIN " + UserID + "_Users ON User.CustomerNumber=" + UserID + "_Users.ID INNER JOIN " + UserID + "_Arch ON " + UserID + "_Arch.ID=" + UserID + "_Users.Type"; MySqlCommand cmd = new MySqlCommand(stm, conn); using (MySqlDataReader rdr = cmd.ExecuteReader()) if (!CreateJSON(ref result, rdr)) { return(" "); } // no result } } catch (MySql.Data.MySqlClient.MySqlException ex) { Debug.WriteLine(ex.Message); return(" "); } return(result); }
/// <summary> /// Deletes the user from the basic user table /// </summary> /// <param name="ID"></param> /// <returns></returns> private static bool DeleteFromCustomerTable(String ID) { int UserID = Subscription.GetBossID(); string myConnectionString = "server=ibless.cx7whwbxrpt3.us-east-1.rds.amazonaws.com;uid=iBLESS_Trac;" + "pwd=marjaime1;database=iBLESS;"; try { using (MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection()) { conn.ConnectionString = myConnectionString; conn.Open(); string stm = @"DELETE FROM " + UserID + "_Users WHERE ID=@id"; MySqlCommand cmd = new MySqlCommand(stm, conn); cmd.Parameters.AddWithValue("@id", ID); cmd.ExecuteNonQuery(); } } catch (MySql.Data.MySqlClient.MySqlException ex) { Debug.WriteLine(ex.Message); return(false); } return(true); }
public static bool HasBoss() { if (Subscription.GetBossID() == -2) { return(false); } if (!CanCreate() && !Subscription.IsSubscribed()) { return(false); } return(true); }
public static String GetReadyTable(bool create) { if (create) { Create(); } int ID = Subscription.GetBossID(); string myConnectionString = "server=ibless.cx7whwbxrpt3.us-east-1.rds.amazonaws.com;uid=iBLESS_Trac;" + "pwd=marjaime1;database=iBLESS;"; string result = ""; try { using (MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection()) { conn.ConnectionString = myConnectionString; conn.Open(); string stm = @"SELECT ID, Type, Can_Create From " + ID + "_Arch"; MySqlCommand cmd = new MySqlCommand(stm, conn); using (MySqlDataReader rdr = cmd.ExecuteReader()) if (!populateResult(ref result, rdr)) { return(" "); } } } catch (MySql.Data.MySqlClient.MySqlException ex) { Debug.WriteLine(ex.Message); return(" "); } return(result); }
protected void Page_Load(object sender, EventArgs e) { BossID = Subscription.GetBossID(); vibrationList = new List <dynamic>(); }
protected void Page_Load(object sender, EventArgs e) { BossID = Subscription.GetBossID(); }