Пример #1
0
 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);
     }
 }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
        //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);
            }
        }
Пример #5
0
 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);
     }
 }
Пример #6
0
 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);
     }
 }
Пример #7
0
        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);
            }
        }
Пример #8
0
        public DataTable NW_Dhcp_Ip_GetbyPoolModem_MySQL()
        {
            string sql = "select * from NW_Dhcp_Ip where Name like '%Modem%'";

            return(MySqlConnect.ExecQuery(sql));
        }
Пример #9
0
        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));
        }
Пример #10
0
        public DataTable NW_Dhcp_Ip_GetIPbyPool_MySQL()
        {
            string sql = "select * from NW_Dhcp_Ip where PoolIP ='" + PoolIp + "'";

            return(MySqlConnect.ExecQuery(sql));
        }
Пример #11
0
        public DataTable NW_Dhcp_Customer_GetbyIp_MySQL()
        {
            string sql = "select * from NW_Dhcp_Customer where IpAddress='" + IpAddress + "'";

            return(MySqlConnect.ExecQuery(sql));
        }
Пример #12
0
        public DataTable NW_Dhcp_Customer_GetbyPoolPublic_MySQL()
        {
            string sql = "select * from NW_Dhcp_Customer where PoolPublic='" + PoolIp + "'";

            return(MySqlConnect.ExecQuery(sql));
        }