protected bool MoveAccountToHouseAccount(List <CompanyByOrderCreatedDate> listCompanies) { var status = true; var hourAcco = "7"; ILog _logger = LogManager.GetLogger(typeof(AccountMoveHouseDAL)); foreach (var item in listCompanies) { var comdal = new CompanyDAL(CONNSTRING); var resComId = comdal.CheckCompanyOwnerByID(item.CompanyId); try { if (string.IsNullOrEmpty(resComId)) { comdal.CreateOwnerCompanyId(item.CompanyId, item.OwnerId.ToString()); } } catch (Exception ex) { _logger.Error("Error occurred at MoveAccountToHouseAccount method : CreateOwnerCompanyId" + ex); status = false; } try { PerformMove(item.CompanyId, hourAcco); WriteErrorLog(item.CompanyId + ","); } catch (Exception exc) { _logger.Error("Error occurred at MoveAccountToHouseAccount method : PerformMove" + exc); status = false; } } return(status); }