Ejemplo n.º 1
0
    private void LoadArea()
    {
        if (hdfSuburb.Value != "" && hdfSuburb.Value != "0")
        {
            SelectAreas sa   = new SelectAreas();
            Areas       town = sa.GetParentAreas(hdfSuburb.Value);
            ddlTown.SelectedValue = town.ID.ToString();

            StringBuilder sb         = new StringBuilder();
            IList <Areas> suburbList = sa.Getsuburb(town.ID.ToString(), Session["userid"].ToString());
            sb.Append("<select id=\"ddlSuburb\">");
            foreach (Areas area in suburbList)
            {
                if (area.ID.ToString() == hdfSuburb.Value)
                {
                    sb.Append("<option selected=\"selected\" value=\"" + area.ID.ToString() + "\">" + area.Area_Name + "</option>");
                }
                else
                {
                    sb.Append("<option value=\"" + area.ID.ToString() + "\">" + area.Area_Name + "</option>");
                }
            }
            sb.Append("<option value=\"0\">请选择分局</option>");
            sb.Append("</select>");
            ltlSuburb.Text = sb.ToString();
        }
        else
        {
            ltlSuburb.Text = "<select id=\"ddlSuburb\"><option value=\"0\">请选择分局</option></select>";
        }
    }
Ejemplo n.º 2
0
    private void LoadArea()
    {
        if (hdfSuburb.Value != "" && hdfSuburb.Value != "0")
        {
            SelectAreas sa = new SelectAreas();
            Areas town = sa.GetParentAreas(hdfSuburb.Value);
            ddlTown.SelectedValue = town.ID.ToString();

            StringBuilder sb = new StringBuilder();
            IList<Areas> suburbList = sa.Getsuburb(town.ID.ToString(), Session["userid"].ToString());
            sb.Append("<select id=\"ddlSuburb\">");
            foreach (Areas area in suburbList)
            {
                if (area.ID.ToString() == hdfSuburb.Value)
                {
                    sb.Append("<option selected=\"selected\" value=\"" + area.ID.ToString() + "\">" + area.Area_Name + "</option>");
                }
                else
                {
                    sb.Append("<option value=\"" + area.ID.ToString() + "\">" + area.Area_Name + "</option>");
                }
            }
            sb.Append("<option value=\"0\">请选择分局</option>");
            sb.Append("</select>");
            ltlSuburb.Text = sb.ToString();
        }
        else
        {
            ltlSuburb.Text = "<select id=\"ddlSuburb\"><option value=\"0\">请选择分局</option></select>";
        }
    }
Ejemplo n.º 3
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();
        }
    }
Ejemplo n.º 4
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();
        }
    }