public virtual void AttachCounterType(int key, DateTime curDate, SqlABTransaction transaction) { System.Diagnostics.Debug.Assert(counterUpdater == null); this.curDate = curDate; this.rRCounter = new RRCounter(false); if (!rRCounter.Find(curDate.Year, key)) { MessageBox.Show(Properties.Resources.Msg_MissingCounter, Properties.Resources.Error, MessageBoxButtons.OK, MessageBoxIcon.Error); return; } this.PrefixVisible = rRCounter.GetValue <bool>(AM_Counter.HasPrefix); this.PrefixReadOnly = rRCounter.GetValue <bool>(AM_Counter.PrefixRO); //this.PrefixLength = rRCounter.GetValue<int>(AM_Counter.PrefixLen); //this.PrefixMask = rRCounter.GetValue<string>(AM_Counter.PrefixMask); this.PrefixMode = (PrefixSuffixType)rRCounter.GetValue <int>(AM_Counter.PrefixType); this.PrefixSeparator = rRCounter.GetValue <string>(AM_Counter.PrefixSep); this.defaultPrefix = rRCounter.GetValue <string>(AM_Counter.PrefixValue); this.PrefixValue = GetPrefixValue(); //this.CounterType = (CounterTypes)rRCounter.GetValue<int>(AM_Counter.CodeType); this.CounterLen = rRCounter.GetValue <int>(AM_Counter.CodeLen); this.CounterNumericValue = 0; this.SuffixVisible = rRCounter.GetValue <bool>(AM_Counter.HasSuffix); this.SuffixReadOnly = rRCounter.GetValue <bool>(AM_Counter.SuffixRO); //this.SuffixLength = rRCounter.GetValue<int>(AM_Counter.SuffixLen); //this.SuffixMask = rRCounter.GetValue<string>(AM_Counter.SuffixMask); this.SuffixMode = (PrefixSuffixType)rRCounter.GetValue <int>(AM_Counter.SuffixType); this.SuffixSeparator = rRCounter.GetValue <string>(AM_Counter.SuffixSep); this.defaultSuffix = rRCounter.GetValue <string>(AM_Counter.SuffixValue); this.SuffixValue = GetSuffixValue(); //this.InvertedSuffixPrefix = rRCounter.GetValue<bool>(AM_Counter.InvertSufPref); counterUpdater = new CounterManager(key, curDate.Year, rRCounter.GetValue <string>(AM_Counter.Description)); counterUpdater.Transaction = transaction; this.Refresh(); }
public override void AttachCounterType(int key, DateTime curDate, SqlABTransaction transaction) { base.AttachCounterType(key, curDate, transaction); IsAutomatic = false; EditButtonVisible = false; }