Пример #1
0
        private void btnExcluirAnimal_Click(object sender, EventArgs e)
        {
            if (metroGrid1.RowCount >= 1)
            {
                if (txtId.Text == "NOVO")
                {
                    return;
                }

                if (metroGrid1.CurrentRow.Cells[4].Value.ToString() == "")
                {
                    return;
                }

                if (MetroFramework.MetroMessageBox.Show(this, "Tem certeza que deseja excluir o item: " + metroGrid1.CurrentRow.Cells[0].Value.ToString(), "Excluir ?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }

                WebServiceMarfrigSoapClient wbClinet = null;

                try
                {
                    wbClinet = new WebServiceMarfrigSoapClient();
                    wbClinet.DeleteCompraGadoItem(Convert.ToInt32(metroGrid1.CurrentRow.Cells[4].Value.ToString()));

                    getAllCompraGadoItem(Convert.ToInt32(txtId.Text));
                }
                catch (Exception ex)
                {
                    MetroFramework.MetroMessageBox.Show(this, ex.Message, "Erro", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Пример #2
0
        public void TestDeleteCompraGadoItem()
        {
            bool resultado = wbClinet.DeleteCompraGadoItem(1);

            Assert.AreEqual(true, resultado);
        }