public ProductionTypeGetResponse Execute(ProductionTypeGetRequest request) { ProductionTypeGetResponse productionTypeGetResponse = new ProductionTypeGetResponse(); ProductionTypeInfo productionType = ServiceHelper.LoadService <IProductionService>().GetProductionType(request.DID); if (productionType != null) { productionTypeGetResponse.ProductionType = productionType.ToModel(); } return(productionTypeGetResponse); }
public IList <ProductionTypeInfo> GetProductionTypeInfos(int craftDID) { List <ProductionTypeInfo> lst = new List <ProductionTypeInfo>(); DataTable dt = getProductionType_Join_Facility_Join_ProcessInfos(craftDID); if (dt != null && dt.Rows.Count > 0) { foreach (DataRow row in dt.Rows) { ProductionTypeInfo info = new ProductionTypeInfo(); info.DID = int.Parse(row[0].ToString()); info.ProductNo = row[1].ToString(); if (row[2].ToString() != "") { info.MinWeight = decimal.Parse(row[2].ToString()); } if (row[3].ToString() != "") { info.MaxWeight = decimal.Parse(row[3].ToString()); } if (row[4].ToString() != "") { info.MinScope = decimal.Parse(row[4].ToString()); } if (row[5].ToString() != "") { info.MaxScope = decimal.Parse(row[5].ToString()); } if (row[6].ToString() != "") { info.BarCodeLen = int.Parse(row[6].ToString()); } if (row[7].ToString() != "") { info.PrefixLen = int.Parse(row[7].ToString()); } info.PrefixData = row[8].ToString(); info.DefaultBarCode = row[9].ToString(); info.FacilityDID = int.Parse(row[10].ToString()); info.Time = DateTime.Parse(row[11].ToString()); lst.Add(info); } } return(lst); }
public static ProductionTypeModel ToModel(this ProductionTypeInfo entity) { return(Mapper.Map <ProductionTypeInfo, ProductionTypeModel>(entity)); }