コード例 #1
0
        public IActionResult DeleteOrder(int id)
        {
            var rowsDeleted = _oa.DeleteOrder(id);

            return(rowsDeleted >= 1
                ? Ok(new { rowsDeleted })
                : BadRequest(new { rowsDeleted }) as IActionResult);
        }
コード例 #2
0
        public void TestIfDeleteOrderCallsDeleteOrderInRepo()
        {
            // Arrange

            var repo    = new Mock <IOrderRepository>();
            var manager = new OrderAccess(repo.Object);


            // Act

            manager.DeleteOrder(It.IsAny <int>());


            // Assert

            repo.Verify(x => x.DeleteOrder(It.IsAny <int>()), Times.Exactly(1));
        }
コード例 #3
0
 private void lbCancleTicket_Click(object sender, EventArgs e)
 {
     if (indexer != -1)
     {
         DialogResult dr = MessageBox.Show("确定删除景点ID为" + ORId + "订单吗?", "确定", MessageBoxButtons.YesNo);
         if (dr == DialogResult.Yes)
         {
             bool isSuccess = OrderAccess.DeleteOrder(DTId);
             if (isSuccess)
             {
                 MessageBox.Show("景点删除成功");
             }
             DataSet ds = OrderAccess.ShowOrderForDistributor(DTId);
             if (ds != null)
             {
                 dataGridView2.DataSource = ds.Tables[0];
                 this.Refresh();
             }
         }
     }
 }
コード例 #4
0
ファイル: OrderShow.cs プロジェクト: yankun1991/EBooking
 private void label3_Click(object sender, EventArgs e)
 {
     if (indexer != -1)
     {
         DialogResult dr = MessageBox.Show("确定删除?", "确定", MessageBoxButtons.YesNo);
         if (dr == DialogResult.Yes)
         {
             dataGridView1.DataSource = dTable;
             bool isSuccess = OrderAccess.DeleteOrder(TKId);
             if (isSuccess)
             {
                 MessageBox.Show("订单删除成功");
             }
             DataSet ds = OrderAccess.ShowOrder(UserID);
             dataGridView1.DataSource = ds.Tables[0];
             if (ds != null)
             {
                 this.Refresh();
             }
         }
     }
 }