Exemplo n.º 1
0
        public IHttpActionResult Delete(Customer customer)
        {
            var mng = new CustomerManagement();

            mng.Delete(customer);

            apiResp         = new ApiResponse();
            apiResp.Message = "Action was excecuted";

            return(Ok(apiResp));
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            int id = Convert.ToInt32(findID.Text);

            try
            {
                CM.Delete(id);
                clear();
                msg.Text = "";
            }
            catch (Exception er) {
                msg.Text = "Erro Cannot Find ID " + id;
            }
        }
Exemplo n.º 3
0
        private void BtnDeleteCustomer_Click(object sender, EventArgs e)
        {
            try
            {
                cx.Id = txtCustomerId.Text.ToString();

                mng.Delete(cx);

                MessageBox.Show("Customer Deleted ");
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Please delete the credits,addresses,accounts associated " + ex.ToString());
            }
        }
Exemplo n.º 4
0
 private void button25_Click(object sender, EventArgs e)
 {
     try
     {
         int cid = Convert.ToInt32(bcust_id.Text);
         TotalBill = 0;
         orm.DeleteByCustomer(cid);
         rtm.DeleteByCustomer(cid);
         cm.Delete(cid);
         MessageBox.Show("Customer ID-" + cid + " Checked Out !");
     }
     catch (Exception err) {
         MessageBox.Show(err.Message.ToString());
     }
     clear();
 }
Exemplo n.º 5
0
        //// DELETE: api/Customer/5
        public IHttpActionResult Delete(string id)
        {
            try
            {
                var cxMng = new CustomerManagement();

                var customer = new Customer
                {
                    Id = id
                };

                cxMng.Delete(customer);

                apiResponse = new ApiResponse();

                apiResponse.Message = "Customer Deleted";

                return(Ok(apiResponse));
            }
            catch (BusinessException bex)
            {
                return(InternalServerError(new Exception(bex.ExceptionId + "--" + bex.AppMessage.Message)));
            }
        }