コード例 #1
0
        private void Repair_Click(object sender, RoutedEventArgs e)
        {
            EquipmentClass _Eclass = new EquipmentClass();
            var            a       = this.repairGrid.SelectedItem;
            var            b       = a as DataRowView;
            int            _Eid    = Convert.ToInt32(b.Row[0]);
            MsgResult      r       = JXMessageBox.Show(this, "您需要对此设备进修报修?", "提示", MsgButton.Yes_No_Cancel, MsgImage.Question);

            if (r == MsgResult.OK)
            {
                int state = _Eclass.repairEquipment(_Eid);
                if (state == BaseRequest.SUCCESS)
                {
                    DataSet _Repair_Set = _Eclass.getWorkEquipment();
                    this.page.ShowPages(this.repairGrid, _Repair_Set, BaseRequest.PAGE_SIZE);

                    JXMessageBox.Show(this, "申请报修成功", MsgImage.Success);
                    RepairEquipment repair    = DeviceMigrationsFactory.RepairEquipment;
                    DataSet         repairSet = _Eclass.getRepairEquipment();
                    repair.page.ShowPages(repair.repair_Grid, repairSet, BaseRequest.PAGE_SIZE);
                }
                else
                {
                    JXMessageBox.Show(this, "操作失败!系统异常,请联系管理员!", MsgImage.Error);
                }
            }
        }
コード例 #2
0
        private void Save_Edit(object sender, RoutedEventArgs e)
        {
            ComboBoxItem status = (ComboBoxItem)this.status.SelectedItem;
            UserBean     bean   = new UserBean();
            QueryUser    query  = new QueryUser();

            query.Account  = UserManagerBean.AddUser.queryAccount.Text;
            query.UserName = UserManagerBean.AddUser.queryName.Text;
            bean.Id        = int.Parse(this.userId.Content.ToString());
            bean.UserName  = this.userName.Text;
            bean.Phone     = this.userPhone.Text;
            bean.Status    = int.Parse(status.Tag.ToString());
            bean.Type      = this.userType.SelectedIndex;
            Users user  = new Users();
            int   state = user.saveUserEdit(bean);

            if (state == BaseRequest.SUCCESS)
            {
                JXMessageBox.Show(Window.GetWindow(this), "编辑用信息保存成功!", MsgImage.Success);
                this.Close();
                UserManagerBean.AddUser.page.ShowPages(UserManagerBean.AddUser.userData, user.getUsersList(query), BaseRequest.PAGE_SIZE);
            }
            else if (state == BaseRequest.SYSTEM_EXCEPTION)
            {
                JXMessageBox.Show(Window.GetWindow(this), "系统异常,请联系管理员!", MsgImage.Error);
            }
            else
            {
                JXMessageBox.Show(Window.GetWindow(this), "未知错误", MsgImage.Error);
            }
        }
コード例 #3
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);
            }
        }
コード例 #4
0
        private void SaveEdit_Click(object sender, RoutedEventArgs e)
        {
            ComboBoxItem type = (ComboBoxItem)this.Etype.SelectedItem;

            if (this.Ename.Text.Equals(""))
            {
                JXMessageBox.Show(this, "设备名称不准为空!", MsgImage.Error);
                return;
            }
            if (type.Tag.ToString().Equals(""))
            {
                JXMessageBox.Show(this, "非法操作!", MsgImage.Error);
                return;
            }
            RoomClass rc    = new RoomClass();
            int       state = rc.updateEquipmentInformation(int.Parse(this.ID.Content.ToString()), this.Ename.Text,
                                                            int.Parse(type.Tag.ToString()));

            if (state == BaseRequest.SUCCESS)
            {
                Room           roomBean = RoomManagerBean.Room;
                EquipmentClass ec       = new EquipmentClass();
                DataSet        set      = ec.getEquipmentInformationByRoom(int.Parse(roomBean.roomId.Text));
                roomBean.page.ShowPages(roomBean.roomEquipment, set, BaseRequest.PAGE_SIZE);
                JXMessageBox.Show(this, "编辑信息已保存.", MsgImage.Success);
                this.Close();
            }
            else
            {
                JXMessageBox.Show(this, "保存失败!", MsgImage.Error);
            }
        }
