예제 #1
0
        /// <summary>
        /// 增加一个设备
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool Add(Model.EquipmentInfo model)
        {
            string       strSql           = "insert into EquipmentInfo(StationOName,StationName,DeviceType,Type,SerialNumber,InstallationDate,LoginName,Password,SatelliteSystem,AntennaH,AntennaHM,AntennaHML,IP,SubnetMask,Gateway,Port,BaudRate,DataConfiguration,MaintenanceTime,MaintenanceContent,MaintenancePerson, AntennaType, AntennaDate, AntennaModels, AntennaSerialNumber, MeteorologicalType, MeteorologicalDate, MeteorologicalModels, MeteorologicalSerialNumber, AtomicclkType, AtomicclkDate, AtomicclkModels, AtomicclkSerialNumber, switchType, switchDate, switchModels, switchSerialNumber, routerType, routerDate, routerModels, routerSerialNumber, FirewallType, FirewallDate, FirewallSerialNumber, FirewallModels, LightningType, LightningDate, LightningModels, LightningSerialNumber, ComputerType, ComputerModels, ComputerSerialNumber, ComputerDate,EquipID) values(@StationOName,@StationName,@DeviceType,@Type,@SerialNumber,@InstallationDate,@LoginName,@Password,@SatelliteSystem,@AntennaH,@AntennaHM,@AntennaHML,@IP,@SubnetMask,@Gateway,@Port,@BaudRate,@DataConfiguration,@MaintenanceTime,@MaintenanceContent,@MaintenancePerson, @AntennaType, @AntennaDate, @AntennaModels, @AntennaSerialNumber,@MeteorologicalType, @MeteorologicalDate, @MeteorologicalModels, @MeteorologicalSerialNumber, @AtomicclkType, @AtomicclkDate, @AtomicclkModels, @AtomicclkSerialNumber, @switchType, @switchDate, @switchModels, @switchSerialNumber, @routerType, @routerDate, @routerModels, @routerSerialNumber, @FirewallType, @FirewallDate, @FirewallSerialNumber, @FirewallModels, @LightningType, @LightningDate, @LightningModels, @LightningSerialNumber, @ComputerType, @ComputerModels, @ComputerSerialNumber, @ComputerDate,@EquipID)";
            SqlParameter StationOName     = new SqlParameter("StationOName", SqlDbType.NVarChar); StationOName.Value = model.StationOName;
            SqlParameter StationName      = new SqlParameter("StationName", SqlDbType.NVarChar); StationName.Value = model.StationName;
            SqlParameter DeviceType       = new SqlParameter("DeviceType", SqlDbType.NVarChar); DeviceType.Value = model.DeviceType;
            SqlParameter Type             = new SqlParameter("Type", SqlDbType.NVarChar); Type.Value = model.Type;
            SqlParameter SerialNumber     = new SqlParameter("SerialNumber", SqlDbType.NVarChar); SerialNumber.Value = model.SerialNumber;
            SqlParameter InstallationDate = new SqlParameter("InstallationDate", SqlDbType.DateTime); InstallationDate.Value = model.InstallationDate;
            SqlParameter LoginName        = new SqlParameter("LoginName", SqlDbType.NVarChar); LoginName.Value = model.LoginName;
            SqlParameter Password         = new SqlParameter("Password", SqlDbType.NVarChar); Password.Value = model.Password;
            SqlParameter SatelliteSystem  = new SqlParameter("SatelliteSystem", SqlDbType.NVarChar); SatelliteSystem.Value = model.SatelliteSystem;
            SqlParameter AntennaH         = new SqlParameter("AntennaH", SqlDbType.Float); AntennaH.Value = model.AntennaH;
            SqlParameter AntennaHM        = new SqlParameter("AntennaHM", SqlDbType.NVarChar); AntennaHM.Value = model.AntennaHM;
            SqlParameter AntennaHML       = new SqlParameter("AntennaHML", SqlDbType.NVarChar); AntennaHML.Value = model.AntennaHML;
            SqlParameter IP                         = new SqlParameter("IP", SqlDbType.NVarChar); IP.Value = model.IP;
            SqlParameter SubnetMask                 = new SqlParameter("SubnetMask", SqlDbType.NVarChar); SubnetMask.Value = model.SubnetMask;
            SqlParameter Gateway                    = new SqlParameter("Gateway", SqlDbType.NVarChar); Gateway.Value = model.Gateway;
            SqlParameter Port                       = new SqlParameter("Port", SqlDbType.NVarChar); Port.Value = model.Port;
            SqlParameter BaudRate                   = new SqlParameter("BaudRate", SqlDbType.NVarChar); BaudRate.Value = model.BaudRate;
            SqlParameter DataConfiguration          = new SqlParameter("DataConfiguration", SqlDbType.NVarChar); DataConfiguration.Value = model.DataConfiguration;
            SqlParameter MaintenanceTime            = new SqlParameter("MaintenanceTime", SqlDbType.DateTime); MaintenanceTime.Value = model.MaintenanceTime;
            SqlParameter MaintenanceContent         = new SqlParameter("MaintenanceContent", SqlDbType.NVarChar); MaintenanceContent.Value = model.MaintenanceContent;
            SqlParameter MaintenancePerson          = new SqlParameter("MaintenancePerson", SqlDbType.NVarChar); MaintenancePerson.Value = model.MaintenancePerson;
            SqlParameter AntennaType                = new SqlParameter("AntennaType", SqlDbType.NVarChar); AntennaType.Value = model.AntennaType;
            SqlParameter AntennaDate                = new SqlParameter("AntennaDate", SqlDbType.DateTime); AntennaDate.Value = model.AntennaDate;
            SqlParameter AntennaModels              = new SqlParameter("AntennaModels", SqlDbType.NVarChar); AntennaModels.Value = model.AntennaModels;
            SqlParameter AntennaSerialNumber        = new SqlParameter("AntennaSerialNumber", SqlDbType.NVarChar); AntennaSerialNumber.Value = model.AntennaSerialNumber;
            SqlParameter MeteorologicalType         = new SqlParameter("MeteorologicalType", SqlDbType.NVarChar); MeteorologicalType.Value = model.MeteorologicalType;
            SqlParameter MeteorologicalDate         = new SqlParameter("MeteorologicalDate", SqlDbType.DateTime); MeteorologicalDate.Value = model.MeteorologicalDate;
            SqlParameter MeteorologicalModels       = new SqlParameter("MeteorologicalModels", SqlDbType.NVarChar); MeteorologicalModels.Value = model.MeteorologicalModels;
            SqlParameter MeteorologicalSerialNumber = new SqlParameter("MeteorologicalSerialNumber", SqlDbType.NVarChar); MeteorologicalSerialNumber.Value = model.MeteorologicalSerialNumber;
            SqlParameter AtomicclkType              = new SqlParameter("AtomicclkType", SqlDbType.NVarChar); AtomicclkType.Value = model.AtomicclkType;
            SqlParameter AtomicclkDate              = new SqlParameter("AtomicclkDate", SqlDbType.DateTime); AtomicclkDate.Value = model.AtomicclkDate;
            SqlParameter AtomicclkModels            = new SqlParameter("AtomicclkModels", SqlDbType.NVarChar); AtomicclkModels.Value = model.AtomicclkModels;
            SqlParameter AtomicclkSerialNumber      = new SqlParameter("AtomicclkSerialNumber", SqlDbType.NVarChar); AtomicclkSerialNumber.Value = model.AtomicclkSerialNumber;
            SqlParameter switchType                 = new SqlParameter("switchType", SqlDbType.NVarChar); switchType.Value = model.switchType;
            SqlParameter switchDate                 = new SqlParameter("switchDate", SqlDbType.DateTime); switchDate.Value = model.switchDate;
            SqlParameter switchModels               = new SqlParameter("switchModels", SqlDbType.NVarChar); switchModels.Value = model.switchModels;
            SqlParameter switchSerialNumber         = new SqlParameter("switchSerialNumber", SqlDbType.NVarChar); switchSerialNumber.Value = model.switchSerialNumber;
            SqlParameter routerType                 = new SqlParameter("routerType", SqlDbType.NVarChar); routerType.Value = model.routerType;
            SqlParameter routerDate                 = new SqlParameter("routerDate", SqlDbType.DateTime); routerDate.Value = model.routerDate;
            SqlParameter routerModels               = new SqlParameter("routerModels", SqlDbType.NVarChar); routerModels.Value = model.routerModels;
            SqlParameter routerSerialNumber         = new SqlParameter("routerSerialNumber", SqlDbType.NVarChar); routerSerialNumber.Value = model.routerSerialNumber;
            SqlParameter FirewallType               = new SqlParameter("FirewallType", SqlDbType.NVarChar); FirewallType.Value = model.FirewallType;
            SqlParameter FirewallDate               = new SqlParameter("FirewallDate", SqlDbType.DateTime); FirewallDate.Value = model.FirewallDate;
            SqlParameter FirewallSerialNumber       = new SqlParameter("FirewallSerialNumber", SqlDbType.NVarChar); FirewallSerialNumber.Value = model.FirewallSerialNumber;
            SqlParameter FirewallModels             = new SqlParameter("FirewallModels", SqlDbType.NVarChar); FirewallModels.Value = model.FirewallModels;
            SqlParameter LightningType              = new SqlParameter("LightningType", SqlDbType.NVarChar); LightningType.Value = model.LightningType;
            SqlParameter LightningDate              = new SqlParameter("LightningDate", SqlDbType.DateTime); LightningDate.Value = model.LightningDate;
            SqlParameter LightningModels            = new SqlParameter("LightningModels", SqlDbType.NVarChar); LightningModels.Value = model.LightningModels;
            SqlParameter LightningSerialNumber      = new SqlParameter("LightningSerialNumber", SqlDbType.NVarChar); LightningSerialNumber.Value = model.LightningSerialNumber;
            SqlParameter ComputerType               = new SqlParameter("ComputerType", SqlDbType.NVarChar); ComputerType.Value = model.ComputerType;
            SqlParameter ComputerModels             = new SqlParameter("ComputerModels", SqlDbType.NVarChar); ComputerModels.Value = model.ComputerModels;
            SqlParameter ComputerSerialNumber       = new SqlParameter("ComputerSerialNumber", SqlDbType.NVarChar); ComputerSerialNumber.Value = model.ComputerSerialNumber;
            SqlParameter ComputerDate               = new SqlParameter("ComputerDate", SqlDbType.DateTime); ComputerDate.Value = model.ComputerDate;
            SqlParameter EquipID                    = new SqlParameter("EquipID", SqlDbType.NVarChar); EquipID.Value = model.EquipID;

            return(DBHelperSQL.GetNums(strSql, new SqlParameter[] { StationOName, StationName, DeviceType, Type, SerialNumber, InstallationDate, LoginName, Password, SatelliteSystem, AntennaH, AntennaHM, AntennaHML, IP, SubnetMask, Gateway, Port, BaudRate, DataConfiguration, MaintenanceTime, MaintenanceContent, MaintenancePerson, AntennaType, AntennaDate, AntennaModels, AntennaSerialNumber, MeteorologicalType, MeteorologicalDate, MeteorologicalModels, MeteorologicalSerialNumber, AtomicclkType, AtomicclkDate, AtomicclkModels, AtomicclkSerialNumber, switchType, switchDate, switchModels, switchSerialNumber, routerType, routerDate, routerModels, routerSerialNumber, FirewallType, FirewallDate, FirewallSerialNumber, FirewallModels, LightningType, LightningDate, LightningModels, LightningSerialNumber, ComputerType, ComputerModels, ComputerSerialNumber, ComputerDate, EquipID }, connectionString) == 1 ? true : false);
        }
