Пример #1
0
    private void LoadAlarmDvs()
    {
        SelectDvs sd = new SelectDvs();
        DataSet   ds = sd.QueryAlarm(Session["userid"].ToString(), Session["cityid"].ToString());

        alarmDvsJS = DeviceOutput.GetDvsJSON(ds);
    }
Пример #2
0
    private void LoadAlarmDvs()
    {
        SelectDvs sd = new SelectDvs();
        DataSet ds = sd.QueryAlarm(Session["userid"].ToString(), Session["cityid"].ToString());

        alarmDvsJS = DeviceOutput.GetDvsJSON(ds);
    }
Пример #3
0
    private void LoadDvsInfo(string id)
    {
        SelectDvs sd  = new SelectDvs();
        Dvs       dvs = sd.GetDvs(id);

        if (dvs != null)
        {
            mPortNum                             = DataGlobal.ConvertToInt(dvs.Portnum);
            txtAssertNo.Text                     = dvs.Assertno;
            txtBroadbandAccessNo.Text            = dvs.Broadbandaccessno;
            txtCustomerAddress.Text              = dvs.Customeraddress;
            txtCustomerManager.Text              = dvs.Customermanager;
            txtCustomerManagerPhone.Text         = dvs.Customermanager_phone;
            txtCustomerName.Text                 = dvs.Customername;
            txtDialupAccount.Text                = dvs.Dialupaccount;
            txtDialupPassword.Text               = dvs.Dialuppassword;
            txtDvsNo.Text                        = dvs.Dvsno;
            txtGateway.Text                      = dvs.Gateway;
            txtInstalldate.Text                  = dvs.Installdate.ToShortDateString();
            txtInstallPlace.Text                 = dvs.Installplace;
            txtIP.Text                           = dvs.Ip;
            txtJunctionBoxNo.Text                = dvs.Junctionboxno;
            txtLanNo.Text                        = dvs.Lanno;
            txtLinkman.Text                      = dvs.Linkman;
            txtLinkmanPhone.Text                 = dvs.Linkman_phone;
            txtPortNum.Text                      = dvs.Portnum;
            txtServiceDesc.Text                  = dvs.Servicedesc;
            txtStorageTime.Text                  = dvs.Storagetime;
            txtSubnetMask.Text                   = dvs.Subnetmask;
            txtSurfaceMan.Text                   = dvs.Surfaceman;
            txtSurfaceManPhone.Text              = dvs.Surfaceman_phone;
            ddlCustomerType.SelectedValue        = dvs.Customertype;
            ddlDeviceLevel.SelectedValue         = dvs.Devicelevel;
            ddlDeviceManu.SelectedValue          = dvs.Devicemanu;
            ddlDevicePropertyRight.SelectedValue = dvs.Devicepropertyright;
            ddlDeviceState.SelectedValue         = dvs.Devicestate;
            ddlDvsKind.SelectedValue             = dvs.Dvskind;
            ddlDvsType.SelectedValue             = dvs.Dvstype;
            ddlPaymentType.SelectedValue         = dvs.Paymenttype;
            ddlPowerType.SelectedValue           = dvs.Powertype;
            ddlPowerVoltage.SelectedValue        = dvs.Powervoltage;
            ddlServiceType.SelectedValue         = dvs.Servicetype;
            ddlStorageType.SelectedValue         = dvs.Storagetype;
            ddlSwitchinMode.SelectedValue        = dvs.Switchinmode;
            ddlSwitchinPlace.SelectedValue       = dvs.Switchinplace;
            //经纬度
            SelectDeviceXy sdxy = new SelectDeviceXy();
            Device_Info_xy xy   = sdxy.SelectByID(dvs.Id);
            if (xy != null)
            {
                txtLongitude.Text = xy.LONGITUDE.ToString();
                txtLatitude.Text  = xy.LATITUDE.ToString();
            }

            hdfSuburb.Value = dvs.Suburb;
            hdfDvsID.Value  = dvs.Id.ToString();
        }
    }
