예제 #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 public void AddPeriodItem(PeriodItem item)
 {
     item.isModified = true;
     item.position   = itemListChangeHandler.Items.Count;
     item.period     = this;
     itemListChangeHandler.AddNew(item);
 }
예제 #2
0
 public void setPeriod(PeriodItem item, String excelFile, int rowRef = -1, int colRef = -1, bool remove = false)
 {
     this.isPeriod         = true;
     this.periodItem       = item;
     this.excelFileName    = excelFile;
     this.rowRef           = rowRef;
     this.colRef           = colRef;
     this.removePeriodItem = remove;
 }
예제 #3
0
        public PeriodItem GetCopy()
        {
            PeriodItem item = new PeriodItem();

            item.name     = this.name;
            item.value    = this.value;
            item.formula  = this.formula;
            item.position = this.position;
            return(item);
        }
예제 #4
0
 public bool Contains(PeriodItem periodItem)
 {
     foreach (PeriodItem perioditem in this.itemListChangeHandler.getItems())
     {
         if (periodItem.name == periodItem.name)
         {
             return(true);
         }
     }
     return(false);
 }
예제 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="scope"></param>
        public void SynchronizeDeletePeriodItem(PeriodItem item)
        {
            PeriodItem foundItem = this.GetPeriodItem(item.position);

            if (foundItem == null)
            {
                return;
            }
            RemovePeriodItem(foundItem);
            this.isModified = true;
        }
예제 #6
0
        public PeriodItem getToPeriodItem(string sign)
        {
            PeriodItem item = new PeriodItem();

            item.name  = this.periodName.name;
            item.value = this.periodToDateTime.ToShortDateString();
            if (!String.IsNullOrWhiteSpace(sign))
            {
                item.operatorSign = sign;
            }
            return(item);
        }
예제 #7
0
        public PeriodItem getFromPeriodItem(string sign)
        {
            PeriodItem item = new PeriodItem();

            item.name  = this.name;
            item.value = this.periodFrom;
            if (!String.IsNullOrWhiteSpace(sign))
            {
                item.operatorSign = sign;
            }
            return(item);
        }
예제 #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 public void RemovePeriodItem(PeriodItem item)
 {
     item.isModified = true;
     itemListChangeHandler.AddDeleted(item);
     foreach (PeriodItem child in itemListChangeHandler.Items)
     {
         if (child.position > item.position)
         {
             child.position = child.position - 1;
         }
     }
 }
예제 #9
0
 /// <summary>
 /// Oublier un fils
 /// </summary>
 /// <param name="child"></param>
 public void ForgetPeriodItem(PeriodItem item)
 {
     itemListChangeHandler.forget(item);
     foreach (PeriodItem child in itemListChangeHandler.Items)
     {
         if (child.position > item.position)
         {
             child.position = child.position - 1;
         }
     }
     item.position = -1;
 }
예제 #10
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="scope"></param>
        public PeriodItem SynchronizePeriodItems(PeriodItem periodItem)
        {
            PeriodItem foundItem = this.GetPeriodItem(periodItem.position);

            if (foundItem == null)
            {
                foundItem                      = new PeriodItem();
                foundItem.name                 = periodItem.name;
                foundItem.value                = periodItem.value;
                foundItem.loop                 = periodItem.loop;
                foundItem.formula              = periodItem.formula;
                foundItem.comparator           = periodItem.comparator;
                foundItem.closeBracket         = periodItem.closeBracket;
                foundItem.openBracket          = periodItem.openBracket;
                foundItem.operationGranularity = periodItem.operationGranularity;
                foundItem.operationNumber      = periodItem.operationNumber;
                foundItem.operationDate        = periodItem.operationDate;
                foundItem.operation            = periodItem.operation;
                AddPeriodItem(foundItem);
            }
            else
            {
                foundItem.name                 = periodItem.name;
                foundItem.value                = periodItem.value;
                foundItem.loop                 = periodItem.loop;
                foundItem.formula              = periodItem.formula;
                foundItem.comparator           = periodItem.comparator;
                foundItem.closeBracket         = periodItem.closeBracket;
                foundItem.openBracket          = periodItem.openBracket;
                foundItem.operationGranularity = periodItem.operationGranularity;
                foundItem.operationNumber      = periodItem.operationNumber;
                foundItem.operationDate        = periodItem.operationDate;
                foundItem.operation            = periodItem.operation;
                UpdatePeriodItem(foundItem);
            }
            this.isModified = true;
            return(foundItem);
        }
예제 #11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="item"></param>
 public void UpdatePeriodItem(PeriodItem item, bool sort = true)
 {
     item.isModified = true;
     itemListChangeHandler.AddUpdated(item, sort);
 }