public UnitDetail MapEntityToObject(TWMCU entity) { if (entity != null) { UnitDetail obj = new UnitDetail(); obj.Name = entity.CD_CU; obj.CD_CU_KIND = entity.CD_CU_KIND; obj.CD_CU_MAKE = entity.CD_CU_MAKE; obj.CD_LBR = entity.CD_LBR; obj.CD_UOM = entity.CD_UOM; obj.CD_USAGE = entity.CD_USAGE; obj.Description = entity.DS_CU; obj.DiscontinuedDate = entity.DT_DISCONTINUED; obj.EffectiveDate = entity.DT_EFFECTIVE; obj.FC_LBR_HRS = entity.FC_LBR_HRS; obj.FG_CAPITAL = entity.FG_CAPITAL; obj.FG_MAINTENANCE = entity.FG_MAINTENANCE; obj.FG_OPERATIONS = entity.FG_OPERATIONS; obj.FG_RESTORATION = entity.FG_RESTORATION; obj.FG_TEMPORARY = entity.FG_TEMPORARY; obj.CUMUIndicator = entity.IND_CU_MU; obj.IND_UTIL = entity.IND_UTIL; obj.TP_ASSET = entity.TP_ASSET; obj.TP_CU = entity.TP_CU; obj.CD_SPEC = entity.CD_SPEC; obj.CD_FACILITY = entity.CD_FACILITY; obj.FG_HR_CHANGED = entity.FG_HR_CHANGED; obj.TS_LAST_CHANGED = entity.TS_LAST_CHANGED; obj.AMT_MATL_ITEM_TOT = entity.AMT_MATL_ITEM_TOT; obj.AMT_SALVAGE_TOT = entity.AMT_SALVAGE_TOT; obj.AMT_SCRAP_TOT = entity.AMT_SCRAP_TOT; obj.CD_CATEGORY = entity.CD_CATEGORY; obj.IND_ACCT = entity.IND_ACCT; obj.IND_ACTION = entity.IND_ACTION; obj.FG_HIDE_CU = entity.FG_HIDE_CU; obj.CD_BID_ITEM = entity.CD_BID_ITEM; obj.FG_MOBILE = entity.FG_MOBILE; //obj.CD_CREW_CLASS = entity. obj.CUStructures = null; if (entity.TWMCUSTRUCTUREs != null && entity.TWMCUSTRUCTUREs.Count > 0) { obj.CUStructures = new CUStructureBl().Get(entity.TWMCUSTRUCTUREs); } obj.Facility = null; if (entity.TWMFACILITY != null) { obj.Facility = new FacilityBl().Get(entity.TWMFACILITY); } return(obj); } return(null); }
//unitId == -1: create new unit public void showDetailUnitWindow( IngredientTab ingredientTab, int unitId = Constant.ID_CREATE_NEW) { UnitDetail detail = new UnitDetail( ingredientTab, unitId); detail.ShowDialog(); }
//public List<TransactionTotals> TransactionTotals { get; set; } public X12830File(List <object> file) { Names = new List <Name>(); ItemIdentification itemIdentification = null; ItemIdentification = new List <ItemIdentification>(); UnitDetail unitDetail; ReferenceNumbers referenceNumbers; AdministrativeCommunicationContact administrativeCommunicationContact; List <ForecastSchedule> forecastSchedules = new List <ForecastSchedule>(); List <ResourceAuthorization> resourceAuthorizations = new List <ResourceAuthorization>(); ShippedReceivedInformation shippedReceivedInformation = null; List <ShippedReceivedInformation> shippedReceivedInformations = new List <ShippedReceivedInformation>(); string loop = null; foreach (object[] line in file) { switch (line[0].ToString()) { case "ST": TransactionSetHeader = new TransactionSetHeader(line); break; case "BFR": BeginningSegmentForPlanningSchedule = new BeginningSegmentForPlanningSchedule(line); break; case "N1": Names.Add(new Name(line)); break; case "LIN": //ItemIdentifications.Add(new ItemIdentification(line)); if (itemIdentification != null) { if (itemIdentification.ProductServiceID != line[3].ToString()) { itemIdentification.ShippedReceivedInformation.Add(shippedReceivedInformation); ItemIdentification.Add(itemIdentification); itemIdentification = new ItemIdentification(line); itemIdentification.ShippedReceivedInformation = new List <ShippedReceivedInformation>(); itemIdentification.ForecastSchedule = new List <ForecastSchedule>(); itemIdentification.ResourceAuthorization = new List <ResourceAuthorization>(); loop = "LIN"; } } else { itemIdentification = new ItemIdentification(line); itemIdentification.ShippedReceivedInformation = new List <ShippedReceivedInformation>(); itemIdentification.ForecastSchedule = new List <ForecastSchedule>(); itemIdentification.ResourceAuthorization = new List <ResourceAuthorization>(); loop = "LIN"; } break; case "UIT": unitDetail = new UnitDetail(line); itemIdentification.UnitDetail = unitDetail; break; case "REF": referenceNumbers = new ReferenceNumbers(line); switch (loop) { case "LIN": itemIdentification.ReferenceNumbers = referenceNumbers; break; case "SHP": shippedReceivedInformation.ReferenceNumbers = referenceNumbers; shippedReceivedInformations.Add(shippedReceivedInformation); itemIdentification.ShippedReceivedInformation.Add(shippedReceivedInformation); break; default: break; } break; case "PER": administrativeCommunicationContact = new AdministrativeCommunicationContact(line); itemIdentification.AdministrativeCommunicationContact = administrativeCommunicationContact; break; case "FST": forecastSchedules.Add(new ForecastSchedule(line)); break; case "ATH": resourceAuthorizations.Add(new ResourceAuthorization(line)); break; case "SHP": //shippedReceivedInformation.Add(new ShippedReceivedInformation(line)); shippedReceivedInformation = new ShippedReceivedInformation(line); loop = "SHP"; break; default: break; } } shippedReceivedInformations.Add(shippedReceivedInformation); itemIdentification.ShippedReceivedInformation.Add(shippedReceivedInformation); itemIdentification.ForecastSchedule = forecastSchedules; itemIdentification.ResourceAuthorization = resourceAuthorizations; ItemIdentification.Add(itemIdentification); }
public CU TransformToCU(string workRequestId, ExtDesignKey key, string PointNumber, string PointSpanNumber, decimal?quanity, UnitDetail obj) { CU cu = new CU(); cu.WorkRequest = workRequestId; cu.UnitAction = obj.IND_ACTION; cu.Account = obj.IND_ACCT; cu.UnitCode = obj.Name; //cu.MUID = obj. //cu.DesignNumber = cu.PointNumber = PointNumber; cu.PointSpanNumber = PointSpanNumber; cu.Usage = obj.CD_USAGE; cu.OnOff = "N"; cu.EquipNumber = ""; cu.SupplyMethod = ""; cu.Quantity = quanity.ToString(); //cu.CrewClass = cu.UnitDetail = null; cu.CUFacilityAttributes = null; cu.LaborDetails = null; return(cu); }
public UnitDetail GetUnitDetail(string UnitCode) { UnitDetail obj = GetByEntity(unitOfWork.CuRepo.GetSingle(m => m.CD_CU == UnitCode)); return(obj); }