public void InsertSnMaintainCtrl(SnMaintainCtrlDTO dto) { MaintainWork maintainWork = _maintainWorkRepository.Get(dto.MaintainWorkId); //创建序号维修控制组 SnMaintainCtrl newSnMainCtrl = MaintainCtrlFactory.CreateSnMaintainCtrl(dto.SnScope, (ControlStrategy) dto.CtrlStrategy, dto.Description, dto.CtrlDetail, maintainWork); _maintainCtrlRepository.Add(newSnMainCtrl); }
public void ModifySnMaintainCtrl(SnMaintainCtrlDTO dto) { //获取需要更新的对象 var updateSnMainCtrl = _maintainCtrlRepository.Get(dto.Id) as SnMaintainCtrl; if (updateSnMainCtrl != null) { MaintainWork maintainWork = _maintainWorkRepository.Get(dto.MaintainWorkId); //更新主表: updateSnMainCtrl.SetCtrlStrategy((ControlStrategy) dto.CtrlStrategy); updateSnMainCtrl.SetSnScope(dto.SnScope); updateSnMainCtrl.SetDescription(dto.Description); updateSnMainCtrl.SetCtrlDetail(dto.CtrlDetail); updateSnMainCtrl.SetMaintainWork(maintainWork); } _maintainCtrlRepository.Modify(updateSnMainCtrl); }
public void DeleteSnMaintainCtrl(SnMaintainCtrlDTO dto) { if (dto == null) { throw new ArgumentException("参数为空!"); } var delSnMainCtrl = _maintainCtrlRepository.Get(dto.Id) as SnMaintainCtrl; //获取需要删除的对象。 if (delSnMainCtrl != null) { _maintainCtrlRepository.Remove(delSnMainCtrl); //删除序号维修控制组。 } }