コード例 #5
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);
                }
            }
        }
コード例 #6
0
        private void Delivery_Click(object sender, RoutedEventArgs e)
        {
            EquipmentClass _Eclass = new EquipmentClass();
            var            a       = this.deliveryGrid.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.outRoomEquipment(_Eid);
                if (state == BaseRequest.SUCCESS)
                {
                    DataSet _OutSet = _Eclass.getWorkEquipment();
                    this.page.ShowPages(this.deliveryGrid, _OutSet, BaseRequest.PAGE_SIZE);
                    JXMessageBox.Show(this, "申请出库成功", MsgImage.Success);
                    EquipmentDelivery delivery    = DeviceMigrationsFactory.EquipmentDelivery;
                    DataSet           deliverySet = _Eclass.getDeliverEquipment();
                    delivery.page.ShowPages(delivery.outGird, deliverySet, BaseRequest.PAGE_SIZE);
                }
                else
                {
                    JXMessageBox.Show(this, "操作失败!系统异常,请联系管理员!", MsgImage.Error);
                }
            }
        }
コード例 #7
0
        private void Handle_Click(object sender, RoutedEventArgs e)
        {
            TextRange _Text = new TextRange(this.Information.Document.ContentStart, this.Information.Document.ContentEnd);

            if (_Text.Text.Length > 150)
            {
                JXMessageBox.Show(this, "处理说明只能输入150个字符,请检查!", MsgImage.Error);
                return;
            }
            if (_Text.Text.Length < 3 || _Text.Text.Equals(""))
            {
                JXMessageBox.Show(this, "请输入警报处理说明!", MsgImage.Error);
                return;
            }

            int Aid = int.Parse(this.Aid.Text);

            MessageBox.Show("id>>" + Aid.ToString() + "   _Text.Text=" + _Text.Text);
            RoomClass rc    = new RoomClass();
            int       state = rc.doAlarmInformation(Aid, _Text.Text);

            if (state == BaseRequest.SUCCESS)
            {
                Alarm     alarm      = RoomManagerBean.Alarm;
                RoomClass _Rclass    = new RoomClass();
                DataSet   _Alarm_Set = _Rclass.queryAlarmList();
                alarm.page.ShowPages(alarm.alarmGrid, _Alarm_Set, BaseRequest.PAGE_SIZE);
                JXMessageBox.Show(this, "警报处理完成!", MsgImage.Success);
                this.Close();
            }
            else
            {
                JXMessageBox.Show(this, "系统异常,请联系管理员!", MsgImage.Error);
            }
        }
コード例 #8
0
        private void Move_Click(object sender, RoutedEventArgs e)
        {
            EquipmentClass _Eclass = new EquipmentClass();
            var            a       = this.MoveGrid.SelectedItem;
            var            b       = a as DataRowView;
            int            _Eid    = Convert.ToInt32(b.Row[0]);
            MsgResult      r       = JXMessageBox.Show(this, "您需要对此设备迁移?", "提示", MsgButton.Yes_No_Cancel, MsgImage.Warning);

            //MessageBox.Show(r.ToString());
            if (r == MsgResult.OK)
            {
                int state = _Eclass.moveEquipment(_Eid);
                if (state == BaseRequest.SUCCESS)
                {
                    DataSet _Repair_Set = _Eclass.getWorkEquipment();
                    this.page.ShowPages(this.MoveGrid, _Repair_Set, BaseRequest.PAGE_SIZE);
                    JXMessageBox.Show(this, "申请迁移成功", MsgImage.Success);
                    DeviceMove move    = DeviceMigrationsFactory.DeviceMove;
                    DataSet    moveSet = _Eclass.getMoveEquipment();
                    move.page.ShowPages(move.removeGrid, moveSet, BaseRequest.PAGE_SIZE);
                }
                else
                {
                    JXMessageBox.Show(this, "操作失败!系统异常,请联系管理员!", MsgImage.Error);
                }
            }
        }
