Пример #1
0
        private void buttonCadastrar_Click(object sender, EventArgs e)
        {
            try
            {
                localhost.Loja loja = new localhost.Loja();
                loja.Cnpj         = textBoxCNPJ.Text;
                loja.RazaoSocial  = textBoxRazaoSocial.Text;
                loja.NomeFantasia = textBoxFantasia.Text;
                localhost.Service1 sv         = new localhost.Service1();
                String             retornoMsg = sv.InsertLoja(loja);

                if (retornoMsg == null || "".Equals(retornoMsg))
                {
                    MessageBox.Show("Loja Cadastrada com Sucesso!");
                }
                else
                {
                    MessageBox.Show(retornoMsg);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }