using JiepeiWMS.IServices; using JiepeiWMS.Model.Models; using JiepeiWMS.Services.BASE; using JiepeiWMS.IRepository.Base; using JiepeiWMS.Repository.Base; using System.Threading.Tasks; namespace JiepeiWMS.Services { public class DepartmentServices : BaseServices, IDepartmentServices { private readonly IBaseRepository _dal; public DepartmentServices(IBaseRepository dal) { this._dal = dal; base.BaseDal = dal; } /// /// 移动到指定位置 /// /// 被移动模型 /// 目标模型的Id /// 错误信息 public async Task Move(Department Model, int MoveId) { await _dal._TreeAutoSetValues(MoveId, Model); return string.Empty; } /// /// 添加 /// /// 模型 /// 主键 public async Task AddInfo(Department Model) { Model.Id = await BaseDal.Add(Model); await BaseDal._TreeAutoSetValues(Model); await BaseDal.Update(Model); return Model.Id; } /// /// 编辑 /// /// 模型 /// 主键 public async Task EditInfo(Department Model) { await BaseDal._TreeAutoSetValues(Model); await BaseDal.Update(Model); return string.Empty; } } }