Example #1
0
        private void bt_Station_Save_Click(object sender, EventArgs e)
        {
            string strJHJEle = "";

            if (!CheckingStation())
            {
                return;
            }

            //判断系统中该安装位置是否存在

            int intImpactCounts = 0;
            int intStationModel = 1;

            if (rb_V2.Checked)
            {
                intStationModel = 2;
            }
            else if (rb_CheckCard.Checked)
            {
                intStationModel = 3;
            }

            #region 【Czlt-2011-11-22 交换机关联传输分站】
            if (chkJHJEle.Checked)
            {
                strJHJEle = "1";
            }
            else
            {
                strJHJEle = "";
            }

            #endregion


            if (intStationAddress == -1)       //新增
            {
                //intImpactCounts = sbll.SaveStationInfo(Convert.ToInt32(txt_StationAddress.Text), txt_StationPlace.Text, txt_StationTel.Text,
                //    -1000, "通用接收器", int.Parse(cmb_StationPacket.Text.ToString()), intStationModel);
                intImpactCounts = sbll.SaveStationInfo(Convert.ToInt32(txt_StationAddress.Text), txt_StationPlace.Text, strJHJEle,
                                                       2000, "通用接收器", int.Parse(cmb_StationPacket.Text.ToString()), intStationModel);
                if (intImpactCounts > 0)
                {
                    SetTipsInfo(true, " 保存成功!");
                    frmSi.IsSave = true;
                    //存入日志
                    LogSave.Messages("[A_FrmStationInfo]", LogIDType.UserLogID, "添加新分站,分站编号:" + txt_StationAddress.Text + ",安装位置:" + txt_StationPlace.Text);


                    //Czlt-2011-12-10 修改日期
                    sbll.UpdateTime();
                    if (!New_DBAcess.IsDouble)
                    {
                        frmSi.InitData();             // 重新加载
                    }
                    else
                    {
                        frmSi.intSelectModel = 1;
                        frmSi.HostBackRefresh(true);
                    }
                }
                else
                {
                    SetTipsInfo(false, " 保存失败!");
                }
            }
            else                                                           //修改
            {
                if (stationState.Trim().Equals(""))
                {
                    stationState = "2000";
                }

                //intImpactCounts = sbll.UpdateStationInfo(Convert.ToInt32(txt_StationAddress.Text), txt_StationPlace.Text, txt_StationTel.Text,
                //    -1000, "通用接收器", int.Parse(cmb_StationPacket.Text.ToString()), intStationModel);
                intImpactCounts = sbll.UpdateStationInfo(Convert.ToInt32(txt_StationAddress.Text), txt_StationPlace.Text, strJHJEle,
                                                         Convert.ToInt32(stationState), "通用接收器", int.Parse(cmb_StationPacket.Text.ToString()), intStationModel);
                if (intImpactCounts > 0)
                {
                    //Czlt-2011-12-10 修改日期
                    sbll.UpdateTime();

                    SetTipsInfo(true, " 修改成功!");
                    frmSi.IsSave = true;
                    //存入日志
                    LogSave.Messages("[A_FrmStationInfo]", LogIDType.UserLogID, "修改分站,分站编号:" + txt_StationAddress.Text + ",安装位置:" + txt_StationPlace.Text);

                    if (!New_DBAcess.IsDouble)
                    {
                        frmSi.InitData();             // 重新加载
                    }
                    else
                    {
                        frmSi.intSelectModel = 1;
                        frmSi.HostBackRefresh(true);
                    }
                }
                else
                {
                    SetTipsInfo(false, " 修改失败!");
                }
            }
        }