Ejemplo n.º 1
0
 public void AddBindStationInfo(string[] str1, int count)
 {
     try
     {
         string        id         = DateTime.Now.ToString("yyyyMMddHHmmssfff");
         string        dlId       = HideRoad.Value as string;
         List <string> Listdeviid = new List <string>();
         for (int i = 0; i < count; i++)
         {
             Listdeviid.Add(str1[i]);
         }
         if (tgsPproperty.InsertKeyroadStation(id, dlId, Listdeviid) > 0)
         {
             Notice(GetLangStr("KeyRoadManager48", "信息提示"), GetLangStr("KeyRoadManager52", "监测点关联成功!"));
             GetStationInfoByRoad(dlId);
             Window4.Hide();
         }
     }
     catch (Exception ex)
     {
         ILog.WriteErrorLog(ex);
         logManager.InsertLogError("KeyRoadManager.aspx-AddBindStationInfo", ex.Message + ";" + ex.StackTrace, "AddBindStationInfo has an exception");
     }
 }
 /// <summary>
 /// 添加连接信息
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void UpdateDevice(object sender, DirectEventArgs e)
 {
     try
     {
         Hashtable hs = new Hashtable();
         hs.Add("masterid", TxtMasterId.Text);
         if (CmbDirection.SelectedIndex != -1)
         {
             hs.Add("direction_id", CmbDirection.Value);
         }
         else
         {
             Notice(GetLangStr("CCTVStationManager49", "信息提示"), GetLangStr("CCTVStationManager50", "请选择所属方向"));
             return;
         }
         if (CmbIsuse.SelectedIndex != -1)
         {
             hs.Add("isuse", CmbIsuse.Value);
         }
         else
         {
             Notice(GetLangStr("CCTVStationManager49", "信息提示"), GetLangStr("CCTVStationManager51", "请选择是否启用"));
             return;
         }
         if (!string.IsNullOrEmpty(MNumChannel.Text))
         {
             hs.Add("mchannelid", MNumChannel.Text);
         }
         else
         {
             Notice(GetLangStr("CCTVStationManager49", "信息提示"), GetLangStr("CCTVStationManager52", "请输入实时监视通道"));
             return;
         }
         if (!string.IsNullOrEmpty(RNumChannel.Text))
         {
             hs.Add("rchannelid", RNumChannel.Text);
         }
         else
         {
             Notice(GetLangStr("CCTVStationManager49", "信息提示"), GetLangStr("CCTVStationManager53", "请输入录像回放通道"));
             return;
         }
         if (HidSaveFlag.Value.ToString() == "1")
         {
             if (CmbStation.SelectedIndex != -1)
             {
                 hs.Add("station_id", CmbStation.Value);
             }
             else
             {
                 Notice(GetLangStr("CCTVStationManager49", "信息提示"), GetLangStr("CCTVStationManager54", "请选择监测点名称"));
                 return;
             }
             if (CmbDevice.SelectedIndex != -1)
             {
                 hs.Add("mdevice_id", CmbDevice.Value);
             }
             else
             {
                 Notice(GetLangStr("CCTVStationManager49", "信息提示"), GetLangStr("CCTVStationManager55", "请选择连接监视设备"));
                 return;
             }
             if (CmbDeviceRecord.SelectedIndex != -1)
             {
                 hs.Add("rdevice_id", CmbDeviceRecord.Value);
             }
             else
             {
                 Notice(GetLangStr("CCTVStationManager49", "信息提示"), GetLangStr("CCTVStationManager56", "请选择连接录像回放设备"));
                 return;
             }
             string Id = tgsDataInfo.GetTgsRecordId();
             hs.Add("id", Id);
             if (deviceManager.InsertCctvSetting(hs) > 0)
             {
                 LedDataBind(" 1=1 ");
                 jcdlx  = CmbStationType.SelectedItem.Text;
                 jcdmc  = CmbStation.SelectedItem.Text;
                 ssjcsb = CmbDevice.SelectedItem.Text;
                 string lblname = "";
                 lblname += Bll.Common.AssembleRunLog("", jcdmc, "监测点名称", "0");
                 lblname += Bll.Common.AssembleRunLog("", jcdlx, "监测点类型", "0");
                 lblname += Bll.Common.AssembleRunLog("", ssjcsb, "实时监测设备", "0");
                 logManager.InsertLogRunning(uName, "添加:监测点[" + jcdmc + "]" + lblname, nowIp, "1");
                 Notice(GetLangStr("CCTVStationManager49", "信息提示"), GetLangStr("CCTVStationManager57", "添加成功"));
                 Window4.Hide();
             }
         }
         if (HidSaveFlag.Value.ToString() == "2")
         {
             RowSelectionModel sm = this.GridDeviceManager.SelectionModel.Primary as RowSelectionModel;
             sm.SelectedRow.ToBuilder();
             string Id = sm.SelectedRow.RecordID;
             hs.Add("id", Id);
             if (deviceManager.UptateCctvSetting(hs) > 0)
             {
                 LedDataBind(" 1=1");
                 DataRow[] dt      = dtname.Select("col0='" + Id + "'");
                 string    jcmc    = dt[0]["col2"].ToString();
                 string    jcname  = dt[0]["col2"].ToString();
                 string    jktds   = MNumChannel.Text;
                 string    hftds   = RNumChannel.Text;
                 string    ssfxs   = CmbDirection.SelectedItem.Text;
                 string    jzbhs   = TxtMasterId.Text;
                 string    sfsts   = CmbIsuse.SelectedItem.Text;
                 string    lblname = "";
                 lblname += Bll.Common.AssembleRunLog(jktdh, jktds, "监控通道号", "1");
                 lblname += Bll.Common.AssembleRunLog(hftdh, hftds, "回放通道号", "1");
                 lblname += Bll.Common.AssembleRunLog(ssfx, ssfxs, "所属方向", "1");
                 lblname += Bll.Common.AssembleRunLog(jzbh, jzbhs, "矩阵编号", "1");
                 lblname += Bll.Common.AssembleRunLog(sgqy, sfsts, "是否启用", "1");
                 logManager.InsertLogRunning(uName, "修改:[" + jcmc + "]监测点;" + lblname, nowIp, "2");
                 Notice(GetLangStr("CCTVStationManager49", "信息提示"), GetLangStr("CCTVStationManager58", "修改成功"));
                 Window4.Hide();
             }
         }
     }
     catch (Exception ex)
     {
         ILog.WriteErrorLog(ex);
         logManager.InsertLogError("CCTVStationManager.aspx-UpdateDevice", ex.Message + ";" + ex.StackTrace, "UpdateDevice has an exception");
     }
 }
        /// <summary>
        ///  更新设备信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UpdateDevice(object sender, DirectEventArgs e)
        {
            try
            {
                Hashtable hs        = new Hashtable();
                string    server_id = string.Empty;
                if (!string.IsNullOrEmpty(Text_SBBH.Text))
                {
                    server_id = Text_SBBH.Text.ToString();
                }
                else
                {
                    if (HidSaveFlag.Value.ToString() == "1")
                    {
                        server_id = tgsPproperty.GetMinRecordId();
                    }
                    if (HidSaveFlag.Value.ToString() == "2")
                    {
                        server_id = HiddenId.Value.ToString();
                    }
                }

                hs.Add("server_id", server_id);
                hs.Add("server_idext", "");

                if (Cob_SBLX.SelectedIndex != -1)
                {
                    hs.Add("server_type_id", Cob_SBLX.Value.ToString());
                }
                else
                {
                    hs.Add("server_type_id", "");
                }
                if (Cob_SBXH.SelectedIndex != -1)
                {
                    hs.Add("server_mode_id", Cob_SBXH.Value.ToString());
                }
                else
                {
                    hs.Add("server_mode_id", "");
                }
                hs.Add("server_name", Text_SBMC.Text);

                if (Cob_SFSY.SelectedIndex != -1)
                {
                    hs.Add("isuse", Cob_SFSY.Value.ToString());
                }
                else
                {
                    hs.Add("isuse", "0");
                }
                hs.Add("ipaddress", Text_IP.Text);

                hs.Add("port", Text_DK.Text);

                hs.Add("channels", Text_TYDS.Text.ToString());

                if (Cob_TXLX.SelectedIndex != -1)
                {
                    hs.Add("comm_type_id", Cob_TXLX.Value.ToString());
                }
                else
                {
                    hs.Add("comm_type_id", "");
                }
                if (Cob_TXXY.SelectedIndex != -1)
                {
                    hs.Add("protocol_id", Cob_TXXY.Value.ToString());
                }
                else
                {
                    hs.Add("protocol_id", "");
                }
                hs.Add("username", Text_YHM.Text);
                hs.Add("password", Text_MM.Text);
                if (Cob_JSDW.SelectedIndex != -1)
                {
                    hs.Add("build_id", Cob_JSDW.Value.ToString());
                }
                else
                {
                    hs.Add("build_id", "");
                }
                if (Cob_ZZCS.SelectedIndex != -1)
                {
                    hs.Add("make_company_id", Cob_ZZCS.Value.ToString());
                }
                else
                {
                    hs.Add("make_company_id", "");
                }
                if (Cob_WHDW.SelectedIndex != -1)
                {
                    hs.Add("maintain_company_id", Cob_WHDW.Value.ToString());
                }
                else
                {
                    hs.Add("maintain_company_id", "");
                }
                hs.Add("jkxlh", "");
                if (deviceManager.UptateServerInfo(hs) > 0)
                {
                    if (HidSaveFlag.Value != null)
                    {
                        if (HidSaveFlag.Value.ToString() == "1")
                        {
                            Window4.Hide();
                            LedDataBind(" 1=1 and server_type_id='" + Cob_SBLX.Value.ToString() + "'");
                            string lblname = "";
                            lblname += Bll.Common.AssembleRunLog("", Cob_SBLX.SelectedItem.Text, GetLangStr("ServerManager2", "服务器类型"), "0");
                            lblname += Bll.Common.AssembleRunLog("", Cob_SBXH.SelectedItem.Text, GetLangStr("ServerManager4", "服务器型号"), "0");
                            lblname += Bll.Common.AssembleRunLog("", Text_TYDS.Text, GetLangStr("ServerManager42", "服务器通道数"), "0");
                            lblname += Bll.Common.AssembleRunLog("", Cob_SFSY.SelectedItem.Text, GetLangStr("ServerManager54", "是否使用"), "0");
                            lblname += Bll.Common.AssembleRunLog("", Cob_JSDW.SelectedItem.Text, GetLangStr("ServerManager46", "建设单位"), "0");
                            lblname += Bll.Common.AssembleRunLog("", Cob_WHDW.SelectedItem.Text, GetLangStr("ServerManager48", "维护单位"), "0");
                            lblname += Bll.Common.AssembleRunLog("", Cob_ZZCS.SelectedItem.Text, GetLangStr("ServerManager50", "设备制造厂商"), "0");

                            logManager.InsertLogRunning(uName, GetLangStr("ServerManager56", "添加:服务器[") + Text_SBMC.Text + "]" + lblname, nowIp, "1");
                            Notice(GetLangStr("ServerManager55", "信息提示"), GetLangStr("ServerManager58", "添加成功"));
                            HidSaveFlag.Value = null;
                            return;
                        }
                    }
                    Window4.Hide();
                    LedDataBind(" 1=1 and server_type_id='" + Cob_SBLX.Value.ToString() + "'");
                    Notice(GetLangStr("ServerManager55", "信息提示"), GetLangStr("ServerManager59", "修改成功"));

                    string fwqlxs  = Cob_SBLX.SelectedItem.Text;
                    string fwqmcs  = Text_SBMC.Text;
                    string fwqxhs  = Cob_SBXH.SelectedItem.Text;
                    string fwqips  = Text_IP.Text;
                    string fwqdks  = Text_DK.Text;
                    string txlxs   = Cob_TXLX.SelectedItem.Text;
                    string txxys   = Cob_TXXY.SelectedItem.Text;
                    string yhms    = Text_YHM.Text;
                    string mms     = Text_MM.Text;
                    string fwqtdss = Text_TYDS.Text;
                    string sfsys   = Cob_SFSY.SelectedItem.Text;
                    string jsdws   = Cob_JSDW.SelectedItem.Text;
                    string whdws   = Cob_WHDW.SelectedItem.Text;
                    string sbzzcss = Cob_ZZCS.SelectedItem.Text;
                    string lname   = "";
                    lname += Bll.Common.AssembleRunLog(fwqlx, fwqlxs, GetLangStr("ServerManager2 ", "服务器类型"), "1");
                    lname += Bll.Common.AssembleRunLog(fwqmc, fwqmcs, GetLangStr("ServerManager1", "服务器名称"), "1");
                    lname += Bll.Common.AssembleRunLog(fwqxh, fwqxhs, GetLangStr("ServerManager4", "服务器型号"), "1");
                    lname += Bll.Common.AssembleRunLog(fwqip, fwqips, GetLangStr("ServerManager20", "服务器ip"), "1");
                    lname += Bll.Common.AssembleRunLog(fwqdk, fwqdks, GetLangStr("ServerManager21", "服务器端口"), "1");
                    lname += Bll.Common.AssembleRunLog(txlx, txlxs, GetLangStr("ServerManager36", "通讯类型"), "1");
                    lname += Bll.Common.AssembleRunLog(txxy, txxys, GetLangStr("ServerManager38", "通讯协议"), "1");
                    lname += Bll.Common.AssembleRunLog(yhm, yhms, GetLangStr("ServerManager40", "用户名"), "1");
                    lname += Bll.Common.AssembleRunLog(mm, mms, GetLangStr("ServerManager41", "密码"), "1");
                    lname += Bll.Common.AssembleRunLog(fwqtds, fwqtdss, GetLangStr("ServerManager42", "服务器通道数"), "1");
                    lname += Bll.Common.AssembleRunLog(sfsy, sfsys, GetLangStr("ServerManager57", "是否使用"), "1");
                    lname += Bll.Common.AssembleRunLog(jsdw, jsdws, GetLangStr("ServerManager46", "建设单位"), "1");
                    lname += Bll.Common.AssembleRunLog(whdw, whdws, GetLangStr("ServerManager48", "维护单位"), "1");
                    lname += Bll.Common.AssembleRunLog(sbzzcs, sbzzcss, GetLangStr("ServerManager50", "设备制造厂商"), "1");
                    logManager.InsertLogRunning(uName, GetLangStr("ServerManager62", "修改服务器:[") + fwqmc + "];" + lname, nowIp, "2");
                }
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("ServerManager.aspx-UpdateDevice", ex.Message + ";" + ex.StackTrace, "UpdateDevice has an exception");
            }
        }
        /// <summary>
        ///  更新设备信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UpdateDevice(object sender, DirectEventArgs e)
        {
            try
            {
                Hashtable hs = new Hashtable();
                hs.Add("service_id", HideServiceId.Value.ToString());

                hs.Add("imagepath", TxtImagePath.Text.Replace(@"\", @"\\"));
                hs.Add("localip", TxtIpaddress.Text);
                if (!string.IsNullOrEmpty(NumPort.Text))
                {
                    hs.Add("localport", NumPort.Text);
                }
                else
                {
                    hs.Add("localport", "0");
                }
                if (CmbIsSacn.SelectedIndex != -1)
                {
                    hs.Add("isscanfile", CmbIsSacn.Value);
                }
                else
                {
                    Notice(GetLangStr("TGSStationManager56", "信息提示"), GetLangStr("TGSStationManager57", "请选择是否文件扫描"));
                    return;
                }
                if (CmbDirection.SelectedIndex != -1)
                {
                    hs.Add("direction_id", CmbDirection.Value);
                }
                else
                {
                    Notice(GetLangStr("TGSStationManager56", "信息提示"), GetLangStr("TGSStationManager58", "请选择所属方向"));
                    return;
                }
                if (CmbIsuse.SelectedIndex != -1)
                {
                    hs.Add("isuse", CmbIsuse.Value);
                }
                else
                {
                    Notice(GetLangStr("TGSStationManager56", "信息提示"), GetLangStr("TGSStationManager59", "请选择是否启用"));
                    return;
                }
                if (!string.IsNullOrEmpty(NumChannel.Text))
                {
                    hs.Add("channelid", NumChannel.Text);
                }
                else
                {
                    hs.Add("channelid", "0");
                }
                SelectedListItemCollection lists = this.MulCmbAppFlag.SelectedItems;
                string applyflag = string.Empty;
                if (lists.Count > 0)
                {
                    for (int i = 0; i < lists.Count; i++)
                    {
                        if (i == 0)
                        {
                            applyflag = applyflag + lists[i].Value;
                        }
                        else
                        {
                            applyflag = applyflag + "," + lists[i].Value;
                        }
                    }
                }
                hs.Add("applyflag", applyflag);
                if (HidSaveFlag.Value.ToString() == "1")
                {
                    if (CmbStation.SelectedIndex != -1)
                    {
                        hs.Add("station_id", CmbStation.Value);
                    }
                    else
                    {
                        Notice(GetLangStr("TGSStationManager56", "信息提示"), GetLangStr("TGSStationManager60", "请选择监测点名称"));
                        return;
                    }
                    if (CmbDevice.SelectedIndex != -1)
                    {
                        hs.Add("device_id", CmbDevice.Value);
                    }
                    else
                    {
                        Notice(GetLangStr("TGSStationManager56", "信息提示"), GetLangStr("TGSStationManager61", "请选择设备名称"));
                        return;
                    }
                    string Id = tgsPproperty.GetRecordId();
                    hs.Add("id", Id);
                    if (deviceManager.InsertDeviceSetting(hs) > 0)
                    {
                        LedDataBind(" 1=1 and service_id='" + HideServiceId.Value.ToString() + "'");
                        string lblname = "";
                        jcdlx    = CmbStationType.SelectedItem.Text;
                        jcdmc    = CmbStation.SelectedItem.Text;
                        ljdsb    = CmbDevice.SelectedItem.Text;
                        lblname += Bll.Common.AssembleRunLog("", jcdlx, "监测点类型", "0");
                        lblname += Bll.Common.AssembleRunLog("", ljdsb, "连接设备", "0");
                        logManager.InsertLogRunning(uName, "添加:监测点[" + jcdmc + "]" + lblname, nowIp, "1");

                        Notice(GetLangStr("TGSStationManager56", "信息提示"), GetLangStr("TGSStationManager62", "添加成功"));

                        Window4.Hide();
                    }
                }
                if (HidSaveFlag.Value.ToString() == "2")
                {
                    RowSelectionModel sm = this.GridDeviceManager.SelectionModel.Primary as RowSelectionModel;
                    sm.SelectedRow.ToBuilder();
                    string Id   = sm.SelectedRow.RecordID;
                    string ddid = Id;
                    hs.Add("id", Id);
                    if (deviceManager.UptateDeviceSetting(hs) > 0)
                    {
                        Window4.Hide();
                        LedDataBind(" 1=1 and service_id='" + HideServiceId.Value.ToString() + "'");

                        DataRow[] dr = dtsbmc.Select("col0='" + ddid + "'");
                        if (dr.Length > 0)
                        {
                            delName = dr[0]["col3"].ToString();
                        }

                        string ssfxs   = CmbDirection.SelectedItem.Text;
                        string sbtds   = NumChannel.Text;
                        string sfwjsms = CmbIsSacn.SelectedItem.Text;

                        string tpbcljs = TxtImagePath.Text;
                        string bdljips = TxtIpaddress.Text;
                        string bdljdks = NumPort.Text;

                        string sfsys   = CmbIsuse.SelectedItem.Text;
                        string sytrgzs = "";
                        string sygzs   = GetMultiCombo(MulCmbAppFlag.SelectedItems);
                        if (sygzs.Contains(","))
                        {
                            string[] sygz = sygzs.Split(',');
                            for (int i = 0; i < sygz.Length; i++)
                            {
                                DataRow[] dt3 = dtsygz.Select("col0='" + sygz[i] + "'");
                                sytrgzs = sytrgz + "[" + dt3[0]["col1"].ToString() + "]";
                            }
                        }
                        else
                        {
                            DataRow[] dt3 = dtsygz.Select("col0='" + sygzs + "'");
                            sytrgzs = sytrgz + "[" + dt3[0]["col1"].ToString() + "]";
                        }



                        string lblname = "";
                        lblname += Bll.Common.AssembleRunLog(ssfx, ssfxs, "所属方向", "1");
                        lblname += Bll.Common.AssembleRunLog(sbtd, sbtds, "设备通道号", "1");
                        lblname += Bll.Common.AssembleRunLog(sfwjsm, sfwjsms, "是否文件扫描", "1");
                        lblname += Bll.Common.AssembleRunLog(tpbclj, tpbcljs, "图片保存路径", "1");
                        lblname += Bll.Common.AssembleRunLog(bdljip, bdljips, "本地连接ip", "1");
                        lblname += Bll.Common.AssembleRunLog(bdljdk, bdljdks, "本地连接端口", "1");
                        lblname += Bll.Common.AssembleRunLog(sfsy, sfsys, "是否启用", "1");
                        lblname += Bll.Common.AssembleRunLog(sytrgz, sytrgzs, "使用规则", "1");


                        logManager.InsertLogRunning(uName, "修改设备:[" + delName + "];" + lblname, nowIp, "2");
                        Notice(GetLangStr("TGSStationManager56", "信息提示"), GetLangStr("TGSStationManager63", "修改成功"));
                    }
                }
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("TGSStationManager.aspx-UpdateDevice", ex.Message + ";" + ex.StackTrace, "UpdateDevice  has an exception");
            }
        }
        /// <summary>
        ///  更新设备信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void UpdateDevice(object sender, DirectEventArgs e)
        {
            try
            {
                Hashtable hs = new Hashtable();

                hs.Add("device_id", Text_SBBH.Text.ToString());
                hs.Add("device_idext", TxtDeviceIdExt.Text);
                hs.Add("device_name", Text_SBMC.Text.ToString());
                if (Cob_SBLX.SelectedIndex != -1)
                {
                    hs.Add("device_type_id", Cob_SBLX.Value.ToString());
                }
                else
                {
                    NoticeError(GetLangStr("DeviceManager67", "信息错误"), GetLangStr("DeviceManager68", "设备类型未选择"));
                    return;
                }
                if (Cob_SBXH.SelectedIndex != -1)
                {
                    hs.Add("device_mode_id", Cob_SBXH.Value.ToString());
                }
                else
                {
                    NoticeError(GetLangStr("DeviceManager67", "信息错误"), GetLangStr("DeviceManager68", "设备型号未选择"));
                    return;
                }
                hs.Add("ipaddress", Text_IP.Text.ToString());
                hs.Add("port", Text_DK.Text.ToString());
                if (!string.IsNullOrEmpty(Text_TYDS.Text))
                {
                    hs.Add("channels", Text_TYDS.Text.ToString());
                }
                else
                {
                    hs.Add("channels", "0");
                }
                hs.Add("username", Text_YHM.Text.ToString());
                hs.Add("password", Text_MM.Text.ToString());
                hs.Add("createdate", "now()");
                hs.Add("dev_length", Text_Ledth.Text.ToString());
                hs.Add("dev_width", Text_Width.Text.ToString());
                hs.Add("port_num", Text_CKH.Text.ToString());
                hs.Add("port_param", Text_CKCS.Text.ToString());
                hs.Add("protocol_id", CommonExt.IsNullComboBox(Cob_TXXY, ""));
                hs.Add("comm_type_id", CommonExt.IsNullComboBox(Cob_TXLX, ""));
                hs.Add("build_id", CommonExt.IsNullComboBox(Cob_JSDW, ""));
                hs.Add("maintain_company_id", CommonExt.IsNullComboBox(Cob_WHDW, ""));
                hs.Add("make_company_id", CommonExt.IsNullComboBox(Cob_ZZCS, ""));
                hs.Add("isuse", CommonExt.IsNullComboBox(Cob_SFSY, "1"));
                if (deviceManager.UptateDeviceInfo(hs) > 0)
                {
                    if (HidSaveFlag.Value.Equals("1"))
                    {
                        if (CheckSave.Checked)
                        {
                            Window4.Hide();
                        }
                        else
                        {
                            Text_SBMC.Reset();
                            Text_SBBH.Reset();
                            Text_IP.Reset();
                        }
                    }
                    else
                    {
                        Window4.Hide();
                    }
                    if (Cob_SBLX.SelectedIndex != -1)
                    {
                        LedDataBind(" 1=1 and a.device_type_id='" + Cob_SBLX.Value.ToString() + "'");
                    }
                    else
                    {
                        LedDataBind(" 1=1");
                    }

                    if (types == 1)
                    {
                        string sbmcs   = Text_SBMC.Text;
                        string sblxs   = Cob_SBLX.SelectedItem.Text;
                        string kksbs   = Cob_SBXH.SelectedItem.Text;
                        string sfsys   = Cob_SFSY.SelectedItem.Text;
                        string sbips   = Text_IP.Text;
                        string sbdks   = Text_DK.Text;
                        string sbtdss  = Text_TYDS.Text;
                        string wbbhs   = TxtDeviceIdExt.Text;
                        string txlxs   = Cob_TXLX.SelectedItem.Text;
                        string txxys   = Cob_TXXY.SelectedItem.Text;
                        string yhms    = Text_YHM.Text;
                        string mms     = Text_MM.Text;
                        string sbcds   = Text_Ledth.Text;
                        string sbkds   = Text_Width.Text;
                        string ckhs    = Text_CKH.Text;
                        string ckcss   = Text_CKCS.Text;
                        string jsdws   = Cob_JSDW.SelectedItem.Text;
                        string whdws   = Cob_WHDW.SelectedItem.Text;
                        string sbzzss  = Cob_ZZCS.SelectedItem.Text;
                        string lblname = "";

                        lblname += Bll.Common.AssembleRunLog(sblx, sblxs, GetLangStr("DeviceManager2", "设备类型"), "1");
                        lblname += Bll.Common.AssembleRunLog(kksb, kksbs, GetLangStr("DeviceManager71", "卡口设备"), "1");
                        lblname += Bll.Common.AssembleRunLog(sfsy, sfsys, GetLangStr("DeviceManager31", "是否使用"), "1");
                        lblname += Bll.Common.AssembleRunLog(sbip, sbips, GetLangStr("DeviceManager19", "设备Ip"), "1");
                        lblname += Bll.Common.AssembleRunLog(sbdk, sbdks, GetLangStr("DeviceManager20", "设备端口"), "1");
                        lblname += Bll.Common.AssembleRunLog(sbtds, sbtdss, GetLangStr("DeviceManager37", "设备通道数"), "1");
                        lblname += Bll.Common.AssembleRunLog(wbbh, wbbhs, GetLangStr("DeviceManager21", "外部编号"), "1");
                        lblname += Bll.Common.AssembleRunLog(txlx, txlxs, GetLangStr("DeviceManager41", "通讯类型"), "1");
                        lblname += Bll.Common.AssembleRunLog(txxy, txxys, GetLangStr("DeviceManager43", "通讯协议"), "1");
                        lblname += Bll.Common.AssembleRunLog(yhm, yhms, GetLangStr("DeviceManager45", "用户名"), "1");
                        lblname += Bll.Common.AssembleRunLog(mm, mms, GetLangStr("DeviceManager47", "密码"), "1");
                        lblname += Bll.Common.AssembleRunLog(sbcd, sbcds, GetLangStr("DeviceManager49", "设备长度"), "1");
                        lblname += Bll.Common.AssembleRunLog(sbkd, sbkds, GetLangStr("DeviceManager51", "设备宽度"), "1");
                        lblname += Bll.Common.AssembleRunLog(ckh, ckhs, GetLangStr("DeviceManager53", "串口号"), "1");
                        lblname += Bll.Common.AssembleRunLog(ckcs, ckcss, GetLangStr("DeviceManager55", "串口参数"), "1");
                        lblname += Bll.Common.AssembleRunLog(jsdw, jsdws, GetLangStr("DeviceManager58", "建设单位"), "1");
                        lblname += Bll.Common.AssembleRunLog(whdw, whdws, GetLangStr("DeviceManager60", "维护单位"), "1");
                        lblname += Bll.Common.AssembleRunLog(sbzzs, sbzzss, GetLangStr("DeviceManager62", "设备制造商"), "1");
                        logManager.InsertLogRunning(uName, GetLangStr("DeviceManager72", "修改:[") + sbmc + "]" + lblname, nowIp, "2");
                        Notice(GetLangStr("DeviceManager70", "信息提示"), GetLangStr("DeviceManager69", "信息保存成功"));
                        //页面加载方法
                        BuildTree(TreePanel1.Root);
                        TreePanel1.Render();
                        types = 0;
                    }
                    else
                    {
                        InsertLog();
                    }
                }
            }
            catch (Exception ex)
            {
                ILog.WriteErrorLog(ex);
                logManager.InsertLogError("DeviceManager.aspx-UpdateDevice", ex.Message + ";" + ex.StackTrace, "UpdateDevice has an exception");
            }
        }