Ejemplo n.º 1
0
        /// <summary>
        /// 年级下移
        /// </summary>
        /// <param name="gradeid"></param>
        /// <returns></returns>
        public static async Task GradeDown(Guid gradeid)
        {
            using (var gradeSvc = new GradeService())
            {
                var grade = await gradeSvc.GetOne(gradeid);

                var beforeGrade = await gradeSvc.GetAll
                                      (m => m.Order > grade.Order).FirstOrDefaultAsync();

                if (beforeGrade == null)
                {
                    return;
                }
                await gradeSvc.ChangeOrder(gradeid, beforeGrade.Order, false);

                await gradeSvc.ChangeOrder(beforeGrade.Id, grade.Order);
            }
        }