public FmThongTinSanPham(SanPham sp = null, SanPhamController spc = null) { InitializeComponent(); dtgvHinhAnh.AutoGenerateColumns = false; dtgvChiTietSanPham.AutoGenerateColumns = false; //set primary context if (spc != null) SPCtr = spc; else SPCtr = new SanPhamController(); HSXCtr = new HangSXController(this.SPCtr._db); MSCtr = new MauSacController(this.SPCtr._db); HACtr = new HinhAnhController(this.SPCtr._db); SPCTCtr = new SanPham_ChiTietController(this.SPCtr._db); MSCtr.timkiem(); LoadCb_HangSX(); if (sp == null) { this.sp = new SanPham(SPCtr._db); this.Text = "Thêm Mới Sản Phẩm"; } else { this.sp = sp; this.sp._set_context(SPCtr._db); EditMode = true; ThongTinFormSanPham = this.sp; LoadDTGV_HinhAnh(); LoadDTGV_ChiTietSP(); } }
public MauSac(DTDDDbContext context) { this._ctr = new MauSacController(context); this._Init(); }
public MauSac() { this._ctr = new MauSacController(); this._Init(); }