public IBarCode CreateBarCode(IBarCode barCode) { var returnBarCode = _storage.CreateBarCode(barCode); _isDirty = true; return(returnBarCode); }
private async System.Threading.Tasks.Task DeleteBarCode(IBarCode barCode) { if (_isDialogActive) { return; } var dialog = new ContentDialog { Title = "Delete Transaction", Content = $"Delete {barCode.Code}?", IsPrimaryButtonEnabled = true, IsSecondaryButtonEnabled = true, PrimaryButtonText = "Delete", SecondaryButtonText = "Cancel" }; _isDialogActive = true; var res = await dialog.ShowAsync(); _isDialogActive = false; if (res == ContentDialogResult.Secondary) { return; } ViewModel.DeleteBarCode(barCode); }
public override IBarCode CreateBarCode(IBarCode barCode) { try { return(_storageEngine.Create(barCode) as IBarCode); } catch (ArgumentException e) { throw new StorageException($"{e.Message}"); } }
public override IBarCode CreateBarCode(IBarCode barCode) { _table.InitializeDatabase(); if (barCode.Id == 0) { barCode.Id = _table.AddData(ObjectToIBarCodeConvertor.ConvertToKeyValuePair(barCode)); } else { _table.AddData(ObjectToIBarCodeConvertor.ConvertToKeyValuePairWithId(barCode)); } return(barCode); }
public Image DrawBarcode() { if (string.IsNullOrEmpty(this.data)) { throw new Exception("BarcodeGenerator: Input data can not be empty."); } if (this.SymbologyType == SymbologyType.UNSPECIFIED) { throw new Exception("BarcodeGenerator: Symbology Type can not be unspecified."); } switch (this._SymbologyType) { case SymbologyType.Codabar: ibarcode = new Codabar(this.data, this._Width, this.Height, this._ForeColor, this._BackColor, this._Scale); break; case SymbologyType.UPCA: ibarcode = new UPCA(this.data, this._Width, this.Height, this._ForeColor, this._BackColor, this._Scale); break; case SymbologyType.UPCE: ibarcode = new UPCE(this.data, this._Width, this.Height, this._ForeColor, this._BackColor, this._Scale); break; case SymbologyType.EAN8: ibarcode = new EAN8(this.data, this._Width, this.Height, this._ForeColor, this._BackColor, this._Scale); break; case SymbologyType.EAN13: ibarcode = new EAN13(this.data, this._Width, this.Height, this._ForeColor, this._BackColor, this._Scale); break; default: break; } this.data = ibarcode.Data; return(ibarcode.Image); }
public override void DeleteBarCode(IBarCode barCode) { _storageEngine.Delete(barCode); }
public override void UpdateBarCode(IBarCode barCode) { }
public abstract void DeleteBarCode(IBarCode barCode);
public static IEnumerable <KeyValuePair <string, object> > ConvertToKeyValuePair(IBarCode barCode) { var returnList = new List <KeyValuePair <string, object> > { new KeyValuePair <string, object>("transactionId", barCode.Transaction?.Id), new KeyValuePair <string, object>("code", barCode.Code), new KeyValuePair <string, object>("isWeight", barCode.IsWeight?1:0), new KeyValuePair <string, object>("numberOfDigits", barCode.NumberOfDigitsForWeight), }; return(returnList); }
public override void UpdateBarCode(IBarCode barCode) { _table.InitializeDatabase(); _table.UpdateData(ObjectToIBarCodeConvertor.ConvertToKeyValuePair(barCode), barCode.Id); }
public override void DeleteBarCode(IBarCode barCode) { _table.InitializeDatabase(); _table.DeleteRecordById(barCode.Id); }
public void InverseIsWeight(IBarCode barCode) { barCode.IsWeight = !barCode.IsWeight; _storage.UpdateBarCode(barCode); LoadBarCodes(); }
public void DeleteBarCode(IBarCode barCode) { _storage.DeleteBarCode(barCode); _barCodes.Remove(barCode); }
public abstract void UpdateBarCode(IBarCode barCode);
public void DeleteBarCode(IBarCode barCode) { _storage.DeleteBarCode(barCode); _isDirty = true; }
public static IEnumerable <KeyValuePair <string, object> > ConvertToKeyValuePairWithId(IBarCode barCode) { var returnList = ConvertToKeyValuePair(barCode).ToList(); returnList.Add(new KeyValuePair <string, object>("id", barCode.Id)); return(returnList); }
public void UpdateBarCode(IBarCode barCode) { _storage.UpdateBarCode(barCode); _isDirty = true; }
public abstract IBarCode CreateBarCode(IBarCode barCode);