Exemplo n.º 1
0
        private void DeleteInternet()
        {
            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.InternetInformation mi = DAL.InternetInformation.GetModel(ids[m]);
                    bool resultd = DAL.InternetInformation.Delete(ids[m]);


                    Model.SysLog mSysLog = new Model.SysLog();
                    mSysLog.LogTime  = DateTime.Now;
                    mSysLog.LogType  = 0;
                    mSysLog.UserName = Session["UserName"].ToString();
                    mSysLog.Remark   = "管理员删除了网络:" + mi.Type;
                    DAL.SysLog.Add(mSysLog);
                }
                Response.Clear();
                Response.Write("1");
                Response.End();
            }
            catch (Exception)
            {
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// 更新一条数据,根据ID
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static bool Update(Model.InternetInformation model)
        {
            string       strSql                 = "update InternetInformation set DataLineStartP=@DataLineStartP, DataLineEndP=@DataLineEndP, Type=@Type, EncryptionTechnology=@EncryptionTechnology, BandWidth=@BandWidth, GreenOperator=@GreenOperator, TechnicalSupportStaff=@TechnicalSupportStaff, FDataLineType=@FDataLineType, FEncryptionTechnology=@FEncryptionTechnology, FBandWidth=@FBandWidth, FGreenOperator=@FGreenOperator, FTechnicalSupportStaff=@FTechnicalSupportStaff, ServerIP=@ServerIP, ServerPort=@ServerPort, ServerMachineName=@ServerMachineName, ServerLogo=@ServerLogo, ServerUse=@ServerUse, ServerRemark=@ServerRemark, StorageIP=@StorageIP, StoragePort=@StoragePort, StorageMachineName=@StorageMachineName, StorageLogo=@StorageLogo, StorageUse=@StorageUse, StorageRemark=@StorageRemark, EquipmentID=@EquipmentID, EquipConfig=@EquipConfig, Topological=@Topological, RouterConfig=@RouterConfig  where ID = " + model.ID.ToString();
            SqlParameter DataLineStartP         = new SqlParameter("DataLineStartP", SqlDbType.NVarChar); DataLineStartP.Value = model.DataLineStartP;
            SqlParameter DataLineEndP           = new SqlParameter("DataLineEndP", SqlDbType.NVarChar); DataLineEndP.Value = model.DataLineEndP;
            SqlParameter Type                   = new SqlParameter("Type", SqlDbType.NVarChar); Type.Value = model.Type;
            SqlParameter EncryptionTechnology   = new SqlParameter("EncryptionTechnology", SqlDbType.NVarChar); EncryptionTechnology.Value = model.EncryptionTechnology;
            SqlParameter BandWidth              = new SqlParameter("BandWidth", SqlDbType.NVarChar); BandWidth.Value = model.BandWidth;
            SqlParameter GreenOperator          = new SqlParameter("GreenOperator", SqlDbType.NVarChar); GreenOperator.Value = model.GreenOperator;
            SqlParameter TechnicalSupportStaff  = new SqlParameter("TechnicalSupportStaff", SqlDbType.NVarChar); TechnicalSupportStaff.Value = model.TechnicalSupportStaff;
            SqlParameter FDataLineType          = new SqlParameter("FDataLineType", SqlDbType.NVarChar); FDataLineType.Value = model.FDataLineType;
            SqlParameter FEncryptionTechnology  = new SqlParameter("FEncryptionTechnology", SqlDbType.NVarChar); FEncryptionTechnology.Value = model.FEncryptionTechnology;
            SqlParameter FBandWidth             = new SqlParameter("FBandWidth", SqlDbType.NVarChar); FBandWidth.Value = model.FBandWidth;
            SqlParameter FGreenOperator         = new SqlParameter("FGreenOperator", SqlDbType.NVarChar); FGreenOperator.Value = model.FGreenOperator;
            SqlParameter FTechnicalSupportStaff = new SqlParameter("FTechnicalSupportStaff", SqlDbType.NVarChar); FTechnicalSupportStaff.Value = model.FTechnicalSupportStaff;
            SqlParameter ServerIP               = new SqlParameter("ServerIP", SqlDbType.NVarChar); ServerIP.Value = model.ServerIP;
            SqlParameter ServerPort             = new SqlParameter("ServerPort", SqlDbType.NVarChar); ServerPort.Value = model.ServerPort;
            SqlParameter ServerMachineName      = new SqlParameter("ServerMachineName", SqlDbType.NVarChar); ServerMachineName.Value = model.ServerMachineName;
            SqlParameter ServerLogo             = new SqlParameter("ServerLogo", SqlDbType.NVarChar); ServerLogo.Value = model.ServerLogo;
            SqlParameter ServerUse              = new SqlParameter("ServerUse", SqlDbType.NVarChar); ServerUse.Value = model.ServerUse;
            SqlParameter ServerRemark           = new SqlParameter("ServerRemark", SqlDbType.NVarChar); ServerRemark.Value = model.ServerRemark;
            SqlParameter StorageIP              = new SqlParameter("StorageIP", SqlDbType.NVarChar); StorageIP.Value = model.StorageIP;
            SqlParameter StoragePort            = new SqlParameter("StoragePort", SqlDbType.NVarChar); StoragePort.Value = model.StoragePort;
            SqlParameter StorageMachineName     = new SqlParameter("StorageMachineName", SqlDbType.NVarChar); StorageMachineName.Value = model.StorageMachineName;
            SqlParameter StorageLogo            = new SqlParameter("StorageLogo", SqlDbType.NVarChar); StorageLogo.Value = model.StorageLogo;
            SqlParameter StorageUse             = new SqlParameter("StorageUse", SqlDbType.NVarChar); StorageUse.Value = model.StorageUse;
            SqlParameter StorageRemark          = new SqlParameter("StorageRemark", SqlDbType.NVarChar); StorageRemark.Value = model.StorageRemark;
            SqlParameter EquipmentID            = new SqlParameter("EquipmentID", SqlDbType.NVarChar); EquipmentID.Value = model.EquipmentID;
            SqlParameter EquipConfig            = new SqlParameter("EquipConfig", SqlDbType.NVarChar); EquipConfig.Value = model.EquipConfig;
            SqlParameter Topological            = new SqlParameter("Topological", SqlDbType.NVarChar); Topological.Value = model.Topological;
            SqlParameter RouterConfig           = new SqlParameter("RouterConfig", SqlDbType.NVarChar); RouterConfig.Value = model.RouterConfig;

            return(DBHelperSQL.GetNums(strSql, new SqlParameter[] { DataLineStartP, DataLineEndP, Type, EncryptionTechnology, BandWidth, GreenOperator, TechnicalSupportStaff, FDataLineType, FEncryptionTechnology, FBandWidth, FGreenOperator, FTechnicalSupportStaff, ServerIP, ServerPort, ServerMachineName, ServerLogo, ServerUse, ServerRemark, StorageIP, StoragePort, StorageMachineName, StorageLogo, StorageUse, StorageRemark, EquipmentID, EquipConfig, Topological, RouterConfig }, connectionString) == 1 ? true : false);
        }
Exemplo n.º 3
0
        public static Model.InternetInformation GetModel(int ID)
        {
            string strSql = "select * from InternetInformation where ID = '" + ID + "'";

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

            model.ID = ID;
            if (ds.Tables[0].Rows.Count > 0)
            {
                model.Type                   = Convert.ToString(ds.Tables[0].Rows[0]["Type"]);
                model.DataLineStartP         = Convert.ToString(ds.Tables[0].Rows[0]["DataLineStartP"]);
                model.DataLineEndP           = Convert.ToString(ds.Tables[0].Rows[0]["DataLineEndP"]);
                model.EncryptionTechnology   = Convert.ToString(ds.Tables[0].Rows[0]["EncryptionTechnology"]);
                model.BandWidth              = Convert.ToString(ds.Tables[0].Rows[0]["BandWidth"]);
                model.GreenOperator          = Convert.ToString(ds.Tables[0].Rows[0]["GreenOperator"]);
                model.TechnicalSupportStaff  = Convert.ToString(ds.Tables[0].Rows[0]["TechnicalSupportStaff"]);
                model.FDataLineType          = Convert.ToString(ds.Tables[0].Rows[0]["FDataLineType"]);
                model.FEncryptionTechnology  = Convert.ToString(ds.Tables[0].Rows[0]["FEncryptionTechnology"]);
                model.FBandWidth             = Convert.ToString(ds.Tables[0].Rows[0]["FBandWidth"]);
                model.FGreenOperator         = Convert.ToString(ds.Tables[0].Rows[0]["FGreenOperator"]);
                model.FTechnicalSupportStaff = Convert.ToString(ds.Tables[0].Rows[0]["FTechnicalSupportStaff"]);
                model.ServerIP               = Convert.ToString(ds.Tables[0].Rows[0]["ServerIP"]);
                model.ServerPort             = Convert.ToString(ds.Tables[0].Rows[0]["ServerPort"]);
                model.ServerMachineName      = Convert.ToString(ds.Tables[0].Rows[0]["ServerMachineName"]);
                model.ServerLogo             = Convert.ToString(ds.Tables[0].Rows[0]["ServerLogo"]);
                model.ServerUse              = Convert.ToString(ds.Tables[0].Rows[0]["ServerUse"]);
                model.ServerRemark           = Convert.ToString(ds.Tables[0].Rows[0]["ServerRemark"]);
                model.StorageIP              = Convert.ToString(ds.Tables[0].Rows[0]["StorageIP"]);
                model.StoragePort            = Convert.ToString(ds.Tables[0].Rows[0]["StoragePort"]);
                model.StorageMachineName     = Convert.ToString(ds.Tables[0].Rows[0]["StorageMachineName"]);
                model.StorageLogo            = Convert.ToString(ds.Tables[0].Rows[0]["StorageLogo"]);
                model.StorageUse             = Convert.ToString(ds.Tables[0].Rows[0]["StorageUse"]);
                model.StorageRemark          = Convert.ToString(ds.Tables[0].Rows[0]["StorageRemark"]);
                model.EquipmentID            = Convert.ToString(ds.Tables[0].Rows[0]["EquipmentID"]);
                model.EquipConfig            = Convert.ToString(ds.Tables[0].Rows[0]["EquipConfig"]);
                model.Topological            = Convert.ToString(ds.Tables[0].Rows[0]["Topological"]);
                model.RouterConfig           = Convert.ToString(ds.Tables[0].Rows[0]["RouterConfig"]);



                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 4
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.InternetInfoEquip mi = DAL.InternetInfoEquip.GetModel(ids[m]);

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

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

                    if (result)
                    {
                        foreach (DataRow dr in ds.Tables[0].Rows)
                        {
                            Model.InternetInformation MII = DAL.InternetInformation.GetModel(int.Parse(dr["ID"].ToString()));
                            if (MII != null)
                            {
                                string eid = MII.EquipmentID.Replace(ids[m] + ";", "").Trim();
                                MII.EquipmentID = eid;
                                DAL.InternetInformation.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)
            {
            }
        }
Exemplo n.º 5
0
        private void AddInternet()
        {
            var     cont    = Request["internet"].ToString();
            Content content = CORSV2.cs.JSONHelper.JSONToObject <Content>(cont);

            if (DAL.InternetInformation.Exists(content.nType))
            {
                Response.Clear();
                Response.Write("0");
                Response.End();
            }
            else
            {
                Model.InternetInformation mi = new Model.InternetInformation();
                mi.DataLineStartP        = content.DataLineStartP;
                mi.Type                  = content.nType;
                mi.DataLineEndP          = content.DataLineEndP;
                mi.EncryptionTechnology  = content.EncryptionTechnology;
                mi.BandWidth             = content.BandWidth;
                mi.GreenOperator         = content.GreenOperator;
                mi.TechnicalSupportStaff = content.TechnicalSupportStaff;
                bool r = DAL.InternetInformation.Add(mi);
                if (r)
                {
                    Response.Clear();
                    Response.Write("1");
                    Response.End();
                }
                else
                {
                    Response.Clear();
                    Response.Write("2");
                    Response.End();
                }
            }
        }
Exemplo n.º 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)
                {
                    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();
            }
        }
Exemplo n.º 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)
            {
                if (Request["ID"] != null)
                {
                    IDD = int.Parse(Request["ID"].ToString());
                }
            }
            else
            {
                if (Request["action"] == "save")
                {
                    Model.InternetInfoEquip MI = new Model.InternetInfoEquip();
                    MI.IP          = Request.Form["IP"].ToString();
                    MI.Port        = Request.Form["Port"].ToString();
                    MI.MachineName = Request.Form["MachineName"].ToString();
                    MI.Logo        = Request.Form["Logo"].ToString();
                    MI.Remark      = Request.Form["Remark"].ToString();
                    MI.EUse        = Request.Form["EUse"].ToString();
                    if (DAL.InternetInfoEquip.Exists(MI.MachineName))
                    {
                        Response.Clear();
                        Response.Write("2");
                        Response.End();
                        return;
                    }
                    else
                    {
                        bool result = DAL.InternetInfoEquip.Add(MI);
                        if (result)
                        {
                            Model.InternetInformation MII = DAL.InternetInformation.GetModel(IDD);
                            MII.EquipmentID += DAL.InternetInfoEquip.GetModel(MI.MachineName).ID + ";";
                            DAL.InternetInformation.Update(MII);

                            Response.Clear();
                            Response.Write("1");
                            Response.End();
                            return;
                        }
                        else
                        {
                            Response.Clear();
                            Response.Write("0");
                            Response.End();
                        }
                    }
                }
            }
        }