public bool Delete(RevendaMod obj) { var revenda = BuscarId(obj.Id); using (db = new FDRConnectionString()) { var objRep = new Revenda { Id = revenda.Id, Descricao = revenda.Descricao, NomeResponsavel = revenda.NomeResponsavel, Email = revenda.Email, Telefone = revenda.Telefone, QuantidadeUsuariosAcesso = revenda.QuantidadeUsuariosAcesso, AcessoLibertado = revenda.AcessoLibertado, DataTerminoAcesso = revenda.DataTerminoAcesso, DataUltimaAlteracao = DateTime.Now, ChaveLiberacaoAcesso = revenda.ChaveLiberacaoAcesso, Ativo = false, DataCadastro = revenda.DataCadastro }; db.Entry(objRep).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges() > 0); } }
public bool Salvar(RevendaMod obj) { using (db = new FDRConnectionString()) { var objRep = new Revenda { Id = obj.Id, Descricao = obj.Descricao, NomeResponsavel = obj.NomeResponsavel, Email = obj.Email, Telefone = obj.Telefone, QuantidadeUsuariosAcesso = obj.QuantidadeUsuariosAcesso, AcessoLibertado = obj.AcessoLibertado, DataTerminoAcesso = obj.DataTerminoAcesso, DataUltimaAlteracao = DateTime.Now, ChaveLiberacaoAcesso = obj.ChaveLiberacaoAcesso, Ativo = true, DataCadastro = DateTime.Now }; db.Revenda.Add(objRep); return(db.SaveChanges() > 0); } }
public bool Salvar(RevendaMod obj) { return(rep.Salvar(obj)); }
public bool Delete(RevendaMod obj) { return(rep.Delete(obj)); }
public bool Alterar(RevendaMod obj) { return(rep.Alterar(obj)); }
public ActionResult Delete(RevendaMod obj) { bus.Delete(obj); return(RedirectToAction("Index")); }
public ActionResult Edit(RevendaMod obj) { bus.Alterar(obj); return(RedirectToAction("Index")); }
public ActionResult Create(RevendaMod obj) { bus.Salvar(obj); return(RedirectToAction("Index")); }