internal void DeleteProductList(detailViewModel detail) { #region 參數宣告 ProductDao productDao = new ProductDao(); ProductModel model = new ProductModel(); #endregion #region 流程 model.ID = detail.ID; model.ModifiedDate = DateTime.Now; model.Status = false; productDao.DeleteProductList(model);//將參數送入Dao層,組立SQL字串並連接資料庫 #endregion }
internal void AddProductList(detailViewModel detail) { #region 參數宣告 ProductDao productDao = new ProductDao(); ProductModel model = new ProductModel(); #endregion #region 流程 model.Name = detail.Name; model.Price = detail.Price; model.Qty = detail.Qty; model.Description = detail.Description; model.CategoryId = detail.CategoryId; model.CreationDate = DateTime.Now; model.ModifiedDate = DateTime.Now; model.Status = true; productDao.AddProductList(model);//將參數送入Dao層,組立SQL字串並連接資料庫 #endregion }