public void Update(PointAsb obj) { var entity = MapObjectToEntity(obj); if (entity != null) { unitOfWork.PointAsbRepo.Update(entity); unitOfWork.Save(); } }
public PointAsb Get(TWMPOINT_ASB entity) { if (entity != null) { PointAsb obj = MapEntityToObject(entity); return(obj); } return(null); }
public TWMPOINT_ASB MapObjectToEntity(PointAsb obj) { TWMPOINT_ASB entity = new TWMPOINT_ASB(); entity = MapRootObjectToEntity(obj, entity); if (obj.CUAsbs != null && obj.CUAsbs.Count > 0) { entity.TWMCUPOINT_ASBs = new CUAsbBl().MapObjectsToEntities(obj.CUAsbs).ToList(); } return(entity); }
public TWMPOINT_ASB MapRootObjectToEntity(PointAsb obj, TWMPOINT_ASB entity) { entity.CD_WR = obj.WorkRequestId; entity.ID_POINT = obj.PointID; entity.NO_POINT = obj.PointNumber; entity.NO_POINT_SPAN = obj.PointSpanNumber; entity.LN_SPAN = (decimal)int.Parse(obj.Length); //entity.LN_SPAN = 0; entity.CD_DIST = obj.District; entity.IND_MAIN_STATUS = obj.MainStatusIndicator; entity.NO_ASB_DESIGN = obj.AsbuiltDesignNumber; entity.TS_LAST_CHANGED = obj.TimeStampLastChanged; return(entity); }
public PointAsb MapEntityToObject(TWMPOINT_ASB entity) { PointAsb obj = new PointAsb(); obj.WorkRequestId = entity.CD_WR; obj.PointID = entity.ID_POINT; obj.PointNumber = entity.NO_POINT; obj.PointSpanNumber = entity.NO_POINT_SPAN; obj.Length = entity.LN_SPAN.ToString(); obj.AsbuiltDesignNumber = entity.NO_ASB_DESIGN; obj.District = entity.CD_DIST; obj.TimeStampLastChanged = entity.TS_LAST_CHANGED; obj.MainStatusIndicator = entity.IND_MAIN_STATUS; obj.CUAsbs = entity.TWMCUPOINT_ASBs != null && entity.TWMCUPOINT_ASBs.Count > 0 ? new CUAsbBl().GetByWorkRequestIdandPoint((long)entity.CD_WR, obj.PointNumber, obj.PointSpanNumber) : null; return(obj); }