Пример #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string        key = Request.QueryString["root"];
        StringBuilder sb  = new StringBuilder();

        sb.Append("[");
        if (key != null && key != "" && key != "source")
        {
            //编码器
            SelectDvs sd = new SelectDvs();
            DataSet   ds = sd.Query(Session["userid"].ToString(), Session["cityID"].ToString(), "0", "0", "0", "0", "0", key, "0", "0", "0",
                                    "0", "", "", "", "", "", "", "");
            if (ds.Tables[0].Rows.Count > 0)
            {
                int i = 0;
                foreach (DataRow dataRow in ds.Tables[0].Rows)
                {
                    if (i > 0)
                    {
                        sb.Append(",");
                    }
                    sb.Append("{\"text\": \"" + Convert.ToString(dataRow["Customername"]) + "<a target='right' href='ResEncoder.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>\",\"hasChildren\": true}");
                    i++;
                }
            }
            else
            {
                SelectCameras sc  = new SelectCameras();
                DataSet       ds1 = sc.Query(key);
                int           i   = 0;
                foreach (DataRow dataRow in ds1.Tables[0].Rows)
                {
                    if (i > 0)
                    {
                        sb.Append(",");
                    }
                    sb.Append("{\"text\": \"" + Convert.ToString(dataRow["dvsno"]) + "(" + Convert.ToString(dataRow["dvsport"]) + ")" + "<a target='right' href='ResCamera.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>\"}");
                    i++;
                }
            }
        }
        sb.Append("]");
        Response.ContentType     = "application/json";
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        Response.Write(sb.ToString());
        Response.End();
    }
Пример #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     string key = Request.QueryString["root"];
     StringBuilder sb = new StringBuilder();
     sb.Append("[");
     if (key != null && key != "" && key != "source")
     {
         //编码器
         SelectDvs sd = new SelectDvs();
         DataSet ds = sd.Query(Session["userid"].ToString(), Session["cityID"].ToString(), "0", "0", "0", "0", "0", key, "0", "0", "0",
             "0", "", "", "", "", "", "", "");
         if (ds.Tables[0].Rows.Count > 0)
         {
             int i = 0;
             foreach (DataRow dataRow in ds.Tables[0].Rows)
             {
                 if (i > 0)
                 {
                     sb.Append(",");
                 }
                 sb.Append("{\"text\": \"" + Convert.ToString(dataRow["Customername"]) + "<a target='right' href='ResEncoder.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>\",\"hasChildren\": true}");
                 i++;
             }
         }
         else
         {
             SelectCameras sc = new SelectCameras();
             DataSet ds1 = sc.Query(key);
             int i = 0;
             foreach (DataRow dataRow in ds1.Tables[0].Rows)
             {
                 if (i > 0)
                 {
                     sb.Append(",");
                 }
                 sb.Append("{\"text\": \"" + Convert.ToString(dataRow["dvsno"]) + "(" + Convert.ToString(dataRow["dvsport"]) +")" + "<a target='right' href='ResCamera.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>\"}");
                 i++;
             }
         }
     }
     sb.Append("]");
     Response.ContentType = "application/json";
     Response.ContentEncoding = System.Text.Encoding.UTF8;
     Response.Write(sb.ToString());
     Response.End();
 }
Пример #6
0
    private DataSet DoQuery()
    {
        SelectDvs sd = new SelectDvs();
        DataSet   ds;

        if (hdfFlag.Value == "0")
        {
            ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), txtBasicCondition.Text);
        }
        else
        {
            ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), txtDvsNo.Text.Trim(), ddlDvsKind.SelectedValue, ddlDvsType.SelectedValue, ddlDeviceManu.SelectedValue,
                          ddlDevicePropertyRight.SelectedValue, hdfSuburb.Value, ddlDeviceLevel.SelectedValue, ddlDeviceState.SelectedValue, ddlPowerType.SelectedValue,
                          ddlCustomerType.SelectedValue, txtCustomerName.Text.Trim(), txtCustomerAddress.Text.Trim(), txtBegin.Text.Trim(), txtEnd.Text.Trim(),
                          txtLanNo.Text.Trim(), txtIP.Text.Trim(), txtAssertNo.Text.Trim());
        }
        return(ds);
    }
