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);
         }
     }
 }
Пример #2
0
        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);
            }
        }
Пример #3
0
 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);
     }
 }
Пример #4
0
        //新设备录入
        private void Device_Incoming(object sender, RoutedEventArgs e)
        {
            EquipmentClass equitment= new EquipmentClass();
            DataSet set = equitment.comingEquipment();
            if (moveGrid.Children != null) moveGrid.Children.Clear();
            NewEquipment equipments = DeviceMigrationsFactory.NewEquipment;

            equipments.MyEvent += new ClickEventHandler(form2_MyEvent);   
            DeviceMigrationsFactory.NewEquipment.page.ShowPages(DeviceMigrationsFactory.NewEquipment.comingGrild, set, BaseRequest.PAGE_SIZE);
           
            moveGrid.Children.Add(equipments);
            equipments.SetValue(Grid.RowProperty, 0);
            equipments.SetValue(Grid.ColumnProperty, 0);
            
        }