コード例 #1
0
 public ActionResult Delete(string Id)
 {
     if (_warehouseService.DeleteWarehouse(Id))
     {
         return(new HttpStatusCodeResult(System.Net.HttpStatusCode.OK));
     }
     return(new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest));
 }
コード例 #2
0
        private void tsbtnDelete_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("确认删除吗?", "删除提示", MessageBoxButtons.OKCancel) == DialogResult.OK)
            {
                var warehouse = this.dataGridViewX1.CurrentRow.DataBoundItem as Warehouse;

                WarehouseService.DeleteWarehouse(warehouse.Id);
                LoadData();
            }
        }
コード例 #3
0
 // DELETE: odata/Warehouse(5)
 public IHttpActionResult Delete(Guid key)
 {
     // TODO: Add delete logic here.
     using (var unitOfWork = _unitOfWorkManager.NewUnitOfWork())
     {
         _warehouse.DeleteWarehouse(key);
         unitOfWork.Commit();
     }
     return(StatusCode(HttpStatusCode.OK));
     //return StatusCode(HttpStatusCode.NotImplemented);
 }
コード例 #4
0
        public async Task <ActionResult> DeleteWarehouse(Guid id)
        {
            var username = User.Claims.FirstOrDefault(x => x.Type == "FullName").Value;

            if (await DB.CatalogDB.AnyAsync(x => x.WarehouseId == id))
            {
                return(BadRequest(new { message = "Noliktava vēl ir produkti." }));
            }
            // Calling method that will delete warehouse from DB
            await WarehouseService.DeleteWarehouse(id, username);

            // Returning filtered warehouse list
            return(Ok());
        }
コード例 #5
0
 protected void lnbDelete_Click(object sender, EventArgs e)
 {
     try
     {
         int[] id = WebFormHelper.GetRowIdForDeletion(gvwMaster);
         Array.ForEach(id, wh => WarehouseService.DeleteWarehouse(wh));
         ReloadCurrentPage();
     }
     catch (Exception ex)
     {
         WebFormHelper.SetLabelTextWithCssClass(
             lblMessage,
             ex.Message,
             LabelStyleNames.ErrorMessage);
         LogService.ErrorException(GetType().FullName, ex);
     }
 }