private void btnCreateProduct_Click(object sender, EventArgs e) { if (this.Product.ProductId > 0) { throw new InvalidOperationException("This product already exists."); } Repository.Sql.Product.Insert(this.Product); if (this.Product.ProductId > 0) { using (FrmProductCatalog frm = new FrmProductCatalog(this.Product)) { frm.ShowDialog(); } Repository.Sql.Product.InsertCatalaog(this.Product); // Create resource directories System.IO.Directory.CreateDirectory(DataAdministration.Properties.Settings.Default.ProductResDirBase + this.Product.Catalog.UrlName); System.IO.Directory.CreateDirectory(DataAdministration.Properties.Settings.Default.ProductResDirBase + this.Product.Catalog.UrlName + DataAdministration.Properties.Settings.Default.ScreenshotDirName); System.IO.Directory.CreateDirectory(DataAdministration.Properties.Settings.Default.ProductResDirBase + this.Product.Catalog.UrlName + DataAdministration.Properties.Settings.Default.ScreenshotDirName + Properties.Settings.Default.ThumbnailDirName); EnableControls(); } }
private void btnCatalog_Click(object sender, EventArgs e) { using (FrmProductCatalog frm = new FrmProductCatalog(this.Product)) { if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Repository.Sql.Product.UpdateCatalog(this.Product); } } }