public bool Insert(DataTable dt)
        {
            DbAccess db = new DbAccess();
            db.BeginTransaction();
            try
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    InterfaceController = dt.Rows[i]["InterfaceController"].ToString();
                    Signal = dt.Rows[i]["Signal"].ToString();

                    db.CreateNewSqlCommand();
                    db.AddParameter("@InterfaceController", InterfaceController);
                    db.AddParameter("@Signal", Signal);
                    db.AddParameter("@Datetime", DateTime.Now);
                    db.ExecuteNonQueryWithTransaction("NW_InterfaceControllerWarning_Insert");

                }
                db.CommitTransaction();
                return true;
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return false;
            }
        }
        public bool Insert(DataTable dt)
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    InterfaceController = dt.Rows[i]["InterfaceController"].ToString();
                    Signal = dt.Rows[i]["Signal"].ToString();

                    db.CreateNewSqlCommand();
                    db.AddParameter("@InterfaceController", InterfaceController);
                    db.AddParameter("@Signal", Signal);
                    db.AddParameter("@Datetime", DateTime.Now);
                    db.ExecuteNonQueryWithTransaction("NW_InterfaceControllerWarning_Insert");
                }
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#3
0
        public DataTable NW_SignalLog_5Day_GetSNRLow()
        {
            string   procname = "NW_SignalLog_5Day_GetSNRLow";
            DbAccess db       = new DbAccess();

            db.CreateNewSqlCommand();
            db.AddParameter("@Day", Day);
            db.AddParameter("@Minute", Minute);
            return(db.ExecuteDataTable(procname));
        }
示例#4
0
        public bool Update()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@IpAddress", IpAddress);
                db.AddParameter("@MacAddress", MacAddress);
                db.AddParameter("@MacAddress_CMTS", MacAddress_CMTS);
                db.AddParameter("@CustomerCode", CustomerCode);
                db.AddParameter("@CustomerName", CustomerName);
                db.AddParameter("@CustomerAddress", CustomerAddress);
                db.AddParameter("@Bootfile", Bootfile);
                db.AddParameter("@Location", Location);
                db.AddParameter("@Note", Note);
                db.ExecuteNonQueryWithTransaction("NW_Dhcp_Customer_Update");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#5
0
        public DataTable NW_Trafic_Get()
        {
            string   procname = "NW_Trafic_Get";
            DbAccess db       = new DbAccess();

            db.CreateNewSqlCommand();
            db.AddParameter("@MacAddress", MacAddress);
            db.AddParameter("@Month", Month);
            db.AddParameter("@Year", Year);
            return(db.ExecuteDataTable(procname));
        }
示例#6
0
 public DataTable NW_Device_Status_GetByInterface()
 {
     string procname = "NW_Device_Status_GetByInterface";
     DbAccess db = new DbAccess();
     db.CreateNewSqlCommand();
     db.AddParameter("@Interface", Interface);
     return db.ExecuteDataTable(procname);
 }
示例#7
0
        public DataTable NW_Device_Status_GetByInterface()
        {
            string   procname = "NW_Device_Status_GetByInterface";
            DbAccess db       = new DbAccess();

            db.CreateNewSqlCommand();
            db.AddParameter("@Interface", Interface);
            return(db.ExecuteDataTable(procname));
        }
示例#8
0
        public DataTable NW_Dhcp_Customer_GetbyMacaddress()
        {
            string   procname = "NW_Dhcp_Customer_GetbyMacaddress";
            DbAccess db       = new DbAccess();

            db.CreateNewSqlCommand();
            db.AddParameter("@MacAddress", MacAddress);
            return(db.ExecuteDataTable(procname));
        }
示例#9
0
文件: NW_Device.cs 项目: tayeumi/HFC
        public DataTable NW_Device_GetByMac()
        {
            string   procname = "NW_Device_GetByMac";
            DbAccess db       = new DbAccess();

            db.CreateNewSqlCommand();
            db.AddParameter("@MacAddress", MacAddress);
            return(db.ExecuteDataTable(procname));
        }
示例#10
0
文件: NW_Device.cs 项目: tayeumi/HFC
        public DataTable NW_Device_GetByNodeCode()
        {
            string   procname = "NW_Device_GetByNodeCode";
            DbAccess db       = new DbAccess();

            db.CreateNewSqlCommand();
            db.AddParameter("@NodeCode", NodeCode);
            return(db.ExecuteDataTable(procname));
        }
