private Video objVideo = null; //定义摄像头操作类 public FrmBookManage() { InitializeComponent(); #region 数据初始化 var categorylist = bookManager.GetAllCategory(); this.cbo_BookCategory.DataSource = bookManager.GetAllCategory(); this.cbo_BookCategory.DisplayMember = "CategoryName"; this.cbo_BookCategory.ValueMember = "CategoryId"; this.cbo_BookCategory.SelectedIndex = -1; //默认不选中 categorylist.Insert(0, new Category() { CategoryId = -1, CategoryName = "" }); this.cboCategory.DataSource = categorylist; this.cboCategory.DisplayMember = "CategoryName"; this.cboCategory.ValueMember = "CategoryId"; // this.cboCategory.SelectedIndex = -1; //默认不选中 this.cbo_Publisher.DataSource = bookManager.GetAllPublisher(); this.cbo_Publisher.DisplayMember = "PublisherName"; this.cbo_Publisher.ValueMember = "PublisherId"; this.cbo_Publisher.SelectedIndex = -1; //默认不选中 this.btnDel.Enabled = false; //禁用拍照 this.btnTake.Enabled = false; this.btnCloseVideo.Enabled = false; this.btnSave.Enabled = false; this.dgvBookList.AutoGenerateColumns = false; DataGridViewStyle.DgvStyle1(this.dgvBookList); #endregion }
public FrmAddBook() { InitializeComponent(); #region 数据初始化 this.cboBookCategory.DataSource = bookManager.GetAllCategory(); this.cboBookCategory.DisplayMember = "CategoryName"; this.cboBookCategory.ValueMember = "CategoryId"; this.cboBookCategory.SelectedIndex = -1; //默认不选中 this.cboPublisher.DataSource = bookManager.GetAllPublisher(); this.cboPublisher.DisplayMember = "PublisherName"; this.cboPublisher.ValueMember = "PublisherId"; this.cboPublisher.SelectedIndex = -1; //默认不选中 //禁用拍照 this.btnTake.Enabled = false; this.btnCloseVideo.Enabled = false; this.dgvBookList.AutoGenerateColumns = false; DataGridViewStyle.DgvStyle1(this.dgvBookList); #endregion }