コード例 #1
0
        /// <summary>
        /// 设置发电量补偿效果,将设置的发电量添加补偿对象中
        /// 给具体补偿对象根据补偿类型进行发电量补偿
        /// </summary>
        private void addEnergy(Compensation compensation)
        {
            //取得补偿对象
            if (compensation.isplant)//电站补偿对象
            {

            }
            else
            {

            }
        }
コード例 #2
0
 /// <summary>
 /// 设置发电量补偿效果,将设置的发电量从补偿对象剔除
 /// 给具体补偿对象根据补偿类型进行发电量补偿
 /// </summary>
 private void reduceEnergy(Compensation compensation)
 {
 }
コード例 #3
0
        public int Save(Compensation compensation)
        {
            if (compensation.id > 0)
                return _compensationDao.Update(compensation);

            IList<Compensation> compensations = _compensationDao.getCompensations(compensation.plantid, compensation.isplant, compensation.type, compensation.year.ToString(), compensation.month.ToString());

            if (compensation.day > 0 && compensations.Count > 0)
            {
                var compen = compensations.Where(m => m.day.Equals(compensation.day)).FirstOrDefault<Compensation>();
                if (compen != null)
                    _compensationDao.Remove(compen);
            }
            if (compensations.Count > 0 && compensation.day == 0)
                foreach (Compensation comp in compensations)
                    _compensationDao.Remove(comp);
            return _compensationDao.Insert(compensation);
        }