Exemple #1
0
 // Create
 public int Create(PRODUCT_KIND productKindModel)
 {
     productKindModel.Is_Deleted = false;
     db.PRODUCT_KIND.Add(productKindModel);
     db.SaveChanges();
     return(productKindModel.Id_ProductKind);
 }
Exemple #2
0
        // Update
        public bool Update(PRODUCT_KIND pkModel)
        {
            var targetUpdate = db.PRODUCT_KIND.Find(pkModel.Id_ProductKind);

            try
            {
                targetUpdate.Name_ProductKind = pkModel.Name_ProductKind;
                db.SaveChanges();
                return(true);
            }
            catch (Exception e)
            {
                return(false);

                throw new Exception(e.Message);
            }
        }