Пример #7
0
    protected void TreeView1_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
    {
        if (e.Node.Depth > 0)
        {
            if (e.Node.Depth == 1)
            {
                e.Node.ChildNodes.Clear();
                SelectDvs sd = new SelectDvs();
                DataSet   ds = sd.Query(e.Node.Value);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dataRow in ds.Tables[0].Rows)
                    {
                        TreeNode tv = new TreeNode();
                        tv.Value = Convert.ToString(dataRow["id"]);
                        tv.Text  = Convert.ToString(dataRow["Customername"]) + "<a target='right' href='ResEncoder.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>";
                        TreeNode node = new TreeNode();
                        node.Text = "";
                        tv.ChildNodes.Add(node);
                        tv.Expanded = false;
                        e.Node.ChildNodes.Add(tv);
                    }
                }
            }
            else if (e.Node.Depth == 2)
            {
                e.Node.ChildNodes.Clear();
                SelectCameras sc  = new SelectCameras();
                DataSet       ds1 = sc.Query(e.Node.Value);

                foreach (DataRow dataRow in ds1.Tables[0].Rows)
                {
                    TreeNode tv = new TreeNode();
                    tv.Text = Convert.ToString(dataRow["dvsno"]) + "(" + Convert.ToString(dataRow["dvsport"]) + ")" + "<a target='right' href='ResCamera.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>";
                    e.Node.ChildNodes.Add(tv);
                }
            }
        }
    }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string key    = Request.QueryString["key"];
        string type   = Request.QueryString["type"];
        string result = "[]";

        if (type == "1")   //查询编码器
        {
            SelectDvs sd = new SelectDvs();
            DataSet   ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), key);

            result = DeviceOutput.GetDvsJSON(ds);
        }
        else if (type == "2")  //查询摄像头
        {
            SelectCameras sc = new SelectCameras();
            DataSet       ds = sc.Query(Session["userid"].ToString(), Session["cityid"].ToString(), key);

            result = DeviceOutput.GetCameraJSON(ds);
        }
        else if (type == "3")  //
        {
            SelectDvs sd = new SelectDvs();
            DataSet   ds = sd.QueryNormal(Session["userid"].ToString(), Session["cityid"].ToString());
            result = DeviceOutput.GetDvsJSON(ds);
        }
        else if (type == "4")
        {
            SelectCameras sc = new SelectCameras();
            DataSet       ds = sc.QueryNormal(Session["userid"].ToString(), Session["cityid"].ToString());

            result = DeviceOutput.GetCameraJSON(ds);
        }
        Response.ContentType     = "application/json";
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        Response.Write("{\"a\":" + result + "}");
        Response.End();
    }
Пример #9
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string key = Request.QueryString["key"];
        string type = Request.QueryString["type"];
        string result = "[]";
        if (type == "1")   //查询编码器
        {
            SelectDvs sd = new SelectDvs();
            DataSet ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), key);

            result = DeviceOutput.GetDvsJSON(ds);
        }
        else if (type == "2")  //查询摄像头
        {
            SelectCameras sc = new SelectCameras();
            DataSet ds = sc.Query(Session["userid"].ToString(), Session["cityid"].ToString(), key);

            result = DeviceOutput.GetCameraJSON(ds);
        }
        else if (type == "3")  //
        {
            SelectDvs sd = new SelectDvs();
            DataSet ds = sd.QueryNormal(Session["userid"].ToString(), Session["cityid"].ToString());
            result = DeviceOutput.GetDvsJSON(ds);
        }
        else if (type == "4")
        {
            SelectCameras sc = new SelectCameras();
            DataSet ds = sc.QueryNormal(Session["userid"].ToString(), Session["cityid"].ToString());

            result = DeviceOutput.GetCameraJSON(ds);
        }
        Response.ContentType = "application/json";
        Response.ContentEncoding = System.Text.Encoding.UTF8;
        Response.Write("{\"a\":" + result + "}");
        Response.End();
    }
Пример #10
0
    private void LoadDvsInfo(string dvsID, string port)
    {
        hlkNew.NavigateUrl = "ResCamera.aspx?dvsid=" + dvsID;
        hlkBack.NavigateUrl = "ResEncoder.aspx?id=" + dvsID;
        SelectDvs sd = new SelectDvs();
        Dvs dvs = sd.GetDvs(dvsID);
        if (dvs != null)
        {
            txtDvsID.Text = dvs.Dvsno;
            txtBroadbandAccessNo.Text = dvs.Broadbandaccessno;
            txtCustomerManager.Text = dvs.Customermanager;
            txtCustomerManagerPhone.Text = dvs.Customermanager_phone;
            txtLanNo.Text = dvs.Lanno;
            txtIP.Text = dvs.Ip;
            txtGateway.Text = dvs.Gateway;
            txtSubnetMask.Text = dvs.Subnetmask;
            txtDialupAccount.Text = dvs.Dialupaccount;
            txtDialupPassword.Text = dvs.Dialuppassword;
            hdfSuburbID.Value = dvs.Suburb;

            SelectAreas sa = new SelectAreas();
            Areas area =sa.GetArea(dvs.Suburb); //分局
            if (area == null)
            {
                return;
            }
            txtSuburb.Text = area.Area_Name;

            area = sa.GetParentAreas(area.ID.ToString()); //郊县
            if (area == null)
            {
                return;
            }
            txtTown.Text = area.Area_Name;
            //剩余的端口
            SelectCameras sc = new SelectCameras();
            IList<Cameras> list = sc.GetCameras(Session["userid"].ToString(), Session["cityid"].ToString(), dvsID);
            int portNum = DataGlobal.ConvertToInt(dvs.Portnum);
            for (int i = 1; i <= portNum; i++)
            {
                bool flag = false;

                for (int j = 0; j < list.Count; j++)
                {
                    if (list[j].Dvsport == i.ToString())
                    {
                        flag = true;
                    }
                }
                if (i.ToString() == port)
                {
                    flag = false;
                }
                if (!flag)
                {
                    ListItem ddlone = new ListItem(i.ToString(), i.ToString());
                    ddlDvsPort.Items.Add(ddlone);
                }
            }
            if (Request["dvsport"] != null && Request["dvsport"] != "")
            {
                ddlDvsPort.SelectedValue = Request["dvsport"].ToString();
            }
            btnModify.Enabled = true;
            hdfDvsID.Value = dvs.Id.ToString();
        }
    }