示例#11
0
        public DataTable NW_Dhcp_Ip_GetIPbyPool()
        {
            string   procname = "NW_Dhcp_Ip_GetIPbyPool";
            DbAccess db       = new DbAccess();

            db.CreateNewSqlCommand();
            db.AddParameter("@PoolIp", PoolIp);
            return(db.ExecuteDataTable(procname));
        }
示例#12
0
        public DataTable NW_SignalLog_5Day_GetByMacLike()
        {
            string   procname = "NW_SignalLog_5Day_GetByMacLike";
            DbAccess db       = new DbAccess();

            db.CreateNewSqlCommand();
            db.AddParameter("@MacAddress", MacAddress);
            return(db.ExecuteDataTable(procname));
        }
示例#13
0
        public DataTable NW_OpticalSW_Get()
        {
            string   procname = "NW_OpticalSW_Get";
            DbAccess db       = new DbAccess();

            db.CreateNewSqlCommand();
            db.AddParameter("@ID", ID);
            return(db.ExecuteDataTable(procname));
        }
示例#14
0
 public bool Insert()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@Name", Name);
         db.AddParameter("@IpAddress", IpAddress);
         db.ExecuteNonQueryWithTransaction("NW_OpticalSW_Insert");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#15
0
        public bool Insert()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@Name", Name);
                db.AddParameter("@IpAddress", IpAddress);
                db.ExecuteNonQueryWithTransaction("NW_OpticalSW_Insert");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#16
0
文件: NW_Node.cs 项目: tayeumi/HFC
        public bool UpdateByPath()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@NodeCode", NodeCode);
                db.AddParameter("@Path", Path);
                db.ExecuteNonQueryWithTransaction("NW_Node_UpdateByPath");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#17
0
 public bool Insert()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@Interface", Interface);
         db.AddParameter("@SignalGroup", SignalGroup);
         db.AddParameter("@Description", Description);
         db.ExecuteNonQueryWithTransaction("NW_Interface_Insert");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#18
0
文件: NW_Device.cs 项目: tayeumi/HFC
        public bool Update()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@MacAddress", MacAddress);
                db.AddParameter("@Value1", Value1);
                db.AddParameter("@Value2", Value2);
                db.AddParameter("@Value3", Value3);
                db.AddParameter("@DateTime", DateTime);
                db.AddParameter("@Status", Status);
                db.ExecuteNonQueryWithTransaction("NW_Device_Update");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#19
0
        public bool Insert()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@MacAddress", MacAddress);
                db.AddParameter("@DS", DS);
                db.AddParameter("@US", US);
                db.AddParameter("@DateTime", DateTime);
                db.AddParameter("@CurrentDS", CurrentDS);
                db.AddParameter("@CurrentUS", CurrentUS);
                db.ExecuteNonQueryWithTransaction("NW_CurrentTrafic_Insert");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#20
0
文件: NW_Device.cs 项目: tayeumi/HFC
        public bool Insert()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@MacAddress", MacAddress);
                db.AddParameter("@NodeCode", NodeCode);
                db.AddParameter("@Description", Description);
                db.ExecuteNonQueryWithTransaction("NW_Device_Insert");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#21
0
 public bool Insert()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@ID", ID);
         db.AddParameter("@Pass", Pass);
         db.AddParameter("@User", User);
         db.AddParameter("@PC", PC);
         db.AddParameter("@DateTime", DateTime);
         db.ExecuteNonQueryWithTransaction("NW_Teamview_Insert");
         db.CommitTransaction();
         return true;
     }
     catch
     {
         db.RollbackTransaction();
         return false;
     }
 }
示例#22
0
        public bool Insert()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@Interface", Interface);
                db.AddParameter("@SignalGroup", SignalGroup);
                db.AddParameter("@Description", Description);
                db.ExecuteNonQueryWithTransaction("NW_Interface_Insert");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#23
0
 public bool Insert()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@Interface", Interface);
         db.AddParameter("@Modems", Modems);
         db.AddParameter("@Hosts", Hosts);
         db.AddParameter("@DateTime", DateTime);
         db.ExecuteNonQueryWithTransaction("NW_Device_Status_Insert");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#24
0
        public bool Insert()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@ID", ID);
                db.AddParameter("@Pass", Pass);
                db.AddParameter("@User", User);
                db.AddParameter("@PC", PC);
                db.AddParameter("@DateTime", DateTime);
                db.ExecuteNonQueryWithTransaction("NW_Teamview_Insert");
                db.CommitTransaction();
                return(true);
            }
            catch
            {
                db.RollbackTransaction();
                return(false);
            }
        }
示例#25
0
        public bool Insert()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@Interface", Interface);
                db.AddParameter("@Modems", Modems);
                db.AddParameter("@Hosts", Hosts);
                db.AddParameter("@DateTime", DateTime);
                db.ExecuteNonQueryWithTransaction("NW_Device_Status_Insert");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#26
0
        public bool NW_Dhcp_Customer_UpdateIPStatic()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@IpAddress", IpAddress);
                db.AddParameter("@IpPublic", IpPublic);
                db.AddParameter("@PoolPublic", PoolPublic);
                db.AddParameter("@MacPc", MacPc);
                db.AddParameter("@Note", Note);
                db.ExecuteNonQueryWithTransaction("NW_Dhcp_Customer_UpdateIPStatic");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#27
0
 public bool Insert()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@MacAddress", MacAddress);
         db.AddParameter("@DS", DS);
         db.AddParameter("@US", US);
         db.AddParameter("@DateTime", DateTime);
         db.AddParameter("@CurrentDS", CurrentDS);
         db.AddParameter("@CurrentUS", CurrentUS);
         db.ExecuteNonQueryWithTransaction("NW_CurrentTrafic_Insert");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#28
0
 public bool Delete()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@ID", ID);
         db.ExecuteNonQueryWithTransaction("NW_Teamview_Delete");
         db.CommitTransaction();
         return true;
     }
     catch
     {
         db.RollbackTransaction();
         return false;
     }
 }
示例#29
0
        public bool Delete()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@ID", ID);
                db.ExecuteNonQueryWithTransaction("NW_Teamview_Delete");
                db.CommitTransaction();
                return(true);
            }
            catch
            {
                db.RollbackTransaction();
                return(false);
            }
        }
示例#30
0
文件: NW_Node.cs 项目: tayeumi/HFC
 public bool Delete()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@NodeCode", NodeCode);
         db.ExecuteNonQueryWithTransaction("NW_Node_Delete");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#31
0
文件: NW_Device.cs 项目: tayeumi/HFC
 public bool Update()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@MacAddress", MacAddress);
         db.AddParameter("@Value1", Value1);
         db.AddParameter("@Value2", Value2);
         db.AddParameter("@Value3", Value3);
         db.AddParameter("@DateTime", DateTime);
         db.AddParameter("@Status", Status);
         db.ExecuteNonQueryWithTransaction("NW_Device_Update");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#32
0
 public DataTable NW_Dhcp_Customer_GetbyMacaddress()
 {
     string procname = "NW_Dhcp_Customer_GetbyMacaddress";
     DbAccess db = new DbAccess();
     db.CreateNewSqlCommand();
     db.AddParameter("@MacAddress", MacAddress);
     return db.ExecuteDataTable(procname);
 }
示例#33
0
 public DataTable NW_Dhcp_Customer_GetbyPoolPublic()
 {
     string procname = "NW_Dhcp_Customer_GetbyPoolPublic";
     DbAccess db = new DbAccess();
     db.CreateNewSqlCommand();
     db.AddParameter("@PoolIp", PoolIp);
     return db.ExecuteDataTable(procname);
 }
示例#34
0
 public bool NW_Dhcp_Customer_UpdateIPStatic()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@IpAddress", IpAddress);
         db.AddParameter("@IpPublic", IpPublic);
         db.AddParameter("@PoolPublic", PoolPublic);
         db.AddParameter("@MacPc", MacPc);
         db.AddParameter("@Note", Note);
         db.ExecuteNonQueryWithTransaction("NW_Dhcp_Customer_UpdateIPStatic");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#35
