public void ActualizarPrducto(int prd_id, int?prd_cnt)
        {
            Producto prd = ProductoBLL.Get(prd_id);

            prd.prd_cnt -= prd_cnt;
            ProductoBLL.Update(prd);
        }
 public static void Delete(int?id)
 {
     using (emmcomerseEntities db = new emmcomerseEntities())
     {
         using (var transaction = db.Database.BeginTransaction())
         {
             try
             {
                 ProductoEnCarrito ProductoEnCarrito = db.ProductoEnCarrito.Find(id);
                 db.Entry(ProductoEnCarrito).State = System.Data.Entity.EntityState.Deleted;
                 db.SaveChanges();
                 transaction.Commit();
                 ProductoBLL.Update(ProductoEnCarrito.prd_id, (-1 * ProductoEnCarrito.prd_cnt));
             }
             catch (Exception ex)
             {
                 transaction.Rollback();
                 throw ex;
             }
         }
     }
 }
 public static void Create(ProductoEnCarrito a)
 {
     using (emmcomerseEntities db = new emmcomerseEntities())
     {
         using (var transaction = db.Database.BeginTransaction())
         {
             try
             {
                 a.pcr_est           = "Pendiente";
                 a.pcr_dateOfCreated = DateTime.Now;
                 db.ProductoEnCarrito.Add(a);
                 db.SaveChanges();
                 transaction.Commit();
                 ProductoBLL.Update(a.prd_id, a.prd_cnt);
             }
             catch (Exception ex)
             {
                 transaction.Rollback();
                 throw ex;
             }
         }
     }
 }