public ProductMaster_Hospital GetProductMasterByProductMasterName(string ProductMasterName, out TransactionalInformation transaction) { transaction = new TransactionalInformation(); ProductMaster_Hospital productMaster_Hospital = (from pm in dbConnection.ProductMaster join ds in dbConnection.DomainScope on pm.DomainScopeId equals ds.DomainScopeId into dsSet from ds in dsSet.DefaultIfEmpty() join pmFamily in dbConnection.ProductMaster on pm.FamilyId equals pmFamily.ProductMasterId into t1 from rt1 in t1.DefaultIfEmpty() where pm.ProductMasterName == ProductMasterName select new ProductMaster_Hospital { ProductMasterId = pm.ProductMasterId, ProductMasterName = pm.ProductMasterName, ProductMasterDescription = pm.ProductMasterDescription, ProductMasterFeatures = pm.ProductMasterFeatures, ProductMasterImageName = pm.ProductMasterImageName, ProductMasterThumbnailImageName = pm.ProductMasterThumbnailImageName, DomainScopeId = pm.DomainScopeId, FamilyId = pm.FamilyId, IsActive = pm.IsActive, CreatedDate = pm.CreatedDate, CreatedBy = pm.CreatedBy, LastModifiedDate = pm.LastModifiedDate, LastModifiedBy = pm.LastModifiedBy, DomainName = ds.DomainName, FamilyProductMasterName = rt1.ProductMasterName }).First(); transaction.ReturnStatus = true; transaction.ReturnMessage.Add("Product Master found."); return(productMaster_Hospital); }
public ProductMaster_Hospital GetProductMasterByProductMasterName(string ProductMasterName, out TransactionalInformation transaction) { transaction = new TransactionalInformation(); ProductMaster_Hospital productMaster_Hospital = new ProductMaster_Hospital(); try { _productMasterDataService.CreateSession(); productMaster_Hospital = _productMasterDataService.GetProductMasterByProductMasterName(ProductMasterName, out transaction); } catch (Exception ex) { transaction.ReturnStatus = false; transaction.ReturnMessage.Add(ex.Message); } finally { _productMasterDataService.CloseSession(); } return(productMaster_Hospital); }