0
 public bool Insert()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@IpAddress", IpAddress);
         db.AddParameter("@MacAddress", MacAddress);
         db.AddParameter("@MacAddress_CMTS", MacAddress_CMTS);
         db.AddParameter("@CustomerCode", CustomerCode);
         db.AddParameter("@CustomerName", CustomerName);
         db.AddParameter("@CustomerAddress", CustomerAddress);
         db.AddParameter("@PoolIp", PoolIp);
         db.AddParameter("@Bootfile", Bootfile);
         db.AddParameter("@IpPublic", IpPublic);
         db.AddParameter("@MacPc", MacPc);
         db.AddParameter("@PoolPublic", PoolPublic);
         db.AddParameter("@Location", Location);
         db.AddParameter("@Note", Note);
         db.ExecuteNonQueryWithTransaction("NW_Dhcp_Customer_Insert");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#36
0
        public bool Insert()
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                db.CreateNewSqlCommand();
                db.AddParameter("@MacAddress", MacAddress);
                db.AddParameter("@IpPrivate", IpPrivate);
                db.AddParameter("@IpPublic1", IpPublic1);
                db.AddParameter("@IpPublic2", IpPublic2);
                db.AddParameter("@Value1", Value1);
                db.AddParameter("@Value2", Value2);
                db.AddParameter("@Value3", Value3);
                db.AddParameter("@Value4", Value4);
                db.AddParameter("@Status", Status);
                db.AddParameter("@Location", Location);
                db.AddParameter("@DateTime", DateTime);
                db.AddParameter("@Description", Description);
                db.AddParameter("@CurrentDS", CurrentDS);
                db.AddParameter("@CurrentUS", CurrentUS);
                db.ExecuteNonQueryWithTransaction("NW_SignalLog_Insert");
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#37
0
 public DataTable NW_OpticalSW_Get()
 {
     string procname = "NW_OpticalSW_Get";
     DbAccess db = new DbAccess();
     db.CreateNewSqlCommand();
     db.AddParameter("@ID", ID);
     return db.ExecuteDataTable(procname);
 }
示例#38
0
 public bool Insert()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@MacAddress", MacAddress);
         db.AddParameter("@IpPrivate", IpPrivate);
         db.AddParameter("@IpPublic1", IpPublic1);
         db.AddParameter("@IpPublic2", IpPublic2);
         db.AddParameter("@Value1", Value1);
         db.AddParameter("@Value2", Value2);
         db.AddParameter("@Value3", Value3);
         db.AddParameter("@Value4", Value4);
         db.AddParameter("@Status", Status);
         db.AddParameter("@Location", Location);
         db.AddParameter("@DateTime", DateTime);
         db.AddParameter("@Description", Description);
         db.AddParameter("@CurrentDS", CurrentDS);
         db.AddParameter("@CurrentUS", CurrentUS);
         db.ExecuteNonQueryWithTransaction("NW_SignalLog_Insert");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#39
0
文件: NW_Node.cs 项目: tayeumi/HFC
 public DataTable NW_Node_Get()
 {
     string procname = "NW_Node_Get";
     DbAccess db = new DbAccess();
     db.CreateNewSqlCommand();
     db.AddParameter("@NodeCode", NodeCode);
     return db.ExecuteDataTable(procname);
 }
示例#40
0
        public bool Insert(DataTable dt)
        {
            DbAccess db = new DbAccess();

            db.BeginTransaction();
            try
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    InterfaceName  = dt.Rows[i]["InterfaceName"].ToString();
                    FullName       = dt.Rows[i]["FullName"].ToString();
                    Inbps          = (float)dt.Rows[i]["Inbps"];
                    Outbps         = (float)dt.Rows[i]["Outbps"];
                    InBandwidth    = (double)dt.Rows[i]["InBandwidth"];
                    OutBandwidth   = (double)dt.Rows[i]["OutBandwidth"];
                    InPercentUtil  = int.Parse(dt.Rows[i]["InPercentUtil"].ToString());
                    OutPercentUtil = int.Parse(dt.Rows[i]["OutPercentUtil"].ToString());
                    LastSync       = (DateTime)dt.Rows[i]["LastSync"];
                    Status         = dt.Rows[i]["Status"].ToString();


                    db.CreateNewSqlCommand();
                    db.AddParameter("@InterfaceName", InterfaceName);
                    db.AddParameter("@FullName", FullName);
                    db.AddParameter("@Inbps", Inbps);
                    db.AddParameter("@Outbps", Outbps);
                    db.AddParameter("@InBandwidth", InBandwidth);
                    db.AddParameter("@OutBandwidth", OutBandwidth);
                    db.AddParameter("@InPercentUtil", InPercentUtil);
                    db.AddParameter("@OutPercentUtil", OutPercentUtil);
                    db.AddParameter("@DateTime", DateTime);
                    db.AddParameter("@StrDate", StrDate);
                    db.AddParameter("@LastSync", LastSync);
                    db.AddParameter("@Status", Status);

                    db.ExecuteNonQueryWithTransaction("NW_InterfaceLog_Insert");
                }
                db.CommitTransaction();
                return(true);
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return(false);
            }
        }
示例#41
0
 public DataTable NW_SignalLog_GetByMac()
 {
     string procname = "NW_SignalLog_GetByMac";
     DbAccess db = new DbAccess();
     db.CreateNewSqlCommand();
     db.AddParameter("@MacAddress", MacAddress);
     return db.ExecuteDataTable(procname);
 }
示例#42
0
文件: NW_Device.cs 项目: tayeumi/HFC
 public bool Insert()
 {
     DbAccess db = new DbAccess();
     db.BeginTransaction();
     try
     {
         db.CreateNewSqlCommand();
         db.AddParameter("@MacAddress", MacAddress);
         db.AddParameter("@NodeCode", NodeCode);
         db.AddParameter("@Description", Description);
         db.ExecuteNonQueryWithTransaction("NW_Device_Insert");
         db.CommitTransaction();
         return true;
     }
     catch (Exception ex)
     {
         db.RollbackTransaction();
         Class.App.Log_Write(ex.Message);
         return false;
     }
 }
示例#43
0
 public DataTable NW_Trafic_Get()
 {
     string procname = "NW_Trafic_Get";
     DbAccess db = new DbAccess();
     db.CreateNewSqlCommand();
     db.AddParameter("@MacAddress", MacAddress);
     db.AddParameter("@Month", Month);
     db.AddParameter("@Year", Year);
     return db.ExecuteDataTable(procname);
 }
示例#44
0
 public DataTable NW_SignalLog_5Day_GetSNRLow()
 {
     string procname = "NW_SignalLog_5Day_GetSNRLow";
     DbAccess db = new DbAccess();
     db.CreateNewSqlCommand();
     db.AddParameter("@Day", Day);
     db.AddParameter("@Minute", Minute);
     return db.ExecuteDataTable(procname);
 }
示例#45
0
        public bool Insert(DataTable dt)
        {
            DbAccess db = new DbAccess();
            db.BeginTransaction();
            try
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    InterfaceName = dt.Rows[i]["InterfaceName"].ToString();
                    FullName = dt.Rows[i]["FullName"].ToString();
                    Inbps = (float)dt.Rows[i]["Inbps"];
                    Outbps = (float)dt.Rows[i]["Outbps"];
                    InBandwidth = (double)dt.Rows[i]["InBandwidth"];
                    OutBandwidth = (double)dt.Rows[i]["OutBandwidth"];
                    InPercentUtil = int.Parse(dt.Rows[i]["InPercentUtil"].ToString());
                    OutPercentUtil = int.Parse(dt.Rows[i]["OutPercentUtil"].ToString());
                    LastSync = (DateTime)dt.Rows[i]["LastSync"];
                    Status = dt.Rows[i]["Status"].ToString();

                    db.CreateNewSqlCommand();
                    db.AddParameter("@InterfaceName", InterfaceName);
                    db.AddParameter("@FullName", FullName);
                    db.AddParameter("@Inbps", Inbps);
                    db.AddParameter("@Outbps", Outbps);
                    db.AddParameter("@InBandwidth", InBandwidth);
                    db.AddParameter("@OutBandwidth", OutBandwidth);
                    db.AddParameter("@InPercentUtil", InPercentUtil);
                    db.AddParameter("@OutPercentUtil", OutPercentUtil);
                    db.AddParameter("@DateTime", DateTime);
                    db.AddParameter("@StrDate", StrDate);
                    db.AddParameter("@LastSync", LastSync);
                    db.AddParameter("@Status", Status);

                    db.ExecuteNonQueryWithTransaction("NW_InterfaceLog_Insert");
                }
                db.CommitTransaction();
                return true;
            }
            catch (Exception ex)
            {
                db.RollbackTransaction();
                Class.App.Log_Write(ex.Message);
                return false;
            }
        }