//更新ShipType public void UpdateShipType(ShipTypeMaintain shipType) { ShipType fisObject = new ShipType(); fisObject.shipType = shipType.shipType; fisObject.Description = shipType.Description; fisObject.Editor = shipType.Editor; fisObject.Udt = DateTime.Now; modelRepository.UpdateShipType(fisObject); }
//更新ShipType public void UpdateShipType(ShipTypeMaintain shipType, string oldShipType) { ShipType fisObject = new ShipType(); fisObject.shipType = shipType.shipType; fisObject.Description = shipType.Description; fisObject.Editor = shipType.Editor; fisObject.Cdt = DateTime.Now; fisObject.Udt = DateTime.Now; UnitOfWork uow = new UnitOfWork(); modelRepository.DeleteShipTypeByKeyDefered(uow, oldShipType); modelRepository.InsertShipTypeDefered(uow, fisObject); uow.Commit(); }
//取得全部的ShipType public List<ShipTypeMaintain> GetAllShipType() { List<ShipTypeMaintain> shipTypeMaintainList = new List<ShipTypeMaintain>(); IList<ShipType> fisObjectList = modelRepository.GetAllShipType(); if (fisObjectList != null) { foreach (ShipType temp in fisObjectList) { ShipTypeMaintain shipTypeMaintain = new ShipTypeMaintain(); shipTypeMaintain.shipType = temp.shipType; shipTypeMaintain.Description = temp.Description; shipTypeMaintain.Editor = temp.Editor; shipTypeMaintain.Cdt = temp.Cdt; shipTypeMaintain.Udt = temp.Udt; shipTypeMaintainList.Add(shipTypeMaintain); } } return shipTypeMaintainList; }
//取得ShipType public ShipTypeMaintain GetShipTypeByKey(string shipType) { ShipType temp = modelRepository.GetShipTypeByKey(shipType); ShipTypeMaintain shipTypeMaintain = new ShipTypeMaintain(); shipTypeMaintain.shipType = temp.shipType; shipTypeMaintain.Description = temp.Description; shipTypeMaintain.Editor = temp.Editor; shipTypeMaintain.Cdt = temp.Cdt; shipTypeMaintain.Udt = temp.Udt; return shipTypeMaintain; }