public MPMerchantBusinessModel RetrieveMerchantBusinessInformation(int merchantId) { Dictionary<string, string> result = merchantProfileRepository.RetrieveMerchantBusinessInformation(merchantId); MPMerchantBusinessModel resultedModel = new MPMerchantBusinessModel(); if (result.Count > 0) { resultedModel.MerchantID = Convert.ToInt64(result["MerchantId"]); resultedModel.MerchantStatus = result["MerchantStatus"]; resultedModel.ContractStatus = result["ContractStatus"]; resultedModel.ContractID = Convert.ToInt64(result["ContractId"]); resultedModel.LoanedAmount = Convert.ToDouble(result["LoanedAmount"]); resultedModel.OwnedAmount = Convert.ToDouble(result["OwnedAmount"]); resultedModel.PaidAmount = Convert.ToDouble(result["PaidAmount"]); resultedModel.Business.affilliationNumber = result["AffiliationNumber"]; resultedModel.Business.businessCCStartDate = Convert.ToDateTime(result["businessCCStartDate"]); resultedModel.Business.businessStartDate = Convert.ToDateTime(result["businessStartDate"]); resultedModel.Business.businessStatus = result["BusinessStatus"]; resultedModel.Business.entityTypeID = Convert.ToInt32(result["EntityTypeID"]); resultedModel.Business.industryTypeID = Convert.ToInt32(result["IndustryTypeID"]); resultedModel.Business.nameOfBusiness = result["BusinessName"]; resultedModel.Business.nameOfCompany = result["LegalName"]; resultedModel.Business.RNC = result["RNCNumber"]; resultedModel.PhysicalAddress.Address = result["PAddress"]; resultedModel.PhysicalAddress.Email = result["Pemail"]; resultedModel.PhysicalAddress.Fax = result["PFax"]; resultedModel.PhysicalAddress.Phone1 = result["PPhone1"]; resultedModel.PhysicalAddress.Phone2 = result["PPhone2"]; resultedModel.PhysicalAddress.ProvinceID = Convert.ToInt32(result["PprovinceId"]); resultedModel.LegalAddress.Address = result["LAddress"]; resultedModel.LegalAddress.City = result["LCity"]; resultedModel.LegalAddress.Email = result["Lemail"]; resultedModel.LegalAddress.Fax = result["LFax"]; resultedModel.LegalAddress.Phone1 = result["LPhone1"]; resultedModel.LegalAddress.Phone2 = result["LPhone2"]; resultedModel.LegalAddress.ProvinceID = Convert.ToInt32(result["LprovinceId"]); resultedModel.Processor.AddRange(RetrieveMerchantBusinessProcessorInformation(merchantId)); //resultedModel.Processor.Add(new MPMerchantProcessorInfoModel() { // FirstProcessedDate = Convert.ToDateTime(result["businessStartDate"]) //}); } return resultedModel; }
public bool UpdateMerchantBusinessInformation(MPMerchantBusinessModel entity) { return merchantProfileRepository.UpdateMerchantBusinessInformation(entity); }
public bool UpdateMerchantBusinessInformation(MPMerchantBusinessModel entity) { return new DataAccess.DataAccess().ExecuteNonQuery("avz_MRC_spUpdateMerchantBusinessInformation", new { merchantId = entity.MerchantID, LegalName = entity.Business.nameOfCompany, BusinessName = entity.Business.nameOfBusiness, BusinessStatus = entity.Business.businessStatus, EntityTypeID = entity.Business.entityTypeID, RNCNumber = entity.Business.RNC, businessStartDate = entity.Business.businessStartDate, businessCCStartDate = entity.Business.businessCCStartDate, IndustryTypeID = entity.Business.industryTypeID, AffiliationNumber = entity.Business.affilliationNumber == null ? "" : entity.Business.affilliationNumber, PAddress = entity.PhysicalAddress.Address, PprovinceId = entity.PhysicalAddress.ProvinceID, PPhone1 = entity.PhysicalAddress.Phone1 == null ? "" : entity.PhysicalAddress.Phone1, PPhone2 = entity.PhysicalAddress.Phone2 == null ? "" : entity.PhysicalAddress.Phone2, Pemail = entity.PhysicalAddress.Email, PFax = entity.PhysicalAddress.Fax == null ? "" : entity.PhysicalAddress.Fax, LAddress = entity.LegalAddress.Address, LprovinceId = entity.LegalAddress.ProvinceID, LPhone1 = entity.LegalAddress.Phone1 == null ? "" : entity.LegalAddress.Phone1, LPhone2 = entity.LegalAddress.Phone2 == null ? "" : entity.LegalAddress.Phone2, Lemail = entity.LegalAddress.Email, LFax = entity.LegalAddress.Fax == null ? "" : entity.LegalAddress.Fax, LCity = entity.LegalAddress.City, UserId=entity.UserId }); }