public static BankruptcyInfo GetBankruptcyInfo(BankruptcyInfoEntity bankruptcyInfoEntity)
        {
            BankruptcyInfo bankruptcyInfo = null;

            try
            {
                bankruptcyInfo = Mapper.Map<BankruptcyInfoEntity, BankruptcyInfo>(bankruptcyInfoEntity);
                bankruptcyInfo.MBankruptcyBasis = Mapper.Map<MBankruptcyBasisEntity, MBankruptcyBasis>(bankruptcyInfoEntity.BankruptcyBasis);
                bankruptcyInfo.MBankruptcyType = Mapper.Map<MBankruptcyTypeEntity, MBankruptcyType>(bankruptcyInfoEntity.BankruptcyType);
            }
            catch (Exception ex)
            {
                Logger.Error("Error at GetBankruptcyInfo", ex);
                throw;
            }

            return bankruptcyInfo;
        }
        /// <summary>
        /// Maps the entities to domain.
        /// </summary>
        /// <param name="BankruptcyInfoEntity">The case info.</param>
        /// <returns>Returns the <see cref="BankruptcyInfo"/>, else null.</returns>
        public static BankruptcyInfo GetBankruptcyInfoEntity(BankruptcyInfoEntity bankruptcyInfoDomainEntity)
        {
            BankruptcyInfo bankruptcyInfoNHibernateEntity = null;

            try
            {
                bankruptcyMapping.MapBankruptcyInfoEntityToBankruptcyInfo();
                bankruptcyInfoNHibernateEntity = Mapper.Map<BankruptcyInfoEntity, BankruptcyInfo>(bankruptcyInfoDomainEntity);
                bankruptcyInfoNHibernateEntity.MBankruptcyBasis = Mapper.Map<MBankruptcyBasisEntity, MBankruptcyBasis>(bankruptcyInfoDomainEntity.BankruptcyBasis);
                bankruptcyInfoNHibernateEntity.MBankruptcyType = Mapper.Map<MBankruptcyTypeEntity, MBankruptcyType>(bankruptcyInfoDomainEntity.BankruptcyType);
            }
            catch (Exception ex)
            {
                Logger.Error("Error encountered at GetBankruptcyInfoEntity", ex);
                throw;
            }

            return bankruptcyInfoNHibernateEntity;
        }
        internal BankruptcyInfoEntity GetBankruptcyInfoBySGID(string submissionGroupId)
        {
            BankruptcyInfoEntity bankruptcyInfoEntity = new BankruptcyInfoEntity();
            IRepository<BankruptcyInfo> bankruptcyInfoRepository = new RepositoryImpl<BankruptcyInfo>(applicationSession);
            List<BankruptcyInfo> listBankruptcyInfo = new List<BankruptcyInfo>();
            DetachedCriteria detachedCriteria = DetachedCriteria.For(typeof(BankruptcyInfo))
                                                                .Add(Expression.Eq("SubmissionGroupId", submissionGroupId));
            listBankruptcyInfo = bankruptcyInfoRepository.GetAll(detachedCriteria) as List<BankruptcyInfo>;

            if (listBankruptcyInfo != null && listBankruptcyInfo.Count > 0)
            {
                foreach (BankruptcyInfo bankruptcyInfo in listBankruptcyInfo)
                {
                    bankruptcyInfoEntity = AllInOne.Legal.DataMapper.BackEnd.NHibernateToDomain.ObjectMapper.CaseSpecificMapper.GetBankruptcyInfoEntity(bankruptcyInfo);
                }

            }
            else
                bankruptcyInfoEntity = null;
            return bankruptcyInfoEntity;
        }
 internal void SaveOrUpdateBankruptcyInfoEntity(BankruptcyInfoEntity bankruptcyInfoEntity)
 {
     IRepository<BankruptcyInfo> bankruptcyInfoRepository = new RepositoryImpl<BankruptcyInfo>(applicationSession);
     bankruptcyInfoRepository.SaveOrUpdate(AllInOne.Legal.DataMapper.BackEnd.DomainToNHibernate.ObjectMapper.BankruptcyMapper.GetBankruptcyInfo(bankruptcyInfoEntity));
 }