コード例 #9
0
        private void Scrapping_Click(object sender, RoutedEventArgs e)
        {
            EquipmentClass _Eclass = new EquipmentClass();
            var            a       = this.scrappingGrid.SelectedItem;
            var            b       = a as DataRowView;
            int            _Eid    = Convert.ToInt32(b.Row[0]);
            MsgResult      r       = JXMessageBox.Show(this, "您需要对此设备进修报修?", "提示", MsgButton.Yes_No_Cancel, MsgImage.Question);

            if (r == MsgResult.OK)
            {
                int state = _Eclass.scrapEquipment(_Eid);
                if (state == BaseRequest.SUCCESS)
                {
                    DataSet _Scrapping_Set = _Eclass.getWorkEquipment();
                    this.page.ShowPages(this.scrappingGrid, _Scrapping_Set, BaseRequest.PAGE_SIZE);

                    JXMessageBox.Show(this, "申请报废成功", MsgImage.Success);
                    EquipmentScrapping scrapping    = DeviceMigrationsFactory.EquipmentScrapping;
                    DataSet            scrappingSet = _Eclass.getScrappingEquipment();
                    scrapping.page.ShowPages(scrapping.scrapGrid, scrappingSet, BaseRequest.PAGE_SIZE);
                }
                else
                {
                    JXMessageBox.Show(this, "操作失败!系统异常,请联系管理员!", MsgImage.Error);
                }
            }
        }
コード例 #10
0
        private void Submit_AddUser(object sender, RoutedEventArgs e)
        {
            if (ValidateUtil.CheckFolderName(this.account.Text) == false)
            {
                JXMessageBox.Show(Window.GetWindow(this), "请填写帐号!", MsgImage.Error);
                return;
            }
            if (ValidateUtil.CheckFolderName(this.userName.Text) == false)
            {
                JXMessageBox.Show(Window.GetWindow(this), "请填写用户姓名!", MsgImage.Error);
                return;
            }
            if (ValidateUtil.CheckPasswordStrength(this.password.Password) == false)
            {
                JXMessageBox.Show(Window.GetWindow(this), "请输入6位以上的密码长度!", MsgImage.Error);
                return;
            }

            if (!this.password.Password.Equals(this.password2.Password))
            {
                JXMessageBox.Show(Window.GetWindow(this), "输入密码不一致,请重新输入!", MsgImage.Error);
                return;
            }
            Users     u     = new Users();
            UserBean  bean  = new UserBean();
            QueryUser query = new QueryUser();

            query.Account   = UserManagerBean.AddUser.queryAccount.Text;
            query.UserName  = UserManagerBean.AddUser.queryName.Text;
            bean.Account    = this.account.Text;
            bean.UserName   = this.userName.Text;
            bean.Password   = this.password.Password;
            bean.Status     = 0;
            bean.CreateId   = Session.UserId;
            bean.CreateTime = Convert.ToDateTime(DateTime.Now);
            bean.Phone      = this.phone.Text;
            ComboBoxItem type = (ComboBoxItem)this.userType.SelectedItem;

            bean.Type = int.Parse(type.Tag.ToString());
            int    state = u.registUser(bean);
            Window targe = Window.GetWindow(this);

            if (state == BaseRequest.HAS)
            {
                JXMessageBox.Show(Window.GetWindow(this), "该账号已被使用!", MsgImage.Error);
            }
            else if (state == BaseRequest.SUCCESS)
            {
                JXMessageBox.Show(Window.GetWindow(this), "新增用户成功!", MsgImage.Error);
                UserManagerBean.AddUser.page.ShowPages(UserManagerBean.AddUser.userData, u.getUsersList(query), BaseRequest.PAGE_SIZE);
                this.Close();
            }
            else
            {
                JXMessageBox.Show(Window.GetWindow(this), "系统异常,请联系管理员!", MsgImage.Error);
            }
        }
コード例 #11
0
        private void Ignore_Alarm(object sender, RoutedEventArgs e)
        {
            string    msg = "您确定忽略该条报警?";
            MsgResult r   = JXMessageBox.Show(Window.GetWindow(this), msg, "提示", MsgButton.Yes_No_Cancel, MsgImage.Exclamation);

            if (r == MsgResult.Yes)
            {
                JXMessageBox.Show(Window.GetWindow(this), "点击确定", MsgImage.Warning);
            }
        }
コード例 #12
0
        //退出系统
        private void exitSystem(object sender, RoutedEventArgs e)
        {
            MsgResult r = JXMessageBox.Show(this, "您是否要退出系统?", "提示", MsgButton.Yes_No_Cancel, MsgImage.Exclamation);

            if (r == MsgResult.OK)
            {
                Session.UserId      = 0;
                Session.UserAccount = null;
                Session.LogId       = 0;
                Session.LoginTime   = null;
                roomgrid.Children.Clear();
                this.Close();
            }
        }
コード例 #13
0
        private void Submit_Add(object sender, RoutedEventArgs e)
        {
            DeviceBean     bean       = new DeviceBean();
            EquipmentClass equipClass = new EquipmentClass();

            bean.Id = int.Parse(this.ID.Content.ToString());
            ComboBoxItem typeItem = (ComboBoxItem)this.typeBox.SelectedItem;
            ComboBoxItem roomItem = (ComboBoxItem)this.roomBox.SelectedItem;

            if (typeItem.Tag.ToString().Equals(""))
            {
                MessageBox.Show("请选择设备类别!");
                return;
            }
            if (this.equipName.Text.Equals("") || this.equipName.Text == null)
            {
                MessageBox.Show("请输入设备名称!");
                return;
            }
            if (roomItem.Tag.ToString().Equals(""))
            {
                MessageBox.Show("请选择设备所属机房!");
                return;
            }
            int state = 0;

            this.add.IsEnabled = false;
            bean.Name          = this.equipName.Text;
            bean.RoomId        = (int)roomItem.Tag;
            bean.Type          = (int)typeItem.Tag;
            bean.Id            = int.Parse(this.ID.Content.ToString());
            bean.EPCCode       = this.numberStr.Text;
            state = equipClass.addEquipment(bean, this);
            this.add.IsEnabled = true;
            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);
                //Close_Add(DeviceMigrationsFactory.AddEquipment, new RoutedEventArgs());
            }
            else
            {
                JXMessageBox.Show(Window.GetWindow(this), "未知错误,请联系管理员!", MsgImage.Error);
            }
        }
コード例 #14
0
        /************************************************************************/
        /*写入标签方法                                                                      */
        /************************************************************************/
        public int WritertEPC(string _EpcStr, Window win)
        {
            Gen2TagFilter filter = null;

            byte[] filterbytes = new byte[(_EpcStr.Length - 1) / 8 + 1];
            for (int c = 0; c < filterbytes.Length; ++c)
            {
                filterbytes[c] = 0;
            }

            int bitcnt = 0;

            foreach (Char ch in _EpcStr.Trim())
            {
                if (ch == '1')
                {
                    filterbytes[bitcnt / 8] |= (byte)(0x01 << (7 - bitcnt % 8));
                }
                bitcnt++;
            }
            //modulerdr.ParamSet("AccessPassword", (uint)0);

            if (IsValidHexstr(_EpcStr.Trim(), 600) != 0)
            {
                JXMessageBox.Show(win, "将要写入的数据是16进制的字符,且长度为4字符的整数倍", MsgImage.Error);
                return(BaseRequest.ERROR);
            }
            try
            {
                modulerdr.WriteTag(filter, new TagData(_EpcStr.Trim()));
                JXMessageBox.Show(win, "写入标签成功!", MsgImage.Success);
            }
            catch (Exception ex)
            {
                JXMessageBox.Show(win, "写入标签失败,请检查设备是否正常状态!", MsgImage.Error);
                return(BaseRequest.ERROR);
            }
            if (modulerdr != null)
            {
                modulerdr.Disconnect();
            }

            return(BaseRequest.SUCCESS);
        }
コード例 #15
0
        private void Add_Type(object sender, RoutedEventArgs e)
        {
            string    type  = this.typeName.Text;
            RoomClass rc    = new RoomClass();
            int       state = rc.addType(type);

            if (state == BaseRequest.SUCCESS)
            {
                JXMessageBox.Show(this, "添加类别成功!", MsgImage.Success);
                RoomManagerBean.DeviceClass.page.ShowPages(RoomManagerBean.DeviceClass.deviceData, rc.queryType(), BaseRequest.PAGE_SIZE);
                this.Close();
            }
            else if (state == BaseRequest.HAS)
            {
                JXMessageBox.Show(this, "已有该类别!", MsgImage.Error);
            }
            else
            {
                JXMessageBox.Show(this, "未知错误,请联系管理员!", MsgImage.Error);
            }
        }
コード例 #16
0
        private void submit_Change(object sender, RoutedEventArgs e)
        {
            string oldPaw  = this.password.Password;
            string newPaw  = this.newPassword.Password;
            string newPaw2 = this.newPassword2.Password;

            if (ValidateUtil.CheckFolderName(oldPaw) == false)
            {
                JXMessageBox.Show(Window.GetWindow(this), "请输入密码!", MsgImage.Error);
                return;
            }
            if (ValidateUtil.CheckFolderName(newPaw) == false)
            {
                JXMessageBox.Show(Window.GetWindow(this), "请输入6位以上的密码!", MsgImage.Error);
                return;
            }
            if (!newPaw.Equals(newPaw2))
            {
                JXMessageBox.Show(Window.GetWindow(this), "输入新密码不一致!", MsgImage.Error);
                return;
            }
            Users user  = new Users();
            int   state = user.ChangeUserPassword(oldPaw, newPaw);

            if (state == BaseRequest.PASSWORD_ERROR)
            {
                JXMessageBox.Show(Window.GetWindow(this), "旧密码不正确!", MsgImage.Error);
            }
            else if (state == BaseRequest.SYSTEM_EXCEPTION)
            {
                JXMessageBox.Show(Window.GetWindow(this), "系统异常,请联系管理员!", MsgImage.Error);
            }
            else
            {
                JXMessageBox.Show(Window.GetWindow(this), "修改密码成功!", MsgImage.Success);
            }
        }
コード例 #17
0
        private void Edit_DeviceClass(object sender, RoutedEventArgs e)
        {
            int    id   = (int)this.id.Content;
            string name = this.typeName.Text;

            if (name.Equals(""))
            {
                JXMessageBox.Show(this, "请输入类别名称!", MsgImage.Error);
                return;
            }
            RoomClass rc    = new RoomClass();
            int       state = rc.saveEditType(id, name);

            if (state == BaseRequest.SUCCESS)
            {
                JXMessageBox.Show(this, "编辑设备类别信息成功!", MsgImage.Success);
                RoomManagerBean.DeviceClass.page.ShowPages(RoomManagerBean.DeviceClass.deviceData, rc.queryType(), BaseRequest.PAGE_SIZE);
                this.Close();
            }
            else
            {
                JXMessageBox.Show(this, "未知错误,请联系管理员!", MsgImage.Error);
            }
        }