예제 #2
0
        private void AddStas()
        {
            Model.CORSStationInfo cors = new Model.CORSStationInfo();
            cors.StationName  = Request.Form["StationName"].ToString();
            cors.StationOName = Request.Form["StationName"].ToString();
            cors.TransferType = Request.Form["TransType"].ToString();
            cors.IP           = Request.Form["Ip"].ToString();
            cors.Port         = Request.Form["Port"].ToString();
            cors.Lat          = double.Parse(Request.Form["Lat"].ToString());
            cors.Lon          = double.Parse(Request.Form["Lon"].ToString());
            cors.H            = double.Parse(Request.Form["H"].ToString());
            cors.Remark       = Request.Form["Remark"].ToString();
            cors.IsOK         = 0;
            if (DAL.CORSStationInfo.Exists(cors.StationName) || DAL.CORSStationInfo.GetModelByOName(cors.StationOName) != null)
            {
                Response.Clear();
                Response.Write("0");
                Response.End();
            }
            else
            {
                Model.EquipmentInfo eq = new Model.EquipmentInfo();
                eq.StationOName = cors.StationOName;
                eq.StationName  = cors.StationName;
                eq.IP           = cors.IP;
                eq.Port         = cors.Port;
                Model.SiteMonitoring ms = new Model.SiteMonitoring();
                ms.StationOName = cors.StationOName;
                try
                {
                    DAL.CORSStationInfo.Add(cors);
                    Model.CORSStationInfo cos = DAL.CORSStationInfo.GetModel(cors.StationName);
                    DAL.EquipmentInfo.Add(eq);
                    DAL.SiteMonitoring.Add(ms);
                    result = cos.ID.ToString();
                    Response.Clear();
                    Response.Write("1");
                    Response.End();
                }
                catch (Exception)
                {
                }

                Model.SysLog mSysLog = new Model.SysLog();
                mSysLog.LogTime  = DateTime.Now;
                mSysLog.LogType  = 0;
                mSysLog.UserName = Session["UserName"].ToString();
                mSysLog.Remark   = "管理员添加基站:" + cors.StationName + "的信息";
                DAL.SysLog.Add(mSysLog);
            }
        }
