Ejemplo n.º 1
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);
     }
 }
Ejemplo n.º 2
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);
            }
        }