예제 #1
0
        /// <summary>
        /// 更新一条修改记录信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool Update(Model.EquipReviceRecord model)
        {
            string       strSql       = "update EquipReviceRecord set ReviceTime=@ReviceTime,RevicePerson=@RevicePerson,Contents=@Contents,Information=@Information,ReviceID=@ReviceID where ID ='" + model.ID + "'";
            SqlParameter ReviceTime   = new SqlParameter("ReviceTime", SqlDbType.DateTime); ReviceTime.Value = model.ReviceTime;
            SqlParameter RevicePerson = new SqlParameter("RevicePerson", SqlDbType.NVarChar); RevicePerson.Value = model.RevicePerson;
            SqlParameter Contents     = new SqlParameter("Contents", SqlDbType.NVarChar); Contents.Value = model.Contents;
            SqlParameter Information  = new SqlParameter("Information", SqlDbType.NVarChar); Information.Value = model.Information;
            SqlParameter ReviceID     = new SqlParameter("ReviceID", SqlDbType.NVarChar); ReviceID.Value = model.ReviceID;

            return(DBHelperSQL.GetNums(strSql, new SqlParameter[] { ReviceTime, RevicePerson, Contents, Information, ReviceID }, connectionString) == 1 ? true : false);
        }
예제 #2
0
        /// <summary>
        /// 添加一条修改记录信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool Add(Model.EquipReviceRecord model)
        {
            string       strSql       = "insert into EquipReviceRecord(ReviceTime,RevicePerson,Contents,Information,ReviceID) values(@ReviceTime,@RevicePerson,@Contents,@Information,@ReviceID)";
            SqlParameter ReviceTime   = new SqlParameter("ReviceTime", SqlDbType.DateTime); ReviceTime.Value = model.ReviceTime;
            SqlParameter RevicePerson = new SqlParameter("RevicePerson", SqlDbType.NVarChar); RevicePerson.Value = model.RevicePerson;
            SqlParameter Contents     = new SqlParameter("Contents", SqlDbType.NVarChar); Contents.Value = model.Contents;
            SqlParameter Information  = new SqlParameter("Information", SqlDbType.NVarChar); Information.Value = model.Information;
            SqlParameter ReviceID     = new SqlParameter("ReviceID", SqlDbType.NVarChar); ReviceID.Value = model.ReviceID;

            return(DBHelperSQL.GetNums(strSql, new SqlParameter[] { ReviceTime, RevicePerson, Contents, Information, ReviceID }, connectionString) == 1 ? true : false);
        }
예제 #3
0
        /// <summary>
        /// 根据ID获取一条信息
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public static Model.EquipReviceRecord GetModel(int ID)
        {
            string strSql = "select * from EquipReviceRecord where ID ='" + ID + "'";

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

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.ReviceTime   = Convert.ToDateTime(ds.Tables[0].Rows[0]["ReviceTime"]);
                model.RevicePerson = Convert.ToString(ds.Tables[0].Rows[0]["RevicePerson"]);
                model.Information  = Convert.ToString(ds.Tables[0].Rows[0]["Information"]);
                model.Contents     = Convert.ToString(ds.Tables[0].Rows[0]["Contents"]);
                model.ReviceID     = Convert.ToString(ds.Tables[0].Rows[0]["ReviceID"]);
                return(model);
            }
            else
            {
                return(null);
            }
        }
예제 #4
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)
                {
                    int id = int.Parse(Request["ID"].ToString());
                    Model.InternetInformation mi = DAL.InternetInformation.GetModel(id);
                    if (mi == null)
                    {
                        Response.Write("<script>alert(\"网络信息错误\")");
                    }
                    else //对页面赋初值
                    {
                        IDS.Value                    = mi.ID.ToString();
                        IDD                          = mi.ID;
                        Type.Value                   = mi.Type;
                        DataLineStartP.Value         = mi.DataLineStartP;
                        DataLineEndP.Value           = mi.DataLineEndP;
                        EncryptionTechnology.Value   = mi.EncryptionTechnology;
                        BandWidth.Value              = mi.BandWidth;
                        GreenOperator.Value          = mi.GreenOperator;
                        TechnicalSupportStaff.Value  = mi.TechnicalSupportStaff;
                        FDataLineType.Value          = mi.FDataLineType;
                        FEncryptionTechnology.Value  = mi.FEncryptionTechnology;
                        FBandWidth.Value             = mi.FBandWidth;
                        FGreenOperator.Value         = mi.FGreenOperator;
                        FTechnicalSupportStaff.Value = mi.FTechnicalSupportStaff;
                        EquipConfig.Value            = mi.EquipConfig;
                        Topological.Value            = mi.Topological;
                        RouterConfig.Value           = mi.RouterConfig;
                        ServerIP.Value               = mi.ServerIP;
                        ServerPort.Value             = mi.ServerPort;
                        ServerMachineName.Value      = mi.ServerMachineName;
                        ServerLogo.Value             = mi.ServerLogo;
                        ServerUse.Value              = mi.ServerUse;
                        ServerRemark.Value           = mi.ServerRemark;
                        StorageIP.Value              = mi.StorageIP;
                        StoragePort.Value            = mi.StoragePort;
                        StorageMachineName.Value     = mi.StorageMachineName;
                        StorageLogo.Value            = mi.StorageLogo;
                        StorageUse.Value             = mi.StorageUse;
                        StorageRemark.Value          = mi.StorageRemark;
                        EquipmentID.Value            = mi.EquipmentID;
                        equipids                     = mi.EquipmentID;
                    }
                }
            }
            else
            {
                if (Request["upload"] == "EquipConfig")
                {
                    string   filename  = Request.Files["FileEquipConfig"].FileName;
                    string   type      = Request.Form["Type"].ToString().Trim();
                    string[] filenames = filename.Split('.');
                    Request.Files["FileEquipConfig"].SaveAs(Server.MapPath("~/upload/EquipConfig/") + type + "." + filenames[filenames.Length - 1]);
                    Model.InternetInformation ms = DAL.InternetInformation.GetModel(type);
                    ms.EquipConfig = "/upload/EquipConfig/" + type + "." + filenames[filenames.Length - 1];
                    DAL.InternetInformation.Update(ms);
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    MERR.ReviceID     = Request.Form["IDS"].ToString().Trim();
                    MERR.Contents     = "网络类型" + type + "信息发生了修改:基本配置;";
                    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"] == "RouterConfig")
                {
                    string   filename  = Request.Files["FileRouterConfig"].FileName;
                    string   type      = Request.Form["Type"].ToString().Trim();
                    string[] filenames = filename.Split('.');
                    Request.Files["FileRouterConfig"].SaveAs(Server.MapPath("~/upload/RouterConfig/") + type + "." + filenames[filenames.Length - 1]);
                    Model.InternetInformation ms = DAL.InternetInformation.GetModel(type);
                    ms.RouterConfig = "/upload/RouterConfig/" + type + "." + filenames[filenames.Length - 1];
                    DAL.InternetInformation.Update(ms);
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    MERR.ReviceID     = Request.Form["IDS"].ToString().Trim();
                    MERR.Contents     = "网络类型" + type + "信息发生了修改:路由器配置;";
                    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"] == "Topological")
                {
                    string   filename  = Request.Files["FileTopological"].FileName;
                    string   type      = Request.Form["Type"].ToString().Trim();
                    string[] filenames = filename.Split('.');
                    Request.Files["FileTopological"].SaveAs(Server.MapPath("~/upload/Topological/") + type + "." + filenames[filenames.Length - 1]);
                    Model.InternetInformation ms = DAL.InternetInformation.GetModel(type);
                    ms.Topological = "/upload/Topological/" + type + "." + filenames[filenames.Length - 1];
                    DAL.InternetInformation.Update(ms);
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    MERR.ReviceID     = Request.Form["IDS"].ToString().Trim();
                    MERR.Contents     = "网络类型" + type + "信息发生了修改:拓扑关系;";
                    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")
                {
                    int interid = int.Parse(Request.Form["IDS"].ToString());
                    Model.InternetInformation MI = DAL.InternetInformation.GetModel(interid);

                    #region 对修改信息进行比对
                    Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                    bool IsRevice = false;
                    MERR.Contents = "网络类型" + MI.Type + "信息发生了修改:";
                    if (MI.Type != Request.Form["Type"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "网络类型;";
                    }
                    if (MI.DataLineStartP != Request.Form["DataLineStartP"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "数据专线的起端点;";
                    }
                    if (MI.DataLineEndP != Request.Form["DataLineEndP"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "数据专线的止端点;";
                    }
                    if (MI.EncryptionTechnology != Request.Form["EncryptionTechnology"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "加密技术;";
                    }
                    if (MI.BandWidth != Request.Form["BandWidth"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "带宽;";
                    }
                    if (MI.GreenOperator != Request.Form["GreenOperator"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "专线运营商;";
                    }
                    if (MI.TechnicalSupportStaff != Request.Form["TechnicalSupportStaff"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "技术支持人员;";
                    }
                    if (MI.FDataLineType != Request.Form["FDataLineType"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "数据分发网络数据专线的类型;";
                    }
                    if (MI.FEncryptionTechnology != Request.Form["FEncryptionTechnology"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "数据分发网络加密技术;";
                    }
                    if (MI.FBandWidth != Request.Form["FBandWidth"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "数据分发网络带宽;";
                    }
                    if (MI.FGreenOperator != Request.Form["FGreenOperator"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "数据分发网络运营商;";
                    }
                    if (MI.FTechnicalSupportStaff != Request.Form["FTechnicalSupportStaff"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "数据分发网络技术支持信息;";
                    }
                    if (MI.ServerIP != Request.Form["ServerIP"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "服务器IP;";
                    }
                    if (MI.ServerPort != Request.Form["ServerPort"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "服务器端口;";
                    }
                    if (MI.ServerMachineName != Request.Form["ServerMachineName"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "服务器机器名;";
                    }
                    if (MI.ServerLogo != Request.Form["ServerLogo"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "服务器标识;";
                    }
                    if (MI.ServerUse != Request.Form["ServerUse"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "服务器用途;";
                    }
                    if (MI.ServerRemark != Request.Form["ServerRemark"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "服务器备注;";
                    }
                    if (MI.StorageIP != Request.Form["StorageIP"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "存储IP;";
                    }
                    if (MI.StoragePort != Request.Form["StoragePort"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "存储端口;";
                    }
                    if (MI.StorageMachineName != Request.Form["StorageMachineName"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "存储机器名;";
                    }
                    if (MI.StorageLogo != Request.Form["StorageLogo"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "存储标识;";
                    }
                    if (MI.StorageUse != Request.Form["StorageUse"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "存储用途;";
                    }
                    if (MI.StorageRemark != Request.Form["StorageRemark"].ToString())
                    {
                        IsRevice       = true;
                        MERR.Contents += "存储备注;";
                    }
                    #endregion

                    MI.Type                   = Request.Form["Type"].ToString();
                    MI.DataLineStartP         = Request.Form["DataLineStartP"].ToString();
                    MI.DataLineEndP           = Request.Form["DataLineEndP"].ToString();
                    MI.EncryptionTechnology   = Request.Form["EncryptionTechnology"].ToString();
                    MI.BandWidth              = Request.Form["BandWidth"].ToString();
                    MI.GreenOperator          = Request.Form["GreenOperator"].ToString();
                    MI.TechnicalSupportStaff  = Request.Form["TechnicalSupportStaff"].ToString();
                    MI.FDataLineType          = Request.Form["FDataLineType"].ToString();
                    MI.FEncryptionTechnology  = Request.Form["FEncryptionTechnology"].ToString();
                    MI.FBandWidth             = Request.Form["FBandWidth"].ToString();
                    MI.FGreenOperator         = Request.Form["FGreenOperator"].ToString();
                    MI.FTechnicalSupportStaff = Request.Form["FTechnicalSupportStaff"].ToString();
                    if (Request.Form["EquipConfig"].ToString().Trim().Contains("EquipConfig"))
                    {
                        MI.EquipConfig = Request.Form["EquipConfig"].ToString();
                    }
                    if (Request.Form["Topological"].ToString().Trim().Contains("Topological"))
                    {
                        MI.Topological = Request.Form["Topological"].ToString();
                    }
                    if (Request.Form["RouterConfig"].ToString().Trim().Contains("RouterConfig"))
                    {
                        MI.RouterConfig = Request.Form["RouterConfig"].ToString();
                    }
                    MI.ServerIP           = Request.Form["ServerIP"].ToString();
                    MI.ServerPort         = Request.Form["ServerPort"].ToString();
                    MI.ServerMachineName  = Request.Form["ServerMachineName"].ToString();
                    MI.ServerLogo         = Request.Form["ServerLogo"].ToString();
                    MI.ServerUse          = Request.Form["ServerUse"].ToString();
                    MI.ServerRemark       = Request.Form["ServerRemark"].ToString();
                    MI.StorageIP          = Request.Form["StorageIP"].ToString();
                    MI.StoragePort        = Request.Form["StoragePort"].ToString();
                    MI.StorageMachineName = Request.Form["StorageMachineName"].ToString();
                    MI.StorageLogo        = Request.Form["StorageLogo"].ToString();
                    MI.StorageUse         = Request.Form["StorageUse"].ToString();
                    MI.StorageRemark      = Request.Form["StorageRemark"].ToString();
                    // MI.EquipmentID = Request.Form["EquipmentID"].ToString();

                    Model.InternetInformation MI2 = DAL.InternetInformation.GetModel(MI.Type);
                    if (MI2 != null)
                    {
                        if (MI2.ID != MI.ID)
                        {
                            Response.Clear();
                            Response.Write("2");
                            Response.End();
                            return;
                        }
                        else
                        {
                            bool result = DAL.InternetInformation.Update(MI);
                            if (result)
                            {
                                if (IsRevice)
                                {
                                    MERR.ReviceID     = MI.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();
                            }
                        }
                    }
                    else
                    {
                        bool result = DAL.InternetInformation.Update(MI);
                        if (result)
                        {
                            MERR.ReviceID     = MI.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();
                        }
                    }
                }
            }

            if (Request["action"] != null && Request["action"] == "GetData")
            {
                if (!GetEquips())
                {
                    Response.Write("0");
                }
            }
            if (Request["action"] != null && Request["action"] == "DeleteEquip")
            {
                DeleteEquip();
            }
        }
예제 #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)
     {
         string           SerialNum = Request["Serial"].ToString();
         Model.DataCenter md        = DAL.DataCenter.GetModel(SerialNum);
         IDS.Value          = md.ID.ToString();;
         DeviceType.Value   = md.DeviceType;
         dType.Value        = md.Type;
         SerialNumber.Value = md.SerialNumber;
         FirstUseDate.Value = md.FirstUseDate.ToString();
         LoginName.Value    = md.LoginName;
         if (md.Password != "" && md.Password != null)
         {
             Password.Value = AES_Key.AESDecrypt(md.Password, md.LoginName.PadLeft(16, '0'));
         }
         IP.Value                 = md.IP;
         Port.Value               = md.Port;
         SubnetMask.Value         = md.SubnetMask;
         Gateway.Value            = md.Gateway;
         Business.Value           = md.Business;
         MaintenancePerson.Value  = md.MaintenancePerson;
         MaintenanceTime.Value    = md.MaintenanceTime.ToString();
         MaintenanceContent.Value = md.MaintenanceContent;
     }
     else
     {
         if (Request["action"] == "save")
         {
             Model.DataCenter MD = DAL.DataCenter.GetModel(int.Parse(Request.Form["IDS"].ToString().Trim()));
             #region 对修改信息进行对比
             Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
             bool IsRevice = false;
             MERR.Contents = "设备类型为" + MD.DeviceType + "的设备信息发生了修改:";
             #endregion
             if (Request.Form["SerialNumber"].ToString().Trim() == MD.SerialNumber)
             {
                 if (MD.DeviceType != Request.Form["DeviceType"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "设备类型;";
                 }
                 if (MD.Type != Request.Form["dType"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "型号;";
                 }
                 if (MD.FirstUseDate != DateTime.Parse(Request.Form["FirstUseDate"].ToString()))
                 {
                     IsRevice       = true;
                     MERR.Contents += "初次使用日期;";
                 }
                 if (MD.Business != Request.Form["Business"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "业务用途;";
                 }
                 if (MD.IP != Request.Form["IP"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "IP地址;";
                 }
                 if (MD.Port != Request.Form["Port"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "端口;";
                 }
                 if (MD.SubnetMask != Request.Form["SubnetMask"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "子网掩码;";
                 }
                 if (MD.Gateway != Request.Form["Gateway"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "网关;";
                 }
                 if (MD.LoginName != Request.Form["LoginName"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "登陆名;";
                 }
                 if (MD.Password != AES_Key.AESEncrypt(Request.Form["Password"].ToString().Trim(), MD.LoginName.PadLeft(16, '0')))
                 {
                     IsRevice       = true;
                     MERR.Contents += "登陆密码;";
                 }
                 if (MD.MaintenancePerson != Request.Form["MaintenancePerson"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "设备维护人员;";
                 }
                 if (MD.MaintenanceTime != DateTime.Parse(Request.Form["MaintenanceTime"].ToString()))
                 {
                     IsRevice       = true;
                     MERR.Contents += "设备维护时间;";
                 }
                 if (MD.MaintenanceContent != Request.Form["MaintenanceContent"].ToString().Trim())
                 {
                     IsRevice       = true;
                     MERR.Contents += "设备维护内容;";
                 }
                 MD.DeviceType         = Request.Form["DeviceType"].ToString().Trim();
                 MD.Gateway            = Request.Form["Gateway"].ToString().Trim();
                 MD.FirstUseDate       = DateTime.Parse(Request.Form["FirstUseDate"].ToString());
                 MD.IP                 = Request.Form["IP"].ToString().Trim();
                 MD.LoginName          = Request.Form["LoginName"].ToString().Trim();
                 MD.MaintenanceContent = Request.Form["MaintenanceContent"].ToString().Trim();
                 MD.MaintenancePerson  = Request.Form["MaintenancePerson"].ToString().Trim();
                 MD.MaintenanceTime    = DateTime.Parse(Request.Form["MaintenanceTime"].ToString());
                 MD.Password           = AES_Key.AESEncrypt(Request.Form["Password"].ToString().Trim(), MD.LoginName.PadLeft(16, '0'));
                 MD.Port               = Request.Form["Port"].ToString().Trim();
                 MD.Business           = Request.Form["Business"].ToString().Trim();
                 MD.SerialNumber       = Request.Form["SerialNumber"].ToString().Trim();
                 MD.SubnetMask         = Request.Form["SubnetMask"].ToString().Trim();
                 bool result = DAL.DataCenter.Update(MD);
                 if (result)
                 {
                     if (IsRevice)
                     {
                         MERR.ReviceID     = MD.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();
                 }
             }
             else
             {
                 if (DAL.DataCenter.Exists(Request.Form["SerialNumber"].ToString().Trim(), 1))
                 {
                     Response.Clear();
                     Response.Write("2");
                     Response.End();
                 }
                 else
                 {
                     if (MD.DeviceType != Request.Form["DeviceType"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "设备类型;";
                     }
                     if (MD.Type != Request.Form["dType"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "型号;";
                     }
                     if (MD.FirstUseDate != DateTime.Parse(Request.Form["FirstUseDate"].ToString()))
                     {
                         IsRevice       = true;
                         MERR.Contents += "初次使用日期;";
                     }
                     if (MD.Business != Request.Form["Business"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "业务用途;";
                     }
                     if (MD.IP != Request.Form["IP"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "IP地址;";
                     }
                     if (MD.Port != Request.Form["Port"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "端口;";
                     }
                     if (MD.SubnetMask != Request.Form["SubnetMask"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "子网掩码;";
                     }
                     if (MD.Gateway != Request.Form["Gateway"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "网关;";
                     }
                     if (MD.LoginName != Request.Form["LoginName"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "登陆名;";
                     }
                     if (MD.Password != AES_Key.AESEncrypt(Request.Form["Password"].ToString().Trim(), MD.LoginName.PadLeft(16, '0')))
                     {
                         IsRevice       = true;
                         MERR.Contents += "登陆密码;";
                     }
                     if (MD.MaintenancePerson != Request.Form["MaintenancePerson"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "设备维护人员;";
                     }
                     if (MD.MaintenanceTime != DateTime.Parse(Request.Form["MaintenanceTime"].ToString()))
                     {
                         IsRevice       = true;
                         MERR.Contents += "设备维护时间;";
                     }
                     if (MD.MaintenanceContent != Request.Form["MaintenanceContent"].ToString().Trim())
                     {
                         IsRevice       = true;
                         MERR.Contents += "设备维护内容;";
                     }
                     MD.DeviceType         = Request.Form["DeviceType"].ToString().Trim();
                     MD.Gateway            = Request.Form["Gateway"].ToString().Trim();
                     MD.FirstUseDate       = DateTime.Parse(Request.Form["FirstUseDate"].ToString());
                     MD.IP                 = Request.Form["IP"].ToString().Trim();
                     MD.LoginName          = Request.Form["LoginName"].ToString().Trim();
                     MD.MaintenanceContent = Request.Form["MaintenanceContent"].ToString().Trim();
                     MD.MaintenancePerson  = Request.Form["MaintenancePerson"].ToString().Trim();
                     MD.MaintenanceTime    = DateTime.Parse(Request.Form["MaintenanceTime"].ToString());
                     MD.Password           = AES_Key.AESEncrypt(Request.Form["Password"].ToString().Trim(), MD.LoginName.PadLeft(16, '0'));
                     MD.Port               = Request.Form["Port"].ToString().Trim();
                     MD.Business           = Request.Form["Business"].ToString().Trim();
                     MD.SerialNumber       = Request.Form["SerialNumber"].ToString().Trim();
                     MD.SubnetMask         = Request.Form["SubnetMask"].ToString().Trim();
                     bool result = DAL.DataCenter.Update(MD);
                     if (result)
                     {
                         if (IsRevice)
                         {
                             MERR.ReviceID     = MD.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();
                     }
                 }
             }
         }
     }
 }
예제 #6
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();
                }
            }
        }
예제 #7
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)
            {
                int id = int.Parse(Request["id"].ToString());
                Model.StationNetInfo MSN = DAL.StationNetInfo.GetModel(id);
                netid.Value   = MSN.ID.ToString();
                NetName.Value = MSN.NetName;
                Number.Value  = MSN.Number;

                DistributionDiagram.Value = MSN.DistributionDiagram;
                if (MSN.DistributionDiagram == "")
                {
                    viewDistributionDiagram.Disabled = true;
                }
                IP.Value              = MSN.IP;
                Port.Value            = MSN.Port;
                SourceNode.Value      = MSN.SourceNode;
                NetworkProtocol.Value = MSN.NetworkProtocol;
                DataFormat.Value      = MSN.DataFormat;
                ServiceContent.Value  = MSN.ServiceContent;
                sysselect             = MSN.SatelliteSystem;
                BuildTime.Value       = MSN.BuildTime.ToString();
            }
            if (Request["action"] != null && Request["action"] == "save")
            {
                string   sysdata = Request["sysdata"].ToString();
                string[] sys     = sysdata.Split(' ');
                string   SateSys = "";
                foreach (string s in sys)
                {
                    if (s != "")
                    {
                        SateSys += (s + ';');
                    }
                }
                int id = int.Parse(Request.Form["netid"].ToString().Trim());
                Model.StationNetInfo ms = DAL.StationNetInfo.GetModel(id);

                #region 对修改信息进行对比
                Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                bool IsRevice = false;
                MERR.Contents = "战网" + ms.NetName + "的信息发生了修改:";
                if (ms.BuildTime != Convert.ToDateTime(Request.Form["BuildTime"].ToString().Trim()))
                {
                    IsRevice       = true;
                    MERR.Contents += "建设完成时间;";
                }
                if (ms.Number != Request.Form["Number"].ToString().Trim())
                {
                    IsRevice       = true;
                    MERR.Contents += "站点数量;";
                }
                if (ms.IP != Request.Form["IP"].ToString().Trim())
                {
                    IsRevice       = true;
                    MERR.Contents += "IP地址;";
                }
                if (ms.Port != Request.Form["Port"].ToString().Trim())
                {
                    IsRevice       = true;
                    MERR.Contents += "端口;";
                }
                if (ms.SourceNode != Request.Form["SourceNode"].ToString().Trim())
                {
                    IsRevice       = true;
                    MERR.Contents += "源节点;";
                }
                if (ms.NetworkProtocol != Request.Form["NetworkProtocol"].ToString().Trim())
                {
                    IsRevice       = true;
                    MERR.Contents += "网络协议;";
                }
                if (ms.DataFormat != Request.Form["DataFormat"].ToString().Trim())
                {
                    IsRevice       = true;
                    MERR.Contents += "数据格式;";
                }
                if (ms.SatelliteSystem != SateSys)
                {
                    IsRevice       = true;
                    MERR.Contents += "卫星系统;";
                }
                if (ms.ServiceContent != Request.Form["ServiceContent"].ToString().Trim())
                {
                    IsRevice       = true;
                    MERR.Contents += "应用服务内容;";
                }

                #endregion


                ms.BuildTime  = Convert.ToDateTime(Request.Form["BuildTime"].ToString().Trim());
                ms.DataFormat = Request.Form["DataFormat"].ToString().Trim();
                if (Request.Form["DistributionDiagram"].ToString().Trim().Contains("DistributionDiagram"))
                {
                    ms.DistributionDiagram = Request.Form["DistributionDiagram"].ToString().Trim();
                }
                ms.IP              = Request.Form["IP"].ToString().Trim();
                ms.Number          = Request.Form["Number"].ToString().Trim();
                ms.Port            = Request.Form["Port"].ToString().Trim();
                ms.SatelliteSystem = SateSys;
                ms.NetName         = Request.Form["NetName"].ToString().Trim();
                ms.NetworkProtocol = Request.Form["NetworkProtocol"].ToString().Trim();
                ms.ServiceContent  = Request.Form["ServiceContent"].ToString().Trim();
                ms.SourceNode      = Request.Form["SourceNode"].ToString().Trim();
                if (DAL.StationNetInfo.GetModel(ms.NetName).ID != ms.ID)
                {
                    Response.Clear();
                    Response.Write("2");
                    Response.End();
                }
                else
                {
                    DAL.StationNetInfo.Update(ms);
                    if (IsRevice)
                    {
                        MERR.ReviceID     = ms.ID.ToString();
                        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"] == "DistributionDiagram")
            {
                string               filename  = Request.Files["FileDistributionDiagram"].FileName;
                int                  ids       = int.Parse(Request.Form["netid"].ToString().Trim());
                string[]             filenames = filename.Split('.');
                Model.StationNetInfo ms        = DAL.StationNetInfo.GetModel(ids);
                Request.Files["FileDistributionDiagram"].SaveAs(Server.MapPath("~/upload/DistributionDiagram/") + ms.NetName + "." + filenames[filenames.Length - 1]);

                ms.DistributionDiagram = "/upload/DistributionDiagram/" + ms.NetName + "." + filenames[filenames.Length - 1];
                DAL.StationNetInfo.Update(ms);
                Model.EquipReviceRecord MERR = new Model.EquipReviceRecord();
                MERR.ReviceID     = Request.Form["netid"].ToString().Trim();
                MERR.Contents     = "战网" + ms.NetName + "的信息发生了修改:站点分布示意图;";
                MERR.RevicePerson = Session["UserName"].ToString();
                MERR.ReviceTime   = DateTime.Now;
                MERR.Information  = "站网信息";
                DAL.EquipReviceRecord.Add(MERR);
                Response.Clear();
                Response.Write("1");
                Response.End();
            }
        }
예제 #8
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();
            }
        }