예제 #3
0
        private void DeleteEquip()
        {
            int[]  ids;
            string a = Request["id[]"];

            string[] temp = a.Split(',');
            ids = new int[temp.Length];
            try
            {
                for (int m = 0; m < temp.Length; m++)
                {
                    ids[m] = Convert.ToInt32(temp[m]);
                    Model.StationEquip mi = DAL.StationEquip.GetModel(ids[m]);

                    DataSet ds = DAL.EquipmentInfo.GetList("EquipID like '%" + ids[m] + ";%'");

                    string name   = mi.MachineName;
                    bool   result = DAL.StationEquip.Delete(ids[m]);

                    if (result)
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            Model.EquipmentInfo MII = DAL.EquipmentInfo.GetModel(int.Parse(dr["ID"].ToString()));
                            if (MII != null)
                            {
                                string eid = MII.EquipID.Replace(ids[m] + ";", "").Trim();
                                MII.EquipID = eid;
                                DAL.EquipmentInfo.Update(MII);
                            }
                        }
                        Model.SysLog mSysLog = new Model.SysLog();
                        mSysLog.LogTime  = DateTime.Now;
                        mSysLog.LogType  = 0;
                        mSysLog.UserName = Session["UserName"].ToString();
                        mSysLog.Remark   = "管理员删除了基站设备:" + name;
                        DAL.SysLog.Add(mSysLog);
                    }
                }
                Response.Clear();
                Response.Write("1");
                Response.End();
            }
            catch (Exception)
            {
            }
        }
예제 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null)
            {
                Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/Index.aspx\";</script>");
                Response.End();
            }
            if (Session["UserType"] == null || (Convert.ToInt32(Session["UserType"]) != 2 && Convert.ToInt32(Session["UserType"]) != 3))
            {
                Response.Write("<script>alert(\"登录账户类型有误\");location.href = location.origin+\"/Index.aspx\";</script>");
                Response.End();
            }
            if (!IsPostBack)
            {
                string id = null;
                id = Request["id"];
                stationid.Value = id.ToString();
                Model.CORSStationInfo mc = DAL.CORSStationInfo.GetModel(int.Parse(id.ToString()));
                StationName.Value  = mc.StationName;
                StationOName.Value = mc.StationOName;
                if (mc.IsOK == 1)
                {
                    IsOK.Value = "正常";
                }
                else
                {
                    IsOK.Value = "异常";
                }
                TransferType.Value = mc.TransferType;
                IP.Value           = mc.IP;
                Port.Value         = mc.Port;
                Lat.Value          = mc.Lat.ToString();
                Lon.Value          = mc.Lon.ToString();
                H.Value            = mc.H.ToString();
                StationType.Value  = mc.StationType;
                CaseNumber.Value   = mc.CaseNumber;
                if (mc.BuildTime != null)
                {
                    BuildTime.Value = mc.BuildTime.ToString();
                }
                AffiliatedNetwork.Value   = mc.AffiliatedNetwork;
                PiersType.Value           = mc.PiersType;
                RelyUnits.Value           = mc.RelyUnits;
                Address.Value             = mc.Address;
                ThicknessOfLayer.Value    = mc.ThicknessOfLayer;
                TrafficCondition.Value    = mc.TrafficCondition;
                SitePerson.Value          = mc.SitePerson;
                Builder.Value             = mc.Builder;
                SoilType.Value            = mc.SoilType;
                PermafrostDepth.Value     = mc.PermafrostDepth;
                ThawDepth.Value           = mc.ThawDepth;
                GroundwaterDepth.Value    = mc.GroundwaterDepth;
                BelongsMap.Value          = mc.BelongsMap;
                GeologicalStructure.Value = mc.GeologicalStructure;
                MaintenanceUnit.Value     = mc.MaintenanceUnit;
                ContactPerson.Value       = mc.ContactPerson;
                ContactTel.Value          = mc.ContactTel;
                StationPlan.Value         = mc.StationPlan;
                GravityPier.Value         = mc.GravityPier;
                LevelSign.Value           = mc.LevelSign;
                LightningReport.Value     = mc.LightningReport;
                StationPhoto.Value        = mc.StationPhoto;
                if (mc.StationPlan == "" || mc.StationPlan == null)
                {
                    viewPlan.Disabled = true;
                }
                if (mc.RingView == "" || mc.RingView == null)
                {
                    viewRingView.Disabled = true;
                }
                if (mc.GravityPier == "" || mc.GravityPier == null)
                {
                    viewGravityPier.Disabled = true;
                }
                if (mc.LevelSign == "" || mc.LevelSign == null)
                {
                    viewLevelSign.Disabled = true;
                }
                if (mc.LightningReport == "" || mc.LightningReport == null)
                {
                    viewLightningReport.Disabled = true;
                }
                if (mc.StationPhoto == "" || mc.StationPhoto == null)
                {
                    viewStationPhoto.Disabled = true;
                }
                RingView.Value = mc.RingView;
                EnvironmentalDescription.Value = mc.EnvironmentalDescription;
                SiteConditions.Value           = mc.SiteConditions;
            }
            else
            {
                if (Request["upload"] == "plan")
                {
                    string   filename    = Request.Files["FilePlan"].FileName;
                    string   stationname = Request.Form["StationName"].ToString().Trim();
                    string[] filenames   = filename.Split('.');
                    Request.Files["FilePlan"].SaveAs(Server.MapPath("~/upload/PLAN/") + stationname + "." + filenames[filenames.Length - 1]);
                    Model.CORSStationInfo ms = DAL.CORSStationInfo.GetModel(stationname);
                    ms.StationPlan = "/upload/PLAN/" + stationname + "." + filenames[filenames.Length - 1];
                    DAL.CORSStationInfo.Update(ms);
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    MERR.ReviceID     = Request.Form["stationid"].ToString().Trim();
                    MERR.Contents     = Request.Form["StationName"].ToString().Trim() + "信息发生了修改:平面图;";
                    MERR.RevicePerson = Session["UserName"].ToString();
                    MERR.ReviceTime   = DateTime.Now;
                    MERR.Information  = "基站信息";
                    DAL.EquipReviceRecord.Add(MERR);
                    Response.Clear();
                    Response.Write("1");
                    Response.End();
                }
                if (Request["upload"] == "ringview")
                {
                    string   filename    = Request.Files["FileRingView"].FileName;
                    string   stationname = Request.Form["StationName"].ToString().Trim();
                    string[] filenames   = filename.Split('.');
                    Request.Files["FileRingView"].SaveAs(Server.MapPath("~/upload/RINGVIEW/") + stationname + "." + filenames[filenames.Length - 1]);
                    Model.CORSStationInfo ms = DAL.CORSStationInfo.GetModel(stationname);
                    ms.RingView = "/upload/RINGVIEW/" + stationname + "." + filenames[filenames.Length - 1];
                    DAL.CORSStationInfo.Update(ms);
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    MERR.ReviceID     = Request.Form["stationid"].ToString().Trim();
                    MERR.Contents     = Request.Form["StationName"].ToString().Trim() + "信息发生了修改:环视图;";
                    MERR.RevicePerson = Session["UserName"].ToString();
                    MERR.ReviceTime   = DateTime.Now;
                    MERR.Information  = "基站信息";
                    DAL.EquipReviceRecord.Add(MERR);
                    Response.Clear();
                    Response.Write("1");
                    Response.End();
                }

                if (Request["upload"] == "GravityPier")
                {
                    string   filename    = Request.Files["FileGravityPier"].FileName;
                    string   stationname = Request.Form["StationName"].ToString().Trim();
                    string[] filenames   = filename.Split('.');
                    Request.Files["FileGravityPier"].SaveAs(Server.MapPath("~/upload/GravityPier/") + stationname + "." + filenames[filenames.Length - 1]);
                    Model.CORSStationInfo ms = DAL.CORSStationInfo.GetModel(stationname);
                    ms.GravityPier = "/upload/GravityPier/" + stationname + "." + filenames[filenames.Length - 1];
                    DAL.CORSStationInfo.Update(ms);
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    MERR.ReviceID     = Request.Form["stationid"].ToString().Trim();
                    MERR.Contents     = Request.Form["StationName"].ToString().Trim() + "信息发生了修改:重力墩;";
                    MERR.RevicePerson = Session["UserName"].ToString();
                    MERR.ReviceTime   = DateTime.Now;
                    MERR.Information  = "基站信息";
                    DAL.EquipReviceRecord.Add(MERR);
                    Response.Clear();
                    Response.Write("1");
                    Response.End();
                }
                if (Request["upload"] == "LevelSign")
                {
                    string   filename    = Request.Files["FileLevelSign"].FileName;
                    string   stationname = Request.Form["StationName"].ToString().Trim();
                    string[] filenames   = filename.Split('.');
                    Request.Files["FileLevelSign"].SaveAs(Server.MapPath("~/upload/LevelSign/") + stationname + "." + filenames[filenames.Length - 1]);
                    Model.CORSStationInfo ms = DAL.CORSStationInfo.GetModel(stationname);
                    ms.LevelSign = "/upload/LevelSign/" + stationname + "." + filenames[filenames.Length - 1];
                    DAL.CORSStationInfo.Update(ms);
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    MERR.ReviceID     = Request.Form["stationid"].ToString().Trim();
                    MERR.Contents     = Request.Form["StationName"].ToString().Trim() + "信息发生了修改:水准标志;";
                    MERR.RevicePerson = Session["UserName"].ToString();
                    MERR.ReviceTime   = DateTime.Now;
                    MERR.Information  = "基站信息";
                    DAL.EquipReviceRecord.Add(MERR);
                    Response.Clear();
                    Response.Write("1");
                    Response.End();
                }
                if (Request["upload"] == "LightningReport")
                {
                    string   filename    = Request.Files["FileLightningReport"].FileName;
                    string   stationname = Request.Form["StationName"].ToString().Trim();
                    string[] filenames   = filename.Split('.');
                    Request.Files["FileLightningReport"].SaveAs(Server.MapPath("~/upload/LightningReport/") + stationname + "." + filenames[filenames.Length - 1]);
                    Model.CORSStationInfo ms = DAL.CORSStationInfo.GetModel(stationname);
                    ms.LightningReport = "/upload/LightningReport/" + stationname + "." + filenames[filenames.Length - 1];
                    DAL.CORSStationInfo.Update(ms);
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    MERR.ReviceID     = Request.Form["stationid"].ToString().Trim();
                    MERR.Contents     = Request.Form["StationName"].ToString().Trim() + "信息发生了修改:检测报告;";
                    MERR.RevicePerson = Session["UserName"].ToString();
                    MERR.ReviceTime   = DateTime.Now;
                    MERR.Information  = "基站信息";
                    DAL.EquipReviceRecord.Add(MERR);
                    Response.Clear();
                    Response.Write("1");
                    Response.End();
                }
                if (Request["upload"] == "StationPhoto")
                {
                    string   filename    = Request.Files["FileStationPhoto"].FileName;
                    string   stationname = Request.Form["StationName"].ToString().Trim();
                    string[] filenames   = filename.Split('.');
                    Request.Files["FileStationPhoto"].SaveAs(Server.MapPath("~/upload/StationPhoto/") + stationname + "." + filenames[filenames.Length - 1]);
                    Model.CORSStationInfo ms = DAL.CORSStationInfo.GetModel(stationname);
                    ms.StationPhoto = "/upload/StationPhoto/" + stationname + "." + filenames[filenames.Length - 1];
                    DAL.CORSStationInfo.Update(ms);
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    MERR.ReviceID     = Request.Form["stationid"].ToString().Trim();
                    MERR.Contents     = Request.Form["StationName"].ToString().Trim() + "信息发生了修改:基站照片;";
                    MERR.RevicePerson = Session["UserName"].ToString();
                    MERR.ReviceTime   = DateTime.Now;
                    MERR.Information  = "基站信息";
                    DAL.EquipReviceRecord.Add(MERR);
                    Response.Clear();
                    Response.Write("1");
                    Response.End();
                }
                if (Request["action"] == "save")
                {
                    Model.CORSStationInfo mcors = DAL.CORSStationInfo.GetModel(int.Parse(Request.Form["stationid"].ToString().Trim()));
                    Model.EquipmentInfo   me    = DAL.EquipmentInfo.GetModel(mcors.StationOName);
                    Model.SiteMonitoring  ms    = DAL.SiteMonitoring.GetModel(mcors.StationOName);

                    #region 对修改信息进行比对
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    bool IsRevice = false;
                    MERR.Contents = mcors.StationName + "信息发生了修改:";
                    if (mcors.TransferType != Request.Form["TransferType"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "传输类型;";
                    }
                    if (mcors.IP != Request.Form["IP"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "IP地址;";
                    }
                    if (mcors.Port != Request.Form["Port"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "端口;";
                    }
                    if (mcors.Lat != double.Parse(Request.Form["Lat"].ToString().Trim()))
                    {
                        IsRevice       = true;
                        MERR.Contents += "纬度;";
                    }
                    if (mcors.Lon != double.Parse(Request.Form["Lon"].ToString().Trim()))
                    {
                        IsRevice       = true;
                        MERR.Contents += "经度;";
                    }
                    if (mcors.H != double.Parse(Request.Form["H"].ToString().Trim()))
                    {
                        IsRevice       = true;
                        MERR.Contents += "高程;";
                    }
                    if (mcors.StationType != Request.Form["StationType"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "基站型号;";
                    }
                    if (mcors.CaseNumber != Request.Form["CaseNumber"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "备案号;";
                    }
                    if (mcors.BuildTime != DateTime.Parse(Request.Form["BuildTime"].ToString().Trim()))
                    {
                        IsRevice       = true;
                        MERR.Contents += "建站时间;";
                    }
                    if (mcors.AffiliatedNetwork != Request.Form["AffiliatedNetwork"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "所属站网;";
                    }
                    if (mcors.PiersType != Request.Form["PiersType"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "墩标类型;";
                    }
                    if (mcors.RelyUnits != Request.Form["RelyUnits"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "依托单位;";
                    }
                    if (mcors.Address != Request.Form["Address"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "所在地区;";
                    }
                    if (mcors.ThicknessOfLayer != Request.Form["ThicknessOfLayer"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "土层厚度;";
                    }
                    if (mcors.TrafficCondition != Request.Form["TrafficCondition"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "交通情况;";
                    }
                    if (mcors.SitePerson != Request.Form["SitePerson"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "选点者信息;";
                    }
                    if (mcors.Builder != Request.Form["Builder"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "建站者信息;";
                    }
                    if (mcors.SoilType != Request.Form["SoilType"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "地类土质;";
                    }
                    if (mcors.PermafrostDepth != Request.Form["PermafrostDepth"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "冻土深度;";
                    }
                    if (mcors.ThawDepth != Request.Form["ThawDepth"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "解冻深度;";
                    }
                    if (mcors.BelongsMap != Request.Form["BelongsMap"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "所在图幅;";
                    }
                    if (mcors.GroundwaterDepth != Request.Form["GroundwaterDepth"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "地下水深度;";
                    }
                    if (mcors.GeologicalStructure != Request.Form["GeologicalStructure"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "基础岩性和地质构造说明;";
                    }
                    if (mcors.MaintenanceUnit != Request.Form["MaintenanceUnit"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "维护单位;";
                    }
                    if (mcors.ContactPerson != Request.Form["ContactPerson"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "维护人;";
                    }
                    if (mcors.ContactTel != Request.Form["ContactTel"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "联系电话;";
                    }
                    if (mcors.EnvironmentalDescription != Request.Form["EnvironmentalDescription"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "环境说明;";
                    }
                    if (mcors.SiteConditions != Request.Form["SiteConditions"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "站点条件信息;";
                    }

                    #endregion

                    mcors.StationName  = Request.Form["StationName"].ToString().Trim();
                    mcors.StationOName = Request.Form["StationOName"].ToString().Trim();
                    if (Request.Form["IsOK"].ToString() == "正常")
                    {
                        mcors.IsOK = 1;
                    }
                    else
                    {
                        mcors.IsOK = 0;
                    }
                    mcors.TransferType        = Request.Form["TransferType"].ToString().Trim();
                    mcors.IP                  = Request.Form["IP"].ToString().Trim();
                    mcors.Port                = Request.Form["Port"].ToString().Trim();
                    mcors.Lat                 = double.Parse(Request.Form["Lat"].ToString().Trim());
                    mcors.Lon                 = double.Parse(Request.Form["Lon"].ToString().Trim());
                    mcors.H                   = double.Parse(Request.Form["H"].ToString().Trim());
                    mcors.StationType         = Request.Form["StationType"].ToString().Trim();
                    mcors.CaseNumber          = Request.Form["CaseNumber"].ToString().Trim();
                    mcors.BuildTime           = DateTime.Parse(Request.Form["BuildTime"].ToString().Trim());
                    mcors.AffiliatedNetwork   = Request.Form["AffiliatedNetwork"].ToString().Trim();
                    mcors.PiersType           = Request.Form["PiersType"].ToString().Trim();
                    mcors.RelyUnits           = Request.Form["RelyUnits"].ToString().Trim();
                    mcors.Address             = Request.Form["Address"].ToString().Trim();
                    mcors.ThicknessOfLayer    = Request.Form["ThicknessOfLayer"].ToString().Trim();
                    mcors.TrafficCondition    = Request.Form["TrafficCondition"].ToString().Trim();
                    mcors.SitePerson          = Request.Form["SitePerson"].ToString().Trim();
                    mcors.Builder             = Request.Form["Builder"].ToString().Trim();
                    mcors.SoilType            = Request.Form["SoilType"].ToString().Trim();
                    mcors.PermafrostDepth     = Request.Form["PermafrostDepth"].ToString().Trim();
                    mcors.ThawDepth           = Request.Form["ThawDepth"].ToString().Trim();
                    mcors.GroundwaterDepth    = Request.Form["GroundwaterDepth"].ToString().Trim();
                    mcors.BelongsMap          = Request.Form["BelongsMap"].ToString().Trim();
                    mcors.GeologicalStructure = Request.Form["GeologicalStructure"].ToString().Trim();
                    mcors.MaintenanceUnit     = Request.Form["MaintenanceUnit"].ToString().Trim();
                    mcors.ContactPerson       = Request.Form["ContactPerson"].ToString().Trim();
                    mcors.ContactTel          = Request.Form["ContactTel"].ToString().Trim();
                    if (Request.Form["StationPlan"].ToString().Trim().Contains("PLAN"))
                    {
                        mcors.StationPlan = Request.Form["StationPlan"].ToString().Trim();
                    }
                    if (Request.Form["RingView"].ToString().Trim().Contains("RINGVIEW"))
                    {
                        mcors.RingView = Request.Form["RingView"].ToString().Trim();
                    }
                    if (Request.Form["GravityPier"].ToString().Trim().Contains("GravityPier"))
                    {
                        mcors.GravityPier = Request.Form["GravityPier"].ToString().Trim();
                    }
                    if (Request.Form["LevelSign"].ToString().Trim().Contains("LevelSign"))
                    {
                        mcors.LevelSign = Request.Form["LevelSign"].ToString().Trim();
                    }
                    if (Request.Form["LightningReport"].ToString().Trim().Contains("LightningReport"))
                    {
                        mcors.LightningReport = Request.Form["LightningReport"].ToString().Trim();
                    }
                    if (Request.Form["StationPhoto"].ToString().Trim().Contains("StationPhoto"))
                    {
                        mcors.StationPhoto = Request.Form["StationPhoto"].ToString().Trim();
                    }
                    mcors.SiteConditions           = Request.Form["SiteConditions"].ToString().Trim();
                    mcors.EnvironmentalDescription = Request.Form["EnvironmentalDescription"].ToString().Trim();
                    bool res = DAL.CORSStationInfo.Update(mcors, 1);
                    me.StationName  = mcors.StationName;
                    me.StationOName = mcors.StationOName;
                    me.IP           = mcors.IP;
                    me.Port         = mcors.Port;
                    DAL.EquipmentInfo.Update(me);
                    ms.StationOName = me.StationOName;
                    bool r = DAL.SiteMonitoring.Update(ms);
                    if (res)
                    {
                        if (IsRevice)
                        {
                            MERR.ReviceID     = mcors.ID.ToString();
                            MERR.RevicePerson = Session["UserName"].ToString();
                            MERR.ReviceTime   = DateTime.Now;
                            MERR.Information  = "基站信息";
                            DAL.EquipReviceRecord.Add(MERR);
                        }
                    }
                    Response.Clear();
                    Response.Write("1");
                    Response.End();
                }
            }
        }
예제 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null)
            {
                Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/Index.aspx\";</script>");
                Response.End();
            }
            if (Session["UserType"] == null || (Convert.ToInt32(Session["UserType"]) != 2 && Convert.ToInt32(Session["UserType"]) != 3))
            {
                Response.Write("<script>alert(\"登录账户类型有误\");location.href = location.origin+\"/forms/Index.aspx\";</script>");
                Response.End();
            }
            if (!IsPostBack)
            {
                #region load
                if (Request["StationOName"] != null)
                {
                    string stoname          = Request["StationOName"].ToString();
                    Model.EquipmentInfo meq = DAL.EquipmentInfo.GetModel(stoname);
                    StationName.Value = meq.StationName;
                    IDD             = meq.ID;
                    IDS.Value       = meq.ID.ToString();
                    LoginName.Value = meq.LoginName;
                    if (meq.Password != "" && meq.Password != null)
                    {
                        Password.Value = AES_Key.AESDecrypt(meq.Password, meq.LoginName.PadLeft(16, '0'));
                    }
                    AntennaH.Value        = meq.AntennaH.ToString();
                    AntennaHM.Value       = meq.AntennaHM;
                    AntennaHML.Value      = meq.AntennaHML;
                    SatelliteSystem.Value = meq.SatelliteSystem;
                    IP.Value                 = meq.IP;
                    Port.Value               = meq.Port;
                    SubnetMask.Value         = meq.SubnetMask;
                    Gateway.Value            = meq.Gateway;
                    BaudRate.Value           = meq.BaudRate;
                    DataConfiguration.Value  = meq.DataConfiguration;
                    MaintenancePerson.Value  = meq.MaintenancePerson;
                    MaintenanceTime.Value    = meq.MaintenanceTime.ToString();
                    MaintenanceContent.Value = meq.MaintenanceContent;
                }
                #endregion
            }
            else
            {
                if (Request["action"] == "save")
                {
                    #region save
                    Model.EquipmentInfo MEQ = DAL.EquipmentInfo.GetModel(Request.Form["StationName"].ToString().Trim(), 1);
                    #region 对修改信息进行对比


                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    bool IsRevice = false;
                    MERR.Contents = MEQ.StationName + "设备信息发生了修改:";
                    if (MEQ.AntennaH != double.Parse(Request.Form["AntennaH"].ToString().Trim()))
                    {
                        IsRevice       = true;
                        MERR.Contents += "天线高;";
                    }
                    if (MEQ.AntennaHM != Request.Form["AntennaHM"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "天线高量取方式;";
                    }
                    if (MEQ.AntennaHML != Request.Form["AntennaHML"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "天线高量取位置;";
                    }
                    if (MEQ.LoginName != Request.Form["LoginName"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "设备登录名;";
                    }
                    if (MEQ.Password != AES_Key.AESEncrypt(Request.Form["Password"].ToString().Trim(), MEQ.LoginName.PadLeft(16, '0')))
                    {
                        IsRevice       = true;
                        MERR.Contents += "登录密码;";
                    }
                    if (MEQ.SatelliteSystem != Request.Form["SatelliteSystem"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "卫星系统;";
                    }
                    if (MEQ.IP != Request.Form["IP"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "IP地址;";
                    }
                    if (MEQ.Port != Request.Form["Port"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "端口;";
                    }
                    if (MEQ.SubnetMask != Request.Form["SubnetMask"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "子网掩码;";
                    }
                    if (MEQ.Gateway != Request.Form["Gateway"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "网关;";
                    }
                    if (MEQ.BaudRate != Request.Form["BaudRate"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "波特率;";
                    }
                    if (MEQ.DataConfiguration != Request.Form["DataConfiguration"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "数据流转发配置;";
                    }
                    if (MEQ.MaintenancePerson != Request.Form["MaintenancePerson"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "设备维护人员;";
                    }
                    if (MEQ.MaintenanceTime != DateTime.Parse(Request.Form["MaintenanceTime"].ToString().Trim()))
                    {
                        IsRevice       = true;
                        MERR.Contents += "设备维护时间;";
                    }
                    if (MEQ.MaintenanceContent != Request.Form["MaintenanceContent"].ToString().Trim())
                    {
                        IsRevice       = true;
                        MERR.Contents += "设备维护内容;";
                    }

                    #endregion

                    MEQ.AntennaH          = double.Parse(Request.Form["AntennaH"].ToString().Trim());
                    MEQ.AntennaHM         = Request.Form["AntennaHM"].ToString().Trim();
                    MEQ.AntennaHML        = Request.Form["AntennaHML"].ToString().Trim();
                    MEQ.BaudRate          = Request.Form["BaudRate"].ToString().Trim();
                    MEQ.DataConfiguration = Request.Form["DataConfiguration"].ToString().Trim();

                    MEQ.Gateway            = Request.Form["Gateway"].ToString().Trim();
                    MEQ.IP                 = Request.Form["IP"].ToString().Trim();
                    MEQ.LoginName          = Request.Form["LoginName"].ToString().Trim();
                    MEQ.MaintenanceContent = Request.Form["MaintenanceContent"].ToString().Trim();
                    MEQ.MaintenancePerson  = Request.Form["MaintenancePerson"].ToString().Trim();
                    MEQ.MaintenanceTime    = DateTime.Parse(Request.Form["MaintenanceTime"].ToString());
                    MEQ.Password           = AES_Key.AESEncrypt(Request.Form["Password"].ToString().Trim(), MEQ.LoginName.PadLeft(16, '0'));
                    MEQ.Port               = Request.Form["Port"].ToString().Trim();
                    MEQ.SatelliteSystem    = Request.Form["SatelliteSystem"].ToString().Trim();

                    bool result = DAL.EquipmentInfo.Update(MEQ);
                    Model.CORSStationInfo mc = DAL.CORSStationInfo.GetModel(MEQ.StationName);
                    mc.IP   = MEQ.IP;
                    mc.Port = MEQ.Port;
                    DAL.CORSStationInfo.Update(mc);
                    if (result)
                    {
                        if (IsRevice)
                        {
                            MERR.ReviceID     = MEQ.ID.ToString();
                            MERR.RevicePerson = Session["UserName"].ToString();
                            MERR.ReviceTime   = DateTime.Now;
                            MERR.Information  = "基站设备";
                            DAL.EquipReviceRecord.Add(MERR);
                        }
                        Response.Clear();
                        Response.Write("1");
                        Response.End();
                    }
                    else
                    {
                        Response.Clear();
                        Response.Write("0");
                        Response.End();
                    }
                    #endregion
                }
            }
            if (Request["action"] != null && Request["action"] == "GetData")
            {
                if (!GetEquips())
                {
                    Response.Write("0");
                }
            }
            if (Request["action"] != null && Request["action"] == "DeleteEquip")
            {
                DeleteEquip();
            }
        }
예제 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null)
            {
                Response.Write("<script>alert(\"请登录\");location.href = location.origin+\"/forms/Index.aspx\";</script>");
                Response.End();
            }
            if (Session["UserType"] == null || (Convert.ToInt32(Session["UserType"]) != 2 && Convert.ToInt32(Session["UserType"]) != 3))
            {
                Response.Write("<script>alert(\"登录账户类型有误\");location.href = location.origin+\"/forms/Index.aspx\";</script>");
                Response.End();
            }
            if (!IsPostBack)
            {
                if (Request["ID"] != null)
                {
                    IDD = int.Parse(Request["ID"].ToString());
                }
            }
            else
            {
                if (Request["action"] == "save")
                {
                    Model.StationEquip se    = new Model.StationEquip();
                    string             time  = Request.Form["InstallationDate"].ToString();
                    string             dtime = DateTime.Now.ToString();
                    se.InstallationDate = DateTime.Parse(dtime);
                    se.MachineName      = Request.Form["MachineName"].ToString();
                    se.Models           = Request.Form["Models"].ToString();
                    se.SerialNumber     = Request.Form["SerialNumber"].ToString();


                    bool result = DAL.StationEquip.Add(se);
                    if (result)
                    {
                        Model.EquipmentInfo MII = DAL.EquipmentInfo.GetModel(IDD);
                        DataSet             ds  = DAL.StationEquip.GetList("InstallationDate='" + dtime + "'");

                        MII.EquipID += ds.Tables[0].Rows[0]["ID"].ToString() + ";";
                        se.ID        = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString());
                        DAL.EquipmentInfo.Update(MII);
                        try
                        {
                            se.InstallationDate = DateTime.Parse(time);
                        }
                        catch (Exception)
                        {
                        }
                        DAL.StationEquip.Update(se);
                        Response.Clear();
                        Response.Write("1");
                        Response.End();
                        return;
                    }
                    else
                    {
                        Response.Clear();
                        Response.Write("0");
                        Response.End();
                    }
                }
            }
        }
예제 #7
0
        /// <summary>
        /// 得到一个实体对象
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public static Model.EquipmentInfo GetModel(int ID)
        {
            string strSql = "select * from EquipmentInfo where ID = " + ID.ToString();

            Model.EquipmentInfo model = new Model.EquipmentInfo();
            DataSet             ds    = DBHelperSQL.GetDataSet(strSql, connectionString);

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.AntennaH          = Convert.ToDouble(ds.Tables[0].Rows[0]["AntennaH"]);
                model.StationOName      = Convert.ToString(ds.Tables[0].Rows[0]["StationOName"]);;
                model.AntennaHM         = Convert.ToString(ds.Tables[0].Rows[0]["AntennaHM"]);
                model.AntennaHML        = Convert.ToString(ds.Tables[0].Rows[0]["AntennaHML"]);
                model.BaudRate          = Convert.ToString(ds.Tables[0].Rows[0]["BaudRate"]);
                model.DataConfiguration = Convert.ToString(ds.Tables[0].Rows[0]["DataConfiguration"]);
                model.DeviceType        = Convert.ToString(ds.Tables[0].Rows[0]["DeviceType"]);
                model.Gateway           = Convert.ToString(ds.Tables[0].Rows[0]["Gateway"]);
                model.InstallationDate  = Convert.ToDateTime(ds.Tables[0].Rows[0]["InstallationDate"]);
                model.IP                         = Convert.ToString(ds.Tables[0].Rows[0]["IP"]);
                model.LoginName                  = Convert.ToString(ds.Tables[0].Rows[0]["LoginName"]);
                model.MaintenanceContent         = Convert.ToString(ds.Tables[0].Rows[0]["MaintenanceContent"]);
                model.MaintenancePerson          = Convert.ToString(ds.Tables[0].Rows[0]["MaintenancePerson"]);
                model.MaintenanceTime            = Convert.ToDateTime(ds.Tables[0].Rows[0]["MaintenanceTime"]);
                model.Password                   = Convert.ToString(ds.Tables[0].Rows[0]["Password"]);
                model.Port                       = Convert.ToString(ds.Tables[0].Rows[0]["Port"]);
                model.SatelliteSystem            = Convert.ToString(ds.Tables[0].Rows[0]["SatelliteSystem"]);
                model.SerialNumber               = Convert.ToString(ds.Tables[0].Rows[0]["SerialNumber"]);
                model.StationName                = Convert.ToString(ds.Tables[0].Rows[0]["StationName"]);
                model.SubnetMask                 = Convert.ToString(ds.Tables[0].Rows[0]["SubnetMask"]);
                model.Type                       = Convert.ToString(ds.Tables[0].Rows[0]["Type"]);
                model.AntennaType                = Convert.ToString(ds.Tables[0].Rows[0]["AntennaType"]);
                model.AntennaDate                = Convert.ToDateTime(ds.Tables[0].Rows[0]["AntennaDate"]);
                model.AntennaModels              = Convert.ToString(ds.Tables[0].Rows[0]["AntennaModels"]);
                model.AntennaSerialNumber        = Convert.ToString(ds.Tables[0].Rows[0]["AntennaSerialNumber"]);
                model.MeteorologicalType         = Convert.ToString(ds.Tables[0].Rows[0]["MeteorologicalType"]);
                model.MeteorologicalDate         = Convert.ToDateTime(ds.Tables[0].Rows[0]["MeteorologicalDate"]);
                model.MeteorologicalModels       = Convert.ToString(ds.Tables[0].Rows[0]["MeteorologicalModels"]);
                model.MeteorologicalSerialNumber = Convert.ToString(ds.Tables[0].Rows[0]["MeteorologicalSerialNumber"]);
                model.AtomicclkType              = Convert.ToString(ds.Tables[0].Rows[0]["AtomicclkType"]);
                model.AtomicclkDate              = Convert.ToDateTime(ds.Tables[0].Rows[0]["AtomicclkDate"]);
                model.AtomicclkModels            = Convert.ToString(ds.Tables[0].Rows[0]["AtomicclkModels"]);
                model.AtomicclkSerialNumber      = Convert.ToString(ds.Tables[0].Rows[0]["AtomicclkSerialNumber"]);
                model.switchType                 = Convert.ToString(ds.Tables[0].Rows[0]["switchType"]);
                model.switchDate                 = Convert.ToDateTime(ds.Tables[0].Rows[0]["switchDate"]);
                model.switchModels               = Convert.ToString(ds.Tables[0].Rows[0]["switchModels"]);
                model.switchSerialNumber         = Convert.ToString(ds.Tables[0].Rows[0]["switchSerialNumber"]);
                model.routerType                 = Convert.ToString(ds.Tables[0].Rows[0]["routerType"]);
                model.routerDate                 = Convert.ToDateTime(ds.Tables[0].Rows[0]["routerDate"]);
                model.routerModels               = Convert.ToString(ds.Tables[0].Rows[0]["routerModels"]);
                model.routerSerialNumber         = Convert.ToString(ds.Tables[0].Rows[0]["routerSerialNumber"]);
                model.FirewallType               = Convert.ToString(ds.Tables[0].Rows[0]["FirewallType"]);
                model.FirewallDate               = Convert.ToDateTime(ds.Tables[0].Rows[0]["FirewallDate"]);
                model.FirewallSerialNumber       = Convert.ToString(ds.Tables[0].Rows[0]["FirewallSerialNumber"]);
                model.FirewallModels             = Convert.ToString(ds.Tables[0].Rows[0]["FirewallModels"]);
                model.LightningType              = Convert.ToString(ds.Tables[0].Rows[0]["LightningType"]);
                model.LightningDate              = Convert.ToDateTime(ds.Tables[0].Rows[0]["LightningDate"]);
                model.LightningModels            = Convert.ToString(ds.Tables[0].Rows[0]["LightningModels"]);
                model.LightningSerialNumber      = Convert.ToString(ds.Tables[0].Rows[0]["LightningSerialNumber"]);
                model.ComputerType               = Convert.ToString(ds.Tables[0].Rows[0]["ComputerType"]);
                model.ComputerModels             = Convert.ToString(ds.Tables[0].Rows[0]["ComputerModels"]);
                model.ComputerSerialNumber       = Convert.ToString(ds.Tables[0].Rows[0]["ComputerSerialNumber"]);
                model.ComputerDate               = Convert.ToDateTime(ds.Tables[0].Rows[0]["ComputerDate"]);
                model.EquipID                    = Convert.ToString(ds.Tables[0].Rows[0]["EquipID"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }