private void RemoveFranchiseeFromHistoricoVendas(int franqId)
 {
     using (HistoricoVendasSession s = new HistoricoVendasSession())
     {
         using (var das = s.CreateDataAccessScope(false))
         {
             IMapperHistoricoVendas map = s.CreateMapperHistoricoVendas();
             map.DeleteAllWithFranqId(franqId);
         }
     }
 }
Ejemplo n.º 2
0
 private void RemoveProdFromHistoricoVendas(int key)
 {
     using (HistoricoVendasSession s = new HistoricoVendasSession())
     {
         using (var das = s.CreateDataAccessScope(false))
         {
             IMapperHistoricoVendas prodMap = s.CreateMapperHistoricoVendas();
             prodMap.DeleteAllWithProdId(key);
         }
     }
 }
Ejemplo n.º 3
0
        public void TestShouldDelete()
        {
            HistoricoVendas hv = new HistoricoVendas(1, 10, 20);

            using (HistoricoVendasSession s = new HistoricoVendasSession())
            {
                using (var das = s.CreateDataAccessScope(true))
                {
                    IMapperHistoricoVendas map = s.CreateMapperHistoricoVendas();
                    map.Create(hv);
                    map.Delete(hv);

                    map.Read(hv.FranqId, hv.ProdId);
                }
            }
        }
Ejemplo n.º 4
0
        public void TestShouldRead()
        {
            HistoricoVendas hv = new HistoricoVendas(1, 10, 20);

            using (HistoricoVendasSession s = new HistoricoVendasSession())
            {
                using (var das = s.CreateDataAccessScope(true))
                {
                    IMapperHistoricoVendas map = s.CreateMapperHistoricoVendas();
                    map.Create(hv);
                    HistoricoVendas actual = map.Read(hv.FranqId, hv.ProdId);

                    Assert.AreEqual(hv.Hist3Anos, actual.Hist3Anos);
                }
            }
        }