コード例 #18
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (this.reportWord.IsChecked == true)
            {
                sfd        = new Microsoft.Win32.SaveFileDialog();
                sfd.Filter = "Word文件(*.doc)|*.doc";
                sfd.ShowDialog();

                this.pathText.Text = sfd.FileName;
            }
            else if (this.reportExcel.IsChecked == true)
            {
                sfd        = new Microsoft.Win32.SaveFileDialog();
                sfd.Filter = "Excel文件(*.xls)|*.xls";
                sfd.ShowDialog();
                this.pathText.Text = sfd.FileName;
            }
            else if (this.reportPdf.IsChecked == true)
            {
                sfd        = new Microsoft.Win32.SaveFileDialog();
                sfd.Filter = "PDF文件(*.pdf)|*.pdf";
                sfd.ShowDialog();
                this.pathText.Text = sfd.FileName;
            }
            else if (this.reportHtml.IsChecked == true)
            {
                sfd        = new Microsoft.Win32.SaveFileDialog();
                sfd.Filter = "Html文件(*.Html)|*.Html";
                sfd.ShowDialog();
                this.pathText.Text = sfd.FileName;
            }
            else
            {
                JXMessageBox.Show(this, "请选择导出文件格式!", MsgImage.Error);
            }
        }
コード例 #19
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);
            }
        }
コード例 #20
0
        private void Report_Click(object sender, RoutedEventArgs e)
        {
            if (this.pathText.Text.Equals(""))
            {
                JXMessageBox.Show(this, "文件名与保存路径不能为空!", MsgImage.Error);
                return;
            }
            bool     b    = false;
            FileBean bean = new FileBean();

            if (this.reportWord.IsChecked == true)
            {
                bean.FontSize = int.Parse(this.wordfont.Text);
                bean.Color    = this.wordColor.Background;
                bean.Width    = int.Parse(this.wordWidth.Text);
                bean.Height   = int.Parse(this.wordHeight.Text);
            }
            else if (this.reportExcel.IsChecked == true)
            {
                //bean.FontSize = int.Parse(this.excelFont.Text);
                //bean.Color = this.ExcelColor.Background;
                //bean.Width = int.Parse(this.excelWidth.Text);
                //bean.Height = int.Parse(this.excelHeight.Text);
                string    path    = @"" + this.pathText.Text;
                RoomClass rc      = new RoomClass();
                DataSet   dataSet = rc.queryHistoryAlarmList();
                b = ExportFile.DataSetToExcel(path);
            }
            else if (this.reportPdf.IsChecked == true)
            {
                //bean.FontSize = int.Parse(this.pdfFont.Text);
                float fontSize = float.Parse(this.pdfFont.Text);
                //bean.Color = this.pdfColor.Background;
                Brush color = this.pdfColor.Background;
                //bean.Width = int.Parse(this.pdfWidh.Text);
                //bean.Height = int.Parse(this.pdfheight.Text);
                string title = "历史报警表";
                string path  = @"" + this.pathText.Text;

                // RoomClass rc = new RoomClass();
                DataSet dataSet = MySqlHelper.GetDataSet(MySqlHelper.Conn, CommandType.Text, ExportFileSql.sql);
                b = ExportFile.ConvertDataTableToPDF(dataSet.Tables[0], path, title, color, fontSize, null);
            }
            else if (this.reportHtml.IsChecked == true)
            {
                //bean.FontSize = int.Parse(this.htmlFont.Text);
                // bean.Color = this.htmlColor.Background;
                // bean.Width = int.Parse(this.htmlWidth.Text);
                //string fontColor = this.htmlColor.Background.ToString();
                //System.Windows.MessageBox.Show(fontColor);
                string path = @"" + this.pathText.Text;
                //bean.Height = int.Parse(this.htmlHeight.Text);
                //RoomClass rc = new RoomClass();
                DataSet dataSet = MySqlHelper.GetDataSet(MySqlHelper.Conn, CommandType.Text, ExportFileSql.sql);
                string  title   = "历史报警数据";
                b = ExportFile.MakeHtml(path, dataSet, title, this.htmlColor.Background, int.Parse(this.htmlFont.Text));
            }
            if (b == true)
            {
                JXMessageBox.Show(this, "文件成功导出!", MsgImage.Success);
            }
            else
            {
                JXMessageBox.Show(this, "文件导出失败!", MsgImage.Error);
            }
        }