Exemple #1
0
        protected void btnSalvar_Click(object sender, EventArgs e)
        {
            EquipamentoVO equipamento = new EquipamentoVO();

            equipamento.Nome         = TxtNome.Text;
            equipamento.Valor        = Convert.ToDecimal(TxtValor.Text);
            equipamento.DataCadastro = Convert.ToDateTime(TxtDataCadastro.Text);

            service = new ServiceWCF.ServicoClient();
            if (service.Inserir(equipamento))
            {
                LblMSG.Text = "Registro Inserido!";
                CarregarGrid();
            }
            else
            {
                LblMSG.ForeColor = System.Drawing.Color.Red;
                LblMSG.Text      = "Erro ao Inserir registro";
            }
        }
Exemple #2
0
 private void CarregarGrid()
 {
     service = new ServiceWCF.ServicoClient();
     GVEquipamento.DataSource = service.Selecionar();
     GVEquipamento.DataBind();
 }