public void MoveCatalogTest() { int maxId = -1; foreach (CreateCatalogList i in createCatalogBll.GetMoveCatalog()) { if (i.Id > maxId) { maxId = i.Id; } } if (maxId != -1) { Assert.AreEqual(true, createCatalogBll.MoveCatalog(maxId)); } Assert.AreEqual(false, createCatalogBll.MoveCatalog(-1)); }
private void moveBtn_Click(object sender, EventArgs e) { try { DialogResult dialogResult = MessageBox.Show("是否入库", "入库确认", MessageBoxButtons.YesNoCancel); //设置弹出窗体的格式 if (dialogResult == DialogResult.Yes) //如果选择确认按钮 { if (createCatalogBll.MoveCatalog(getMoveCatalogId())) //调用全部入库方法 { MessageBox.Show("入库成功"); } else { MessageBox.Show("入库失败"); } } } catch (Exception ex) { MessageBox.Show(ex.Message); } DataBind();//数据绑定 }