ÎļþÃû´Ó Service/HStation.Service.Xhs.PumpProduct.Core/03-service/03-PumpMain/PumpMain.cs ÐÞ¸Ä |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éè¿ ID è·åææäº§å |
| | | /// </summary> |
| | | public List<Model.PumpPartMain> GetPartByID(long ID) |
| | | { |
| | | var all = GetAll(); |
| | | var allidlist = PumpMainAndPartMap.GetByPumpMainID(ID); |
| | | var partmain = new PumpPartMain(); |
| | | var allpart = partmain.GetByIds(allidlist); |
| | | return allpart; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// éè¿ ID è·å |
| | | /// </summary> |
| | | public List<Model.PumpMain> GetByIds(List<long> Ids) |
| | |
| | | /// <summary> |
| | | /// æå
¥æå± |
| | | /// </summary> |
| | | public long InsertEx(Model.PumpMain model, Model.PumpGroupAndMainMap map) |
| | | public long InsertEx(Model.PumpMain main, Model.PumpGroupAndMainMap map, Model.PumpPartMain part, List<Model.PumpPropContent> content, Model.PumpMainAndPartMap partmap) |
| | | { |
| | | if (model == null) |
| | | if (main == null) |
| | | { |
| | | return default; |
| | | } |
| | | var dal = DALCreateHelper.CreateDAL<HStation.DAL.IPumpMain>(); |
| | | var main = Model2Entity(model); |
| | | var entity = PumpGroupAndMainMap.Model2Entity(map); |
| | | var id = dal.InsertsEx(main, entity); |
| | | var mainEntity = Model2Entity(main); |
| | | var groupMapEntity = PumpGroupAndMainMap.Model2Entity(map); |
| | | var partEntity = PumpPartMain.Model2Entity(part); |
| | | var contentEntity = PumpPropContent.Model2Entities(content); |
| | | var partmapEntity = PumpMainAndPartMap.Model2Entity(partmap); |
| | | var id = dal.InsertsEx(mainEntity, groupMapEntity, partEntity, contentEntity, partmapEntity); |
| | | if (id > 0) |
| | | { |
| | | UpdateCache(id); |
| | | PumpGroupAndMainMap.UpdateCacheByMainID(id); |
| | | // PumpPartMain.Entity2Model |
| | | } |
| | | return id; |
| | | } |