예제 #1
0
        private void Add_Rooms(object sender, RoutedEventArgs e)
        {
            RoomBean bean = new RoomBean();

            if (this.roomName.Text.Equals(""))
            {
                MessageBox.Show("请输入机房名!");
                return;
            }
            RoomClass rc = new RoomClass();

            bean.RoomName = this.roomName.Text;
            if (!this.belongs.Text.Equals(""))
            {
                bean.Belongs = this.belongs.Text;
            }
            if (!this.purpose.Text.Equals(""))
            {
                bean.Purpose = this.purpose.Text;
            }
            if (!this.floor.Text.Equals(""))
            {
                bean.Floor = this.floor.Text;
            }
            int state = rc.AddRoom(bean);

            if (state == BaseRequest.HAS)
            {
                MessageBox.Show("已存在该机房名!");
            }
            else if (state == BaseRequest.SUCCESS)
            {
                MessageBox.Show("操作成功!");
                this.addRooms.Visibility = Visibility.Hidden;
                RoomManagerBean.AddRoom.page.ShowPages(RoomManagerBean.AddRoom.roomDate, rc.queryRoomsList(), BaseRequest.PAGE_SIZE);
            }
            else
            {
                MessageBox.Show("系统异常,请连管理员!");
            }
        }
예제 #2
0
 private void Add_Rooms(object sender, RoutedEventArgs e)
 {
     RoomBean bean=new RoomBean();
     if (this.roomName.Text.Equals(""))
     {
         MessageBox.Show("请输入机房名!");
         return;
     }
     RoomClass rc = new RoomClass();
     bean.RoomName = this.roomName.Text;
     if (!this.belongs.Text.Equals("")) bean.Belongs = this.belongs.Text;
     if (!this.purpose.Text.Equals("")) bean.Purpose = this.purpose.Text;
     if (!this.floor.Text.Equals("")) bean.Floor = this.floor.Text;
     int state=rc.AddRoom(bean);
     if (state == BaseRequest.HAS) MessageBox.Show("已存在该机房名!");
     else if (state == BaseRequest.SUCCESS)
     {
         MessageBox.Show("操作成功!");
         this.addRooms.Visibility = Visibility.Hidden;
         RoomManagerBean.AddRoom.page.ShowPages(RoomManagerBean.AddRoom.roomDate, rc.queryRoomsList(), BaseRequest.PAGE_SIZE);
     }
     else MessageBox.Show("系统异常,请连管理员!");
 }