public StokBarangEntryView(bool isNewData = true, int barangID = 0, IStokBarangModel model = null, IBarangModel barangModel = null) { InitializeComponent(); _isNewData = isNewData; _barangID = barangID; panelUp.LabelInfo = isNewData ? $"TAMBAH {_typeName.ToUpper()}" : $"UBAH {_typeName.ToUpper()}"; if (!_isNewData) { _model = model; textBoxStokAwal.IntegerValue = model.stok_awal; dateTimePickerTanggal.Value = model.tanggal; textBoxBarangMasuk.IntegerValue = model.barang_masuk; textBoxBarangKeluar.IntegerValue = model.barang_keluar; textBoxStokAkhir.IntegerValue = model.stok_akhir; textBoxStokAwal.ReadOnly = false; textBoxStokAkhir.ReadOnly = false; } else { if (barangModel != null) { textBoxStokAwal.IntegerValue = barangModel.stok_akhir; textBoxBarangMasuk.IntegerValue = 0; textBoxBarangKeluar.IntegerValue = 0; textBoxStokAkhir.IntegerValue = barangModel.stok_akhir; } } operationButtons.OnSaveButtonClick += OperationButtons_OnSaveButtonClick; }
public void ValidateModel(IStokBarangModel model) { _modelDAC.ValidateModel(model); }
public void Update(IStokBarangModel model) { ValidateModel(model); _repo.Update(model); }
public void Delete(IStokBarangModel model) { _repo.Delete(model); }
public void Insert(IStokBarangModel model) { ValidateModel(model); _repo.Insert(model); }