Exemplo n.º 1
0
        public bool DeleteSupplier(int supId)
        {
            ISupplierBL _supplierBL = new SupplierBL();

            return(_supplierBL.DeleteSupplier(supId));
            //return false;
        }
Exemplo n.º 2
0
        private void mnuGridEliminar_Click(object sender, EventArgs e)
        {
            OperationResult objOperationResult = new OperationResult();
            // Obtener los IDs de la fila seleccionada

            DialogResult Result = MessageBox.Show("¿Está seguro de eliminar este registro?:" + System.Environment.NewLine + objOperationResult.ExceptionMessage, "ADVERTENCIA!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (Result == System.Windows.Forms.DialogResult.Yes)
            {
                // Delete the item
                string pstrSupplierId = grdData.Selected.Rows[0].Cells[0].Value.ToString();


                _objBL.DeleteSupplier(ref objOperationResult, pstrSupplierId, Globals.ClientSession.GetAsList());

                btnFilter_Click(sender, e);
            }
        }
        // DELETE: api/Unit/5
        public ServerResponse Delete(string id)
        {
            var res = new ServerResponse();

            using (SupplierBL SupplierBL = new SupplierBL())
            {
                try
                {
                    res.Data = SupplierBL.DeleteSupplier(id);
                }

                catch (Exception ex)
                {
                    res.Success = false;
                }
            }
            return(res);
        }
Exemplo n.º 4
0
        public IHttpActionResult Delete(IdModel id)
        {
            SupplierResponse response = new SupplierResponse();

            try
            {
                bool success = supplierBL.DeleteSupplier(id.Id);
                response.Success = success;
            }
            catch (SupplierException ex)
            {
                response.ErrorCode    = ex.Error;
                response.ErrorMessage = "Error. " + ex.Error.ToString();
                response.Supplier     = null;
                response.Success      = false;
            }
            catch (Exception ex)
            {
                response.ErrorMessage = "Error. " + ex.Message;
                response.Supplier     = null;
                response.Success      = false;
            }
            return(Ok(response));
        }