public static void Delete(ClientProductViewModel product)
 {
     ClientProductViewModel target = One(p => p.ProductID == product.ProductID);
     if (target != null)
     {
         All().Remove(target);
     }
 }
示例#2
0
        public static void Delete(ClientProductViewModel product)
        {
            ClientProductViewModel target = One(p => p.ProductID == product.ProductID);

            if (target != null)
            {
                All().Remove(target);
            }
        }
 public static void Update(ClientProductViewModel product)
 {
     ClientProductViewModel target = One(p => p.ProductID == product.ProductID);
     if (target != null)
     {
         target.ProductName = product.ProductName;
         target.UnitPrice = product.UnitPrice;
         target.UnitsInStock = product.UnitsInStock;
         target.Discontinued = product.Discontinued;
         target.Category = product.Category;
         target.CategoryID = product.Category.CategoryID;
     }
 }
示例#4
0
        public static void Update(ClientProductViewModel product)
        {
            ClientProductViewModel target = One(p => p.ProductID == product.ProductID);

            if (target != null)
            {
                target.ProductName  = product.ProductName;
                target.UnitPrice    = product.UnitPrice;
                target.UnitsInStock = product.UnitsInStock;
                target.Discontinued = product.Discontinued;
                target.Category     = product.Category;
                target.CategoryID   = product.Category.CategoryID;
            }
        }
 public static void Insert(ClientProductViewModel product)
 {
     product.ProductID = All().OrderByDescending(p => p.ProductID).First().ProductID + 1;
     product.CategoryID = product.Category.CategoryID;
     All().Insert(0, product);
 }
示例#6
0
 public static void Insert(ClientProductViewModel product)
 {
     product.ProductID  = All().OrderByDescending(p => p.ProductID).First().ProductID + 1;
     product.CategoryID = product.Category.CategoryID;
     All().Insert(0, product);
 }