コード例 #1
0
        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;
        }
コード例 #2
0
 public void ValidateModel(IStokBarangModel model)
 {
     _modelDAC.ValidateModel(model);
 }
コード例 #3
0
 public void Update(IStokBarangModel model)
 {
     ValidateModel(model);
     _repo.Update(model);
 }
コード例 #4
0
 public void Delete(IStokBarangModel model)
 {
     _repo.Delete(model);
 }
コード例 #5
0
 public void Insert(IStokBarangModel model)
 {
     ValidateModel(model);
     _repo.Insert(model);
 }