Esempio n. 1
0
        /// <summary>
        /// 补齐字段,加空值判断
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="task"></param>
        public static void InsertTask(string conn, Task task)
        {
            #region 之前的代码
            ////StringBuilder sb = new StringBuilder();
            ////sb.Append("insert into Task ([taskID],[taskType],[city],[manufacturer],[omcName]," +
            ////    "[oltID],[ponID],[onuID],[onuPort],[onuType],[svlan],[cvlan]," +
            ////    "[phone],[receiveTime]) values('");
            ////sb.Append(task.TaskID.ToString());
            ////sb.Append("','");
            ////sb.Append(IdlUtil.ParseTaskTypeToString(task.Type));
            ////sb.Append("','");
            ////sb.Append(task.City);
            ////sb.Append("','");
            ////sb.Append(task.Manufacturer);
            ////sb.Append("','");
            ////sb.Append(task.OmcName);
            ////sb.Append("',");
            ////sb.Append(task.OltID == null ? "null" : ("'" + task.OltID + "'"));
            ////sb.Append(",");
            ////sb.Append(task.PonID == null ? "null" : ("'" + task.PonID + "'"));
            ////sb.Append(",");
            ////sb.Append(task.OnuID == null ? "null" : ("'" + task.OnuID + "'"));
            ////sb.Append(",");
            ////sb.Append(task.OnuType == null ? "null" : ("'" + task.OnuType + "'"));
            ////sb.Append(",");
            ////sb.Append(task.Svlan == -1 ? "null" : task.Svlan.ToString());
            ////sb.Append(",");
            ////sb.Append(task.Cvlan == -1 ? "null" : task.Cvlan.ToString());
            ////sb.Append(",'");
            ////sb.Append(task.Phone);
            ////sb.Append("',");
            ////sb.Append(",'");
            //////sb.Append(task.ResponseBoss);
            //////sb.Append("','");
            ////sb.Append(task.ReceiveTime.ToString());
            ////sb.Append("')");
            ////SqlHelper.ExecuteNonQuery(conn, CommandType.Text, sb.ToString());
            #endregion

            System.Data.SqlClient.SqlParameter sp_taskID       = new System.Data.SqlClient.SqlParameter("@taskID", task.TaskID);
            System.Data.SqlClient.SqlParameter sp_taskType     = new System.Data.SqlClient.SqlParameter("@taskType", IdlUtil.ParseTaskTypeToString(task.Type));
            System.Data.SqlClient.SqlParameter sp_city         = new System.Data.SqlClient.SqlParameter("@city", task.City);
            System.Data.SqlClient.SqlParameter sp_manufacturer = new System.Data.SqlClient.SqlParameter("@manufacturer", task.Manufacturer);
            System.Data.SqlClient.SqlParameter sp_omcName      = new System.Data.SqlClient.SqlParameter("@omcName", task.OmcName);
            System.Data.SqlClient.SqlParameter sp_oltID        = new System.Data.SqlClient.SqlParameter("@oltID", task.OltID);
            System.Data.SqlClient.SqlParameter sp_ponID        = new System.Data.SqlClient.SqlParameter("@ponID", task.PonID);
            System.Data.SqlClient.SqlParameter sp_onuID        = new System.Data.SqlClient.SqlParameter("@onuID", task.OnuID);
            System.Data.SqlClient.SqlParameter sp_svlan        = new System.Data.SqlClient.SqlParameter("@svlan", task.Svlan);
            System.Data.SqlClient.SqlParameter sp_cvlan        = new System.Data.SqlClient.SqlParameter("@cvlan", task.Cvlan);
            System.Data.SqlClient.SqlParameter sp_phone        = new System.Data.SqlClient.SqlParameter("@phone", task.Phone);
            System.Data.SqlClient.SqlParameter sp_receiveTime  = new System.Data.SqlClient.SqlParameter("@receiveTime", task.ReceiveTime);
            System.Data.SqlClient.SqlParameter sp_mvlan        = new System.Data.SqlClient.SqlParameter("@mvlan", task.Mvlan);
            System.Data.SqlClient.SqlParameter sp_feNumber     = new System.Data.SqlClient.SqlParameter("@feNumber", task.FENumber);
            System.Data.SqlClient.SqlParameter sp_potsNumber   = new System.Data.SqlClient.SqlParameter("@potsNumber", task.POTSNumber);
            SQLUtil.ExecProc(conn, "spInsertTask", sp_taskID, sp_taskType, sp_city, sp_manufacturer, sp_omcName, sp_oltID, sp_ponID, sp_onuID, sp_svlan,
                             sp_cvlan, sp_phone, sp_receiveTime, sp_mvlan, sp_feNumber, sp_potsNumber);
        }
