Пример #1
0
        /// <summary>
        /// 更新数据
        /// </summary>
        /// <param name="dataList"></param>
        public void UpdateData(List <IntakeAndOutputData> dataList)
        {
            if (dataList == null || dataList.Count == 0)
            {
                return;
            }
            if (RowData.Count > 0 && dataList.FirstOrDefault().Name != RowData.FirstOrDefault().Name)
            {
                return;
            }

            RowData.Clear();
            RowData.AddRange(dataList);
            //foreach (IntakeAndOutputData item in dataList)
            //{
            //    IntakeAndOutputData orgData = RowData.Find(p =>
            //    {
            //        if (item.IsOneTime)
            //            return item.OnetimeData.ExcuteTime == p.OnetimeData.ExcuteTime;
            //        else
            //            return item.BeginTime == p.BeginTime && item.EndTime == p.EndTime;
            //    });
            //    if (orgData != null)
            //        orgData = item;
            //    else
            //        RowData.Add(item);
            //}
        }
Пример #2
0
        /// <summary>
        /// 新增数据
        /// </summary>
        /// <param name="dataList"></param>
        public void AddData(List <IntakeAndOutputData> dataList)
        {
            if (RowData.Count > 0 && dataList.FirstOrDefault().Name != RowData.FirstOrDefault().Name)
            {
                return;
            }

            RowData.AddRange(dataList);
        }