コード例 #1
0
 private void btnRemoveInput_Click(object sender, EventArgs e)
 {
     if (txtAllProductInputName.Text != string.Empty)
     {
         string       masseage = "Bạn có muốn xóa không ?";
         string       Title    = "Chú ý";
         DialogResult result   = MessageBox.Show(masseage, Title, MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
         if (result == DialogResult.Yes)
         {
             int ID = productIBO.GetIDByName(txtAllProductInputName.Text);
             productIBO.Delete(ID);
             loadInformation();
         }
     }
 }
コード例 #2
0
        public IActionResult Delete(long id)
        {
            ProductBO    productBO;
            ObjectResult response;

            try
            {
                _log.LogInformation($"Starting Delete( {id} )");

                productBO = new ProductBO(_loggerFactory, _config);
                productBO.Delete(id);

                response = Ok(string.Empty);

                _log.LogInformation($"Finishing Delete( {id} )");
            }
            catch (Exception ex)
            {
                _log.LogError(ex.Message);
                response = StatusCode(500, ex.Message);
            }

            return(response);
        }
コード例 #3
0
 /// <summary>
 /// Delete a product associated with the code.
 /// </summary>
 /// <param name="code">The product code</param>
 /// <returns>Returns a bool indicating if the operation was completed as expected or not</returns>
 public bool Delete(string code)
 {
     return(productBO.Delete(code));
 }