Example #1
0
        private void txtValor_TextChanged(object sender, EventArgs e)
        {
            Dizimo a = (Dizimo)modelo;

            try { a.Validar(txtValor.Text, "Valor"); }
            catch (Exception ex) { MessageBox.Show(modelo.exibirMensagemErro(ex, 2)); }
        }
Example #2
0
        private void FrmCadastrarDizimo_Load(object sender, EventArgs e)
        {
            var form = "Dízimo";

            if (CondicaoAtualizar)
            {
                this.Text = "Atualizar registro - " + form;
            }
            if (CondicaoDeletar)
            {
                this.Text = "Deletar registro - " + form;
            }
            if (CondicaoDetalhes)
            {
                this.Text = "Detalhes registro - " + form;
            }
            if (!CondicaoDeletar && !CondicaoAtualizar && !CondicaoDetalhes)
            {
                this.Text = "Cadastro - " + form;
            }

            Dizimo a = (Dizimo)modelo;

            try { txtValor.Text = a.Valor.ToString(); }
            catch (Exception ex) { MessageBox.Show(modelo.exibirMensagemErro(ex, 2)); }
        }
        // GET: Dizimos/Create
        public ActionResult Create()
        {
            var dizimos = new Dizimo();
            int id      = Convert.ToInt32(TempData["CultoId"]);

            dizimos.CultoId = id;

            ViewBag.Membro = new SelectList(_interfaceMembro.GetAll(1), "Id", "Nome");
            return(PartialView("Create", dizimos));
        }
 public ActionResult Edit(int id, Dizimo dizimo)
 {
     try
     {
         // TODO: Add update logic here
         _interfaceDizimo.Update(dizimo);
         return(RedirectToAction(nameof(Index)));
     }
     catch
     {
         return(View());
     }
 }
        public ActionResult Create(Dizimo objeto)
        {
            try
            {
                //  objeto.dateTime = DateTime.Now;
                _interfaceDizimo.Add(objeto);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(View());
            }
        }
Example #6
0
 public void Update(Dizimo Objeto)
 {
     _interfaceDizimo.Update(Objeto);
 }
Example #7
0
 public void Delete(Dizimo Objeto)
 {
     throw new NotImplementedException();
 }
Example #8
0
 public void Add(Dizimo Objeto)
 {
     _interfaceDizimo.Add(Objeto);
 }