Esempio n. 2
0
        public static void InsertRelocateTask(string conn, string taskID, string taskType, string city, string manufacturer, string omcName,
                                              string oltID, string ponID, string onuID, string phone, int svlan, int cvlan, int mvlan, int feNumber, int potsNumber,
                                              string oldCity, string oldManufacturer, string oldOmcName, string oldOltID, string oldPonID, string oldOnuID,
                                              string oldPhone, int oldSvlan, int oldCvlan, int oldmvlan, int oldFeNumber, int oldPotsNumber, string IsContainIMS,
                                              int imsSvlan, int imsCvlan, string IsContainIPTV, int iptvSvlan, int iptvCvlan)
        {
            System.Data.SqlClient.SqlParameter sp_taskID       = new System.Data.SqlClient.SqlParameter("@taskID", taskID);
            System.Data.SqlClient.SqlParameter sp_taskType     = new System.Data.SqlClient.SqlParameter("@taskType", taskType);
            System.Data.SqlClient.SqlParameter sp_city         = new System.Data.SqlClient.SqlParameter("@city", city);
            System.Data.SqlClient.SqlParameter sp_manufacturer = new System.Data.SqlClient.SqlParameter("@manufacturer", manufacturer);
            System.Data.SqlClient.SqlParameter sp_omcName      = new System.Data.SqlClient.SqlParameter("@omcName", omcName);
            System.Data.SqlClient.SqlParameter sp_oltID        = new System.Data.SqlClient.SqlParameter("@oltID", oltID);
            System.Data.SqlClient.SqlParameter sp_ponID        = new System.Data.SqlClient.SqlParameter("@ponID", ponID);
            System.Data.SqlClient.SqlParameter sp_onuID        = new System.Data.SqlClient.SqlParameter("@onuID", onuID);
            System.Data.SqlClient.SqlParameter sp_phone        = new System.Data.SqlClient.SqlParameter("@phone", phone);
            System.Data.SqlClient.SqlParameter sp_svlan        = new System.Data.SqlClient.SqlParameter("@svlan", svlan);
            System.Data.SqlClient.SqlParameter sp_cvlan        = new System.Data.SqlClient.SqlParameter("@cvlan", cvlan);
            System.Data.SqlClient.SqlParameter sp_mvlan        = new System.Data.SqlClient.SqlParameter("@mvlan", mvlan);
            System.Data.SqlClient.SqlParameter sp_feNumber     = new System.Data.SqlClient.SqlParameter("@feNumber", feNumber);
            System.Data.SqlClient.SqlParameter sp_potsNumber   = new System.Data.SqlClient.SqlParameter("@potsNumber", potsNumber);
            System.Data.SqlClient.SqlParameter sp_receiveTime  = new System.Data.SqlClient.SqlParameter("@receiveTime", DateTime.Now.ToString());

            System.Data.SqlClient.SqlParameter sp_oldCity         = new System.Data.SqlClient.SqlParameter("@oldCity", oldCity);
            System.Data.SqlClient.SqlParameter sp_oldManufacturer = new System.Data.SqlClient.SqlParameter("@oldManufacturer", oldManufacturer);
            System.Data.SqlClient.SqlParameter sp_oldOmcName      = new System.Data.SqlClient.SqlParameter("@oldOmcName", oldOmcName);
            System.Data.SqlClient.SqlParameter sp_oldOltID        = new System.Data.SqlClient.SqlParameter("@oldOltID", oldOltID);
            System.Data.SqlClient.SqlParameter sp_oldPonID        = new System.Data.SqlClient.SqlParameter("@oldPonID", oldPonID);
            System.Data.SqlClient.SqlParameter sp_oldOnuID        = new System.Data.SqlClient.SqlParameter("@oldOnuID", oldOnuID);
            System.Data.SqlClient.SqlParameter sp_oldphone        = new System.Data.SqlClient.SqlParameter("@oldphone", phone);
            System.Data.SqlClient.SqlParameter sp_oldSvlan        = new System.Data.SqlClient.SqlParameter("@oldSvlan", oldSvlan);
            System.Data.SqlClient.SqlParameter sp_oldCvlan        = new System.Data.SqlClient.SqlParameter("@oldCvlan", oldCvlan);
            System.Data.SqlClient.SqlParameter sp_oldmvlan        = new System.Data.SqlClient.SqlParameter("@oldmvlan", oldmvlan);
            System.Data.SqlClient.SqlParameter sp_oldFeNumber     = new System.Data.SqlClient.SqlParameter("@oldFeNumber", oldFeNumber);
            System.Data.SqlClient.SqlParameter sp_oldPotsNumber   = new System.Data.SqlClient.SqlParameter("@oldPotsNumber", oldPotsNumber);

            System.Data.SqlClient.SqlParameter sp_IsContainIMS = new System.Data.SqlClient.SqlParameter("@IsContainIMS", IsContainIMS);
            System.Data.SqlClient.SqlParameter sp_imsSvlan     = new System.Data.SqlClient.SqlParameter("@imsSvlan", imsSvlan);
            System.Data.SqlClient.SqlParameter sp_imsCvlan     = new System.Data.SqlClient.SqlParameter("@imsCvlan", imsCvlan);

            System.Data.SqlClient.SqlParameter sp_IsContainIPTV = new System.Data.SqlClient.SqlParameter("@IsContainIPTV", IsContainIPTV);
            System.Data.SqlClient.SqlParameter sp_iptvSvlan     = new System.Data.SqlClient.SqlParameter("@iptvSvlan", iptvSvlan);
            System.Data.SqlClient.SqlParameter sp_iptvCvlan     = new System.Data.SqlClient.SqlParameter("@iptvCvlan", iptvCvlan);

            SQLUtil.ExecProc(conn, "spInsertRelocateTask", sp_taskID, sp_taskType, sp_city, sp_manufacturer, sp_omcName, sp_oltID, sp_ponID,
                             sp_onuID, sp_phone, sp_svlan, sp_cvlan, sp_mvlan, sp_feNumber, sp_potsNumber, sp_receiveTime, sp_oldCity, sp_oldManufacturer,
                             sp_oldOmcName, sp_oldOltID, sp_oldPonID, sp_oldOnuID, sp_oldphone, sp_oldSvlan, sp_oldCvlan, sp_oldmvlan, sp_oldFeNumber,
                             sp_oldPotsNumber, sp_IsContainIMS, sp_imsSvlan, sp_imsCvlan, sp_IsContainIPTV, sp_iptvSvlan, sp_iptvCvlan);
        }
Esempio n. 3
0
        public static void ClearOMCAlarm(string conn, OMC omc)
        {
            SqlParameter spOMCName = new SqlParameter("@omcName", omc.OmcName);

            SQLUtil.ExecProc(conn, "spClearOMCAlarm", spOMCName);
        }