public bool InsertMySQL() { try { string sql = "insert into NW_Dhcp_Customer(IpAddress,MacAddress,MacAddress_CMTS,CustomerCode,CustomerName,CustomerAddress,PoolIp,Bootfile,IpPublic,MacPc,PoolPublic,Location,Note)values('" + IpAddress + "','" + MacAddress + "','" + MacAddress_CMTS + "','" + CustomerCode + "','" + CustomerName + "','" + CustomerAddress + "','" + PoolIp + "','" + Bootfile + "','" + IpPublic + "','" + MacPc + "','" + PoolPublic + "','" + Location + "','" + Note + "')"; MySqlConnect.ExecNonQuery(sql); return(true); } catch { return(false); } }
public bool NW_Dhcp_Customer_ActiveByMac_MySQL() { try { string sql = "update NW_Dhcp_Customer set Bootfile='" + Bootfile + "' where MacAddress='" + MacAddress + "'"; MySqlConnect.ExecNonQuery(sql); return(true); } catch { return(false); } }
public bool NW_Dhcp_Customer_DeActivebyIP_MySQL() { try { string sql = "update NW_Dhcp_Customer set Bootfile='auto/offline.bin' where IpAddress='" + IpAddress + "'"; MySqlConnect.ExecNonQuery(sql); return(true); } catch { return(false); } }
//public bool NW_Dhcp_Customer_DeleteAll_MySQL() //{ // try // { // string sql = "delete from NW_Dhcp_Customer"; // MySqlConnect.ExecNonQuery(sql); // return true; // } // catch // { // return false; // } //} public bool NW_Dhcp_Customer_Delete_MySQL() { try { string sql = "delete from NW_Dhcp_Customer where IpAddress='" + IpAddress + "'"; MySqlConnect.ExecNonQuery(sql); return(true); } catch { return(false); } }
public bool UpdateMySQL() { try { string sql = "Update NW_Dhcp_Customer set MacAddress='" + MacAddress + "',MacAddress_CMTS='" + MacAddress_CMTS + "',CustomerCode='" + CustomerCode + "',CustomerName='" + CustomerName + "',CustomerAddress='" + CustomerAddress + "',Bootfile='" + Bootfile + "',Location='" + Location + "',Note='" + Note + "' where IpAddress='" + IpAddress + "'"; MySqlConnect.ExecNonQuery(sql); return(true); } catch { return(false); } }
public bool NW_Dhcp_Customer_DeleteIPStatic_MySQL() { try { string sql = "update NW_Dhcp_Customer set IpPublic='',PoolPublic='',MacPc='' where IpAddress='" + IpAddress + "'"; MySqlConnect.ExecNonQuery(sql); return(true); } catch { return(false); } }
public bool NW_Dhcp_Customer_UpdateIPStatic_MySQL() { string sql = "update NW_Dhcp_Customer set IpPublic='" + IpPublic + "',PoolPublic='" + PoolPublic + "',MacPc='" + MacPc + "',Note='" + Note + "' where IpAddress='" + IpAddress + "'"; try { MySqlConnect.ExecNonQuery(sql); return(true); } catch { return(false); } }
public DataTable NW_Dhcp_Ip_GetbyPoolModem_MySQL() { string sql = "select * from NW_Dhcp_Ip where Name like '%Modem%'"; return(MySqlConnect.ExecQuery(sql)); }
public DataTable NW_Dhcp_Ip_GetbyCPEStatic_MySQL() { string sql = "select * from NW_Dhcp_Ip where Name like 'CPE%' and Static=1"; return(MySqlConnect.ExecQuery(sql)); }
public DataTable NW_Dhcp_Ip_GetIPbyPool_MySQL() { string sql = "select * from NW_Dhcp_Ip where PoolIP ='" + PoolIp + "'"; return(MySqlConnect.ExecQuery(sql)); }
public DataTable NW_Dhcp_Customer_GetbyIp_MySQL() { string sql = "select * from NW_Dhcp_Customer where IpAddress='" + IpAddress + "'"; return(MySqlConnect.ExecQuery(sql)); }
public DataTable NW_Dhcp_Customer_GetbyPoolPublic_MySQL() { string sql = "select * from NW_Dhcp_Customer where PoolPublic='" + PoolIp + "'"; return(MySqlConnect.ExecQuery(sql)); }