private void Save_Edit(object sender, RoutedEventArgs e)
        {
            if (this.Ename.Equals(""))
            {
                JXMessageBox.Show(this, "设备名称不能为空!", MsgImage.Error);
                return;
            }
            int            _Eid     = int.Parse(this.ID.Content.ToString());
            string         name     = this.Ename.Text;
            ComboBoxItem   roomItem = (ComboBoxItem)this.roomBox.SelectedItem;
            int            roomId   = (int)roomItem.Tag;
            EquipmentClass _Edit    = new EquipmentClass();
            int            state    = _Edit.saveEditEquipment(_Eid, name, roomId);

            if (state == BaseRequest.SUCCESS)
            {
                EquipmentClass equitment  = new EquipmentClass();
                DataSet        set        = equitment.comingEquipment();
                NewEquipment   equipments = DeviceMigrationsFactory.NewEquipment;
                DeviceMigrationsFactory.NewEquipment.page.ShowPages(DeviceMigrationsFactory.NewEquipment.comingGrild, set, BaseRequest.PAGE_SIZE);

                JXMessageBox.Show(this, "编辑成功!", MsgImage.Success);

                this.Close();
            }
            else
            {
                JXMessageBox.Show(this, "错误,请检查您是否正确操作!", MsgImage.Error);
            }
        }
Exemple #2
0
        private void RpairCom_Click(object sender, RoutedEventArgs e)
        {
            EquipmentClass _Eclass = new EquipmentClass();
            var            a       = this.repair_Grid.SelectedItem;
            var            b       = a as DataRowView;
            int            _Eid    = Convert.ToInt32(b.Row[0]);
            MsgResult      r       = JXMessageBox.Show(this, "您需要对此设备申请入库?", "提示", MsgButton.Yes_No_Cancel, MsgImage.Exclamation);

            //MessageBox.Show(r.ToString());
            if (r == MsgResult.OK)
            {
                int state = _Eclass.repairEquipmentComing(_Eid);
                if (state == BaseRequest.SUCCESS)
                {
                    DataSet set = _Eclass.getRepairEquipmentList();
                    this.page.ShowPages(this.repair_Grid, set, BaseRequest.PAGE_SIZE);
                    JXMessageBox.Show(this, "申请出库成功", MsgImage.Success);
                    NewEquipment newEquipment = DeviceMigrationsFactory.NewEquipment;
                    DataSet      deliverySet  = _Eclass.comingEquipment();
                    newEquipment.page.ShowPages(newEquipment.comingGrild, deliverySet, BaseRequest.PAGE_SIZE);
                }
                else
                {
                    JXMessageBox.Show(this, "操作失败!系统异常,请联系管理员!", MsgImage.Error);
                }
            }
        }
        private void button1_Click(object sender, RoutedEventArgs e)//取消按钮
        {
            NewEquipment s1 = DeviceMigrationsFactory.NewEquipment;

            if (s1.addequipment.Children.Contains(addusetrol))
            {
                addusetrol.FurnitureContainer2.Children.Clear();
                s1.addequipment.Children.Remove(addusetrol);
            }
        }
        private void button2_Click(object sender, RoutedEventArgs e)
        {
            Getxmal xmal = new Getxmal("2.xml");

            //这里需要判断放的位置是否能满足要求
            MessageBox.Show(position);

            for (int i = 0; i <= aservertype; i++)
            {
                if (servercabinet.usize[aposition - 1 + i] == "1")
                {
                    MessageBox.Show("此位置已被占用");
                    return;
                }
            }
            if (servercabinet.usize[aposition - 2] == "1")
            {
                MessageBox.Show("此位置已被占用");
                return;
            }

            if (servercabinet.usize[aposition + aservertype - 1] == "1")
            {
                MessageBox.Show("此位置已被占用");
                return;
            }
            MessageBox.Show(rfid);
            xmal.addnode(RFID, rfid, position, servertype);

            string sql = "UPDATE equipment  SET Position='" + @position + "' WHERE ID=" + @rfid;

            MySqlParameter[] _Parameters =
            {
                new MySqlParameter("@position", position),
                new MySqlParameter("@rfid",     rfid)
            };
            MySqlHelper.ExecuteNonQuery(MySqlHelper.Conn, CommandType.Text, sql, _Parameters);
            NewEquipment s1 = DeviceMigrationsFactory.NewEquipment;
            OldEquipment s2 = DeviceMigrationsFactory.OldEquipment;

            s2.grid.Children.Remove(addserver);
            s2.FurnitureContainer2.Children.Clear();
            s1.addequipment.Children.Remove(s2);
            MyEvent();
        }
        private void Submit_Add_Click(object sender, RoutedEventArgs e)
        {
            ComboBoxItem antennaNum = (ComboBoxItem)this.antennaNum.SelectedItem;
            ComboBoxItem typeItem   = (ComboBoxItem)this.type.SelectedItem;
            ComboBoxItem room       = (ComboBoxItem)this.roomBox.SelectedItem;

            if (this.number.Text.Equals(""))
            {
                JXMessageBox.Show(Window.GetWindow(this), "非法操作!", MsgImage.Error);
                return;
            }
            if (this.name.Text.Equals(""))
            {
                JXMessageBox.Show(Window.GetWindow(this), "请输入读写器名称!", MsgImage.Error);
                return;
            }
            if (this.ip.Text.Equals(""))
            {
                JXMessageBox.Show(Window.GetWindow(this), "请输入读写器IP!", MsgImage.Error);
                return;
            }
            if (this.port.Text.Equals(""))
            {
                JXMessageBox.Show(Window.GetWindow(this), "请输入读写器端口!", MsgImage.Error);
                return;
            }
            if ("".Equals(antennaNum.Tag.ToString()))
            {
                JXMessageBox.Show(Window.GetWindow(this), "请选择读写器支持天线数目!", MsgImage.Error);
                return;
            }
            if ("".Equals(typeItem.Tag.ToString()))
            {
                JXMessageBox.Show(Window.GetWindow(this), "请选择读写器的类别!", MsgImage.Error);
                return;
            }
            if (this.time.Text.Equals(""))
            {
                JXMessageBox.Show(Window.GetWindow(this), "请填写读写器扫描时间间隔!", MsgImage.Error);
                return;
            }
            if (room.Tag.ToString().Equals(""))
            {
                JXMessageBox.Show(Window.GetWindow(this), "请选择所在机房!", MsgImage.Error);
                return;
            }
            WriterReaderBean bean = new WriterReaderBean();

            bean.Id         = int.Parse(this.number.Text.ToString());
            bean.Number     = int.Parse(this.number.Text.ToString());
            bean.Name       = this.name.Text;
            bean.Ip         = this.ip.Text;
            bean.Port       = int.Parse(this.port.Text);
            bean.AntennaSum = int.Parse(antennaNum.Tag.ToString());
            bean.Type       = int.Parse(typeItem.Tag.ToString());
            bean.SweepTime  = int.Parse(this.time.Text);
            bean.RoomId     = int.Parse(room.Tag.ToString());
            bean.EpcCode    = this.numberStr.Text;
            EquipmentClass ec    = new EquipmentClass();
            int            state = ec.insertWriterReader(bean, this);

            if (state == BaseRequest.SUCCESS)
            {
                EquipmentClass equitment  = new EquipmentClass();
                DataSet        set        = equitment.comingEquipment();
                NewEquipment   equipments = DeviceMigrationsFactory.NewEquipment;
                DeviceMigrationsFactory.NewEquipment.page.ShowPages(DeviceMigrationsFactory.NewEquipment.comingGrild, set, BaseRequest.PAGE_SIZE);

                JXMessageBox.Show(Window.GetWindow(this), "已成功录入读写器信息!", MsgImage.Success);
                this.Close();
            }
            else
            {
                JXMessageBox.Show(Window.GetWindow(this), "未知错误,请联系管理员!", MsgImage.Error);
            }
        }