示例#1
0
        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);
            }
        }
示例#2
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);
     }
 }
示例#3
0
 public bool Salvar(RevendaMod obj)
 {
     return(rep.Salvar(obj));
 }
示例#4
0
 public bool Delete(RevendaMod obj)
 {
     return(rep.Delete(obj));
 }
示例#5
0
 public bool Alterar(RevendaMod obj)
 {
     return(rep.Alterar(obj));
 }
示例#6
0
 public ActionResult Delete(RevendaMod obj)
 {
     bus.Delete(obj);
     return(RedirectToAction("Index"));
 }
示例#7
0
 public ActionResult Edit(RevendaMod obj)
 {
     bus.Alterar(obj);
     return(RedirectToAction("Index"));
 }
示例#8
0
 public ActionResult Create(RevendaMod obj)
 {
     bus.Salvar(obj);
     return(RedirectToAction("Index"));
 }