public void UpdateYoutubeLibrary(PropertyListingYoutubeView model, int PropertyListingId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { var youtube = db.ProprtyListingYoutubeLibraries.FirstOrDefault(x => x.ProprtyListingYoutubeLibraryId == model.ProprtyListingYoutubeLibraryId); youtube.IsVideoActive = model.IsVideoActive; youtube.PrfoprtyListingId = PropertyListingId; youtube.YoutubeVideoLink = model.YoutubeVideoLink; db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
public void UpdatePropertyAgents(PropertyListingAgentsView model, int PropertyListingId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { var agents = db.PropertyListingAgents.FirstOrDefault(x => x.AgentId == model.AgentId); agents.PropertyListingId = PropertyListingId; agents.IsActive = model.IsActive; agents.AgentId = model.AgentId; db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
public void Create(PropertyPricingTypesView model) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.PropertyListingPricingType table = new DataAccess.PropertyListingPricingType() { IsActive = true, TypeName = model.TypeName }; db.PropertyListingPricingTypes.Add(table); db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
public void Create(LeadActivityType model) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.LeadActivity table = new DataAccess.LeadActivity() { IsActive = true, ActivityName = model.ActivityName, IsSystem = model.IsSystemActivity }; db.LeadActivities.Add(table); db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
public void UpdateListingDetail(PropertyListingDetailView model, int PropertyListingId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { var Details = db.PropertyListingDetails.FirstOrDefault(x => x.PropertyListingDetailId == model.PropertyListingDetailId); Details.RatesAndTaxes = model.RatesAndTaxes; Details.NumberOfBathRooms = model.NumberOfBathRooms; Details.NumberOfBedrooms = model.NumberOfBedrooms; Details.NumberOfGarages = model.NumberOfGarages; Details.NumberOfSquareMeters = model.NumberOfSquareMeters; Details.PropertyListingId = PropertyListingId; db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
private void CaptureYoutubeLibrary(PropertyListingYoutubeView model, int PropetyListingId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.ProprtyListingYoutubeLibrary table = new DataAccess.ProprtyListingYoutubeLibrary() { IsVideoActive = true, PrfoprtyListingId = PropetyListingId, YoutubeVideoLink = model.YoutubeVideoLink }; db.ProprtyListingYoutubeLibraries.Add(table); db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
private void CaptureListingAgents(PropertyListingAgentsView model, int PropetyListingId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.PropertyListingAgent table = new DataAccess.PropertyListingAgent() { PropertyListingId = PropetyListingId, IsActive = true, AgentId = model.AgentId }; db.PropertyListingAgents.Add(table); db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
public static BranchDetailsView DetailsNew(JazMax.DataAccess.JazMaxDBProdContext dbcon, int branchId) { AgentService bb = new AgentService(); var query = from a in dbcon.CoreBranches join b in dbcon.CoreTeamLeaders on a.CoreTeamLeaderId equals b.CoreTeamLeaderId join c in dbcon.CoreUsers on b.CoreUserId equals c.CoreUserId join d in dbcon.CoreProvinces on a.ProvinceId equals d.ProvinceId where a.BranchId == branchId select new CoreBranchView { BranchId = a.BranchId, EmailAddress = a.EmailAddress, IsActive = a.IsActive, StreetAddress = a.StreetAddress, BranchName = a.BranchName, City = a.City, CoreTeamLeaderId = a.CoreTeamLeaderId, Phone = a.Phone, ProvinceId = a.ProvinceId, ProvinceName = d.ProvinceName, Suburb = a.Suburb, TeamLeaderName = c.FirstName + " " + c.LastName }; List <AgentDetailsView> y = bb.GetMyAgentInBranch(branchId); BranchDetailsView bru = new BranchDetailsView() { AgentDetailsView = y, CoreBranchView = query.FirstOrDefault() }; return(bru); }
public void CapturePropertyImages(PropertyImagesView model, int PropertyListingId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.PropertyImage table = new DataAccess.PropertyImage() { PropertyImagesId = model.PropertyImagesId, PropertyListingId = PropertyListingId, BlobId = model.BlobId, IsActive = model.IsActive }; db.PropertyImages.Add(table); db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
public void Activation(bool isAction, int PropertyListingPricingTypeId, int UserId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.PropertyListingPricingType table = db.PropertyListingPricingTypes.FirstOrDefault(x => x.PropertyListingPricingTypeId == PropertyListingPricingTypeId); LoadEditLogDetails(table.PropertyListingPricingTypeId, UserId); if (table != null) { if (isAction) { JazMax.BusinessLogic.ChangeLog.ChangeLogService.LogChange( JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(table.IsActive), JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(true), "Active Status"); table.IsActive = true; } else { JazMax.BusinessLogic.ChangeLog.ChangeLogService.LogChange( JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(table.IsActive), JazMax.BusinessLogic.ChangeLog.ChangeLogService.GetBoolString(false), "Active Status"); table.IsActive = false; } } db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }
private void CaptureListingDetail(PropertyListingDetailView model, int PropetyListingId) { try { using (JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext()) { DataAccess.PropertyListingDetail table = new DataAccess.PropertyListingDetail() { RatesAndTaxes = model.RatesAndTaxes, NumberOfBathRooms = model.NumberOfBathRooms, NumberOfBedrooms = model.NumberOfBedrooms, NumberOfGarages = model.NumberOfGarages, NumberOfSquareMeters = model.NumberOfSquareMeters, PropertyListingId = PropetyListingId, }; db.PropertyListingDetails.Add(table); db.SaveChanges(); } } catch (Exception e) { JazMax.BusinessLogic.AuditLog.ErrorLog.LogError(e, 0); } }