Пример #11
0
 private DataSet DoQuery()
 {
     SelectDvs sd = new SelectDvs();
     DataSet ds;
     if (hdfFlag.Value == "0")
     {
         ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), txtBasicCondition.Text);
     }
     else
     {
         ds = sd.Query(Session["userid"].ToString(), Session["cityid"].ToString(), txtDvsNo.Text.Trim(), ddlDvsKind.SelectedValue, ddlDvsType.SelectedValue, ddlDeviceManu.SelectedValue,
             ddlDevicePropertyRight.SelectedValue, hdfSuburb.Value, ddlDeviceLevel.SelectedValue, ddlDeviceState.SelectedValue, ddlPowerType.SelectedValue,
             ddlCustomerType.SelectedValue, txtCustomerName.Text.Trim(), txtCustomerAddress.Text.Trim(), txtBegin.Text.Trim(), txtEnd.Text.Trim(),
             txtLanNo.Text.Trim(), txtIP.Text.Trim(), txtAssertNo.Text.Trim());
     }
     return ds;
 }
Пример #12
0
    private void LoadDvsInfo(string dvsID, string port)
    {
        hlkNew.NavigateUrl  = "ResCamera.aspx?dvsid=" + dvsID;
        hlkBack.NavigateUrl = "ResEncoder.aspx?id=" + dvsID;
        SelectDvs sd  = new SelectDvs();
        Dvs       dvs = sd.GetDvs(dvsID);

        if (dvs != null)
        {
            txtDvsID.Text                = dvs.Dvsno;
            txtBroadbandAccessNo.Text    = dvs.Broadbandaccessno;
            txtCustomerManager.Text      = dvs.Customermanager;
            txtCustomerManagerPhone.Text = dvs.Customermanager_phone;
            txtLanNo.Text                = dvs.Lanno;
            txtIP.Text             = dvs.Ip;
            txtGateway.Text        = dvs.Gateway;
            txtSubnetMask.Text     = dvs.Subnetmask;
            txtDialupAccount.Text  = dvs.Dialupaccount;
            txtDialupPassword.Text = dvs.Dialuppassword;
            hdfSuburbID.Value      = dvs.Suburb;

            SelectAreas sa   = new SelectAreas();
            Areas       area = sa.GetArea(dvs.Suburb); //分局
            if (area == null)
            {
                return;
            }
            txtSuburb.Text = area.Area_Name;

            area = sa.GetParentAreas(area.ID.ToString()); //郊县
            if (area == null)
            {
                return;
            }
            txtTown.Text = area.Area_Name;
            //剩余的端口
            SelectCameras   sc      = new SelectCameras();
            IList <Cameras> list    = sc.GetCameras(Session["userid"].ToString(), Session["cityid"].ToString(), dvsID);
            int             portNum = DataGlobal.ConvertToInt(dvs.Portnum);
            for (int i = 1; i <= portNum; i++)
            {
                bool flag = false;

                for (int j = 0; j < list.Count; j++)
                {
                    if (list[j].Dvsport == i.ToString())
                    {
                        flag = true;
                    }
                }
                if (i.ToString() == port)
                {
                    flag = false;
                }
                if (!flag)
                {
                    ListItem ddlone = new ListItem(i.ToString(), i.ToString());
                    ddlDvsPort.Items.Add(ddlone);
                }
            }
            if (Request["dvsport"] != null && Request["dvsport"] != "")
            {
                ddlDvsPort.SelectedValue = Request["dvsport"].ToString();
            }
            btnModify.Enabled = true;
            hdfDvsID.Value    = dvs.Id.ToString();
        }
    }
Пример #13
0
    protected void TreeView1_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
    {
        if (e.Node.Depth > 0)
        {
            if (e.Node.Depth == 1)
            {
                e.Node.ChildNodes.Clear();
                SelectDvs sd = new SelectDvs();
                DataSet ds = sd.Query(e.Node.Value);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    foreach (DataRow dataRow in ds.Tables[0].Rows)
                    {
                        TreeNode tv = new TreeNode();
                        tv.Value = Convert.ToString(dataRow["id"]);
                        tv.Text = Convert.ToString(dataRow["Customername"]) + "<a target='right' href='ResEncoder.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>";
                        TreeNode node = new TreeNode();
                        node.Text = "";
                        tv.ChildNodes.Add(node);
                        tv.Expanded = false;
                        e.Node.ChildNodes.Add(tv);

                    }
                }
            }
            else if (e.Node.Depth == 2)
            {
                e.Node.ChildNodes.Clear();
                SelectCameras sc = new SelectCameras();
                DataSet ds1 = sc.Query(e.Node.Value);

                foreach (DataRow dataRow in ds1.Tables[0].Rows)
                {
                    TreeNode tv = new TreeNode();
                    tv.Text = Convert.ToString(dataRow["dvsno"]) + "(" + Convert.ToString(dataRow["dvsport"]) + ")" + "<a target='right' href='ResCamera.aspx?id=" + Convert.ToString(dataRow["id"]) + "'>编辑</a>";
                    e.Node.ChildNodes.Add(tv);
                }
            }
        }
    }
Пример #14
0
    private void LoadDvsInfo(string id)
    {
        SelectDvs sd = new SelectDvs();
        Dvs dvs = sd.GetDvs(id);
        if (dvs != null)
        {
            mPortNum = DataGlobal.ConvertToInt(dvs.Portnum);
            txtAssertNo.Text = dvs.Assertno;
            txtBroadbandAccessNo.Text = dvs.Broadbandaccessno;
            txtCustomerAddress.Text = dvs.Customeraddress;
            txtCustomerManager.Text = dvs.Customermanager;
            txtCustomerManagerPhone.Text = dvs.Customermanager_phone;
            txtCustomerName.Text = dvs.Customername;
            txtDialupAccount.Text = dvs.Dialupaccount;
            txtDialupPassword.Text = dvs.Dialuppassword;
            txtDvsNo.Text = dvs.Dvsno;
            txtGateway.Text = dvs.Gateway;
            txtInstalldate.Text = dvs.Installdate.ToShortDateString();
            txtInstallPlace.Text = dvs.Installplace;
            txtIP.Text = dvs.Ip;
            txtJunctionBoxNo.Text = dvs.Junctionboxno;
            txtLanNo.Text = dvs.Lanno;
            txtLinkman.Text = dvs.Linkman;
            txtLinkmanPhone.Text = dvs.Linkman_phone;
            txtPortNum.Text = dvs.Portnum;
            txtServiceDesc.Text = dvs.Servicedesc;
            txtStorageTime.Text = dvs.Storagetime;
            txtSubnetMask.Text = dvs.Subnetmask;
            txtSurfaceMan.Text = dvs.Surfaceman;
            txtSurfaceManPhone.Text = dvs.Surfaceman_phone;
            ddlCustomerType.SelectedValue = dvs.Customertype;
            ddlDeviceLevel.SelectedValue = dvs.Devicelevel;
            ddlDeviceManu.SelectedValue = dvs.Devicemanu;
            ddlDevicePropertyRight.SelectedValue = dvs.Devicepropertyright;
            ddlDeviceState.SelectedValue = dvs.Devicestate;
            ddlDvsKind.SelectedValue = dvs.Dvskind;
            ddlDvsType.SelectedValue = dvs.Dvstype;
            ddlPaymentType.SelectedValue = dvs.Paymenttype;
            ddlPowerType.SelectedValue = dvs.Powertype;
            ddlPowerVoltage.SelectedValue = dvs.Powervoltage;
            ddlServiceType.SelectedValue = dvs.Servicetype;
            ddlStorageType.SelectedValue = dvs.Storagetype;
            ddlSwitchinMode.SelectedValue = dvs.Switchinmode;
            ddlSwitchinPlace.SelectedValue = dvs.Switchinplace;
            //经纬度
            SelectDeviceXy sdxy = new SelectDeviceXy();
            Device_Info_xy xy = sdxy.SelectByID(dvs.Id);
            if (xy != null)
            {
                txtLongitude.Text = xy.LONGITUDE.ToString();
                txtLatitude.Text = xy.LATITUDE.ToString();
            }

            hdfSuburb.Value = dvs.Suburb;
            hdfDvsID.Value = dvs.Id.ToString();
        }
    }