private void LoadBookedPushMSG() { string UserIndex = string.Empty; try { if (this.PushMSGList == null) this.PushMSGList = new List<PUSHMSGInfo>(); PushMSGList.Clear(); using (SqlConnection con = new SqlConnection()) { con.ConnectionString = string.Format("Server={0};DataBase={1};Uid={2};Pwd={3}", this.DBIp, this.DBName, this.DBId, this.DBPass); string sqlquery = "SELECT idaccount, type1, type2, pushmessage, sendtime FROM dbo.tbl_pushmsg WHERE dbo.tbl_pushmsg.sendtime < GETDATE() ORDER BY dbo.tbl_pushmsg.sendtime DESC"; SqlCommand cmd = new SqlCommand(sqlquery, con); con.Open(); SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { PUSHMSGInfo Data = new PUSHMSGInfo(); string stridaccount = rd["idaccount"].ToString(); UInt32 IdAccount = Convert.ToUInt32(stridaccount); if (IdAccount > 0) { foreach (KeyValuePair<Int64, DeviceInfo> each in this.DicDeviceID) { if (IdAccount == each.Value.IdAccount) { Data.IdAccount = IdAccount; Data.type1 = rd["type1"].ToString(); Data.type2 = rd["type2"].ToString(); UInt32 type2 = Convert.ToUInt32(stridaccount); Data.deviceid = each.Value.deviceid; Data.pushmessage = rd["pushmessage"].ToString(); PushMSGList.Add(Data); } } } } rd.Close(); con.Close(); } // PUSHMSGInfo Data1 = new PUSHMSGInfo(); // UInt32 u32IdAccount = 1000; // if (u32IdAccount > 0) // { // Data1.IdAccount = u32IdAccount; // Data1.type = "1";// rd["type"].ToString(); // Data1.deviceid = "APA91bGeBE2XYOkTZeL-gHrAC0ST6-9M73DLxSUkHe3CNYCzQEf4UVnVSLceQwv9MS56cdJKp_Rp8K5RrZ96BcQfM3mbTfketN7lOQUPnh65fdbdSMwn1IU19Oi59B-9JonipNti9_GNeVMTqC96qMxJ0DbwKTX7jg";//GetDeviceList(IdAccount); // Data1.pushmessage = "Hello EveryOne"; // PushMSGList.Add(Data1); // } // PUSHMSGInfo Data1 = new PUSHMSGInfo(); // UInt32 u32IdAccount = 1000; // if (u32IdAccount > 0) // { // Data1.IdAccount = u32IdAccount; // Data1.type1 = "1";// rd["type"].ToString(); // Data1.type2 = "1";// rd["type"].ToString(); // Data1.deviceid = "APA91bHELKNHPFrZEslHDF3vlpdRQwYzxz-tc5FEjPxUPvzoLG6jRQfz-3kgNovBQNKmuKNGS8x0FX8pUxmIYWDFzCm0NB3eghaRG0h-lDh0I2JStwjaOq39rT1ypLLYzQO34tPLP8kl";//GetDeviceList(IdAccount); // Data1.pushmessage = "제목/Hello EveryOne"; // PushMSGList.Add(Data1); // } } catch (Exception ex) { DateTime currTime = DateTime.Now; Console.WriteLine("[" + currTime.ToString("HH:mm:ss") + "] LoadBookedPushMSG()" + ex.Message); } }
private void LoadBookedPushMSG() { string UserIndex = string.Empty; try { if (this.PushMSGList == null) this.PushMSGList = new List<PUSHMSGInfo>(); PushMSGList.Clear(); using (SqlConnection con = new SqlConnection()) { con.ConnectionString = string.Format("Server={0};DataBase={1};Uid={2};Pwd={3}", this.DBIp, this.DBName, this.DBId, this.DBPass); string sqlquery = "SELECT idaccount, type1, type2, pushmessage, sendtime FROM dbo.tbl_pushmsg WHERE dbo.tbl_pushmsg.sendtime < GETDATE() ORDER BY dbo.tbl_pushmsg.sendtime DESC"; SqlCommand cmd = new SqlCommand(sqlquery, con); con.Open(); SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { PUSHMSGInfo Data = new PUSHMSGInfo(); string stridaccount = rd["idaccount"].ToString(); UInt32 IdAccount = Convert.ToUInt32(stridaccount); if (IdAccount > 0) { Data.IdAccount = IdAccount; Data.type1 = rd["type1"].ToString(); Data.type2 = rd["type2"].ToString(); UInt32 type2 = Convert.ToUInt32(stridaccount); Data.deviceid = GetDeviceList(IdAccount); Data.pushmessage = rd["pushmessage"].ToString(); PushMSGList.Add(Data); } } rd.Close(); con.Close(); } // PUSHMSGInfo Data1 = new PUSHMSGInfo(); // UInt32 u32IdAccount = 1000; // if (u32IdAccount > 0) // { // Data1.IdAccount = u32IdAccount; // Data1.type = "1";// rd["type"].ToString(); // Data1.deviceid = "APA91bGeBE2XYOkTZeL-gHrAC0ST6-9M73DLxSUkHe3CNYCzQEf4UVnVSLceQwv9MS56cdJKp_Rp8K5RrZ96BcQfM3mbTfketN7lOQUPnh65fdbdSMwn1IU19Oi59B-9JonipNti9_GNeVMTqC96qMxJ0DbwKTX7jg";//GetDeviceList(IdAccount); // Data1.pushmessage = "Hello EveryOne"; // PushMSGList.Add(Data1); // } PUSHMSGInfo Data1 = new PUSHMSGInfo(); UInt32 u32IdAccount = 1000; if (u32IdAccount > 0) { Data1.IdAccount = u32IdAccount; Data1.type1 = "1";// rd["type"].ToString(); Data1.type2 = "1";// rd["type"].ToString(); Data1.deviceid = "APA91bFWxsvV3sZjMFQSGj7A500qFWjr8TN0szHh_McV9cDuRgltJfJLs3azOgTDZR-Yqepm9L2MUzNvPYjhQaQq8s-HgrjXM0-QQM2o263ipoVq6_Irk0w6P6u15q7oKAJLU8wospyU";//GetDeviceList(IdAccount); Data1.pushmessage = "Hello EveryOne"; PushMSGList.Add(Data1); } } catch (Exception ex) { DateTime currTime = DateTime.Now; Console.WriteLine("[" + currTime.ToString("HH:mm:ss") + "] LoadBookedPushMSG()" + ex.Message); } }
private void LoadBookedPushMSG() { string UserIndex = string.Empty; try { if (this.PushMSGList == null) { this.PushMSGList = new List <PUSHMSGInfo>(); } PushMSGList.Clear(); using (SqlConnection con = new SqlConnection()) { con.ConnectionString = string.Format("Server={0};DataBase={1};Uid={2};Pwd={3}", this.DBIp, this.DBName, this.DBId, this.DBPass); string sqlquery = "SELECT idaccount, type1, type2, pushmessage, sendtime FROM dbo.tbl_pushmsg WHERE dbo.tbl_pushmsg.sendtime < GETDATE() ORDER BY dbo.tbl_pushmsg.sendtime DESC"; SqlCommand cmd = new SqlCommand(sqlquery, con); con.Open(); SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { PUSHMSGInfo Data = new PUSHMSGInfo(); string stridaccount = rd["idaccount"].ToString(); UInt32 IdAccount = Convert.ToUInt32(stridaccount); if (IdAccount > 0) { Data.IdAccount = IdAccount; Data.type1 = rd["type1"].ToString(); Data.type2 = rd["type2"].ToString(); UInt32 type2 = Convert.ToUInt32(stridaccount); Data.deviceid = GetDeviceList(IdAccount); Data.pushmessage = rd["pushmessage"].ToString(); PushMSGList.Add(Data); } } rd.Close(); con.Close(); } // PUSHMSGInfo Data1 = new PUSHMSGInfo(); // UInt32 u32IdAccount = 1000; // if (u32IdAccount > 0) // { // Data1.IdAccount = u32IdAccount; // Data1.type = "1";// rd["type"].ToString(); // Data1.deviceid = "APA91bGeBE2XYOkTZeL-gHrAC0ST6-9M73DLxSUkHe3CNYCzQEf4UVnVSLceQwv9MS56cdJKp_Rp8K5RrZ96BcQfM3mbTfketN7lOQUPnh65fdbdSMwn1IU19Oi59B-9JonipNti9_GNeVMTqC96qMxJ0DbwKTX7jg";//GetDeviceList(IdAccount); // Data1.pushmessage = "Hello EveryOne"; // PushMSGList.Add(Data1); // } PUSHMSGInfo Data1 = new PUSHMSGInfo(); UInt32 u32IdAccount = 1000; if (u32IdAccount > 0) { Data1.IdAccount = u32IdAccount; Data1.type1 = "1"; // rd["type"].ToString(); Data1.type2 = "1"; // rd["type"].ToString(); Data1.deviceid = "APA91bFWxsvV3sZjMFQSGj7A500qFWjr8TN0szHh_McV9cDuRgltJfJLs3azOgTDZR-Yqepm9L2MUzNvPYjhQaQq8s-HgrjXM0-QQM2o263ipoVq6_Irk0w6P6u15q7oKAJLU8wospyU"; //GetDeviceList(IdAccount); Data1.pushmessage = "Hello EveryOne"; PushMSGList.Add(Data1); } } catch (Exception ex) { DateTime currTime = DateTime.Now; Console.WriteLine("[" + currTime.ToString("HH:mm:ss") + "] LoadBookedPushMSG()" + ex.Message); } }
private void LoadBookedPushMSG() { string UserIndex = string.Empty; try { if (this.PushMSGList == null) { this.PushMSGList = new List <PUSHMSGInfo>(); } PushMSGList.Clear(); using (SqlConnection con = new SqlConnection()) { con.ConnectionString = string.Format("Server={0};DataBase={1};Uid={2};Pwd={3}", this.DBIp, this.DBName, this.DBId, this.DBPass); string sqlquery = "SELECT idaccount, type1, type2, pushmessage, sendtime FROM dbo.tbl_pushmsg WHERE dbo.tbl_pushmsg.sendtime < GETDATE() ORDER BY dbo.tbl_pushmsg.sendtime DESC"; SqlCommand cmd = new SqlCommand(sqlquery, con); con.Open(); SqlDataReader rd = cmd.ExecuteReader(); while (rd.Read()) { PUSHMSGInfo Data = new PUSHMSGInfo(); string stridaccount = rd["idaccount"].ToString(); UInt32 IdAccount = Convert.ToUInt32(stridaccount); if (IdAccount > 0) { foreach (KeyValuePair <Int64, DeviceInfo> each in this.DicDeviceID) { if (IdAccount == each.Value.IdAccount) { Data.IdAccount = IdAccount; Data.type1 = rd["type1"].ToString(); Data.type2 = rd["type2"].ToString(); UInt32 type2 = Convert.ToUInt32(stridaccount); Data.deviceid = each.Value.deviceid; Data.pushmessage = rd["pushmessage"].ToString(); PushMSGList.Add(Data); } } } } rd.Close(); con.Close(); } // PUSHMSGInfo Data1 = new PUSHMSGInfo(); // UInt32 u32IdAccount = 1000; // if (u32IdAccount > 0) // { // Data1.IdAccount = u32IdAccount; // Data1.type = "1";// rd["type"].ToString(); // Data1.deviceid = "APA91bGeBE2XYOkTZeL-gHrAC0ST6-9M73DLxSUkHe3CNYCzQEf4UVnVSLceQwv9MS56cdJKp_Rp8K5RrZ96BcQfM3mbTfketN7lOQUPnh65fdbdSMwn1IU19Oi59B-9JonipNti9_GNeVMTqC96qMxJ0DbwKTX7jg";//GetDeviceList(IdAccount); // Data1.pushmessage = "Hello EveryOne"; // PushMSGList.Add(Data1); // } // PUSHMSGInfo Data1 = new PUSHMSGInfo(); // UInt32 u32IdAccount = 1000; // if (u32IdAccount > 0) // { // Data1.IdAccount = u32IdAccount; // Data1.type1 = "1";// rd["type"].ToString(); // Data1.type2 = "1";// rd["type"].ToString(); // Data1.deviceid = "APA91bHELKNHPFrZEslHDF3vlpdRQwYzxz-tc5FEjPxUPvzoLG6jRQfz-3kgNovBQNKmuKNGS8x0FX8pUxmIYWDFzCm0NB3eghaRG0h-lDh0I2JStwjaOq39rT1ypLLYzQO34tPLP8kl";//GetDeviceList(IdAccount); // Data1.pushmessage = "제목/Hello EveryOne"; // PushMSGList.Add(Data1); // } } catch (Exception ex) { DateTime currTime = DateTime.Now; Console.WriteLine("[" + currTime.ToString("HH:mm:ss") + "] LoadBookedPushMSG()" + ex.Message); } }