public ActionResult Create(NewListingView list, FormCollection collection) { int ProptyId = o.MainInsert(list, collection); for (int i = 0; i < Request.Files.Count; i++) { var file = Request.Files[i]; if (ModelState.IsValid) { if (file != null && file.ContentLength > 0) { int BlobIds = JazMax.Core.Blob.BlobStorageService.UploadToBlob("testimge", "test", file); PropertyImagesView table = new PropertyImagesView() { BlobId = BlobIds, PropertyListingId = ProptyId, }; o.CapturePropertyImages(table, ProptyId); } } } return(RedirectToAction("Index")); }
public IQueryable <NewListingView> GetPrimaryListingOK() { using (JazMax.DataAccess.JazMaxDBProdContext db = new DataAccess.JazMaxDBProdContext()) { List <NewListingView> view = new List <NewListingView>(); #region Joins Query var query = (from a in db.PropertyListings join b in db.PropertyListingDetails on a.PropertyListingId equals b.PropertyListingId select new { a.PropertyListingId, a.FriendlyName, b.RatesAndTaxes, b.NumberOfBathRooms, b.NumberOfBedrooms, b.NumberOfGarages, b.NumberOfSquareMeters, }).ToList().AsQueryable(); #endregion foreach (var item in query) { #region Property Listing View PropertyListingView list = new PropertyListingView() { PropertyListingId = item.PropertyListingId, FriendlyName = item.FriendlyName, }; #endregion #region Details View PropertyListingDetailView details = new PropertyListingDetailView() { RatesAndTaxes = item.RatesAndTaxes, NumberOfBathRooms = item.NumberOfBathRooms, NumberOfBedrooms = item.NumberOfBedrooms, NumberOfGarages = item.NumberOfGarages, NumberOfSquareMeters = item.NumberOfSquareMeters, }; #endregion #region NewList NewListingView lists = new NewListingView() { PropertyListingView = list, PropertyListingDetailView = details, }; #endregion view.Add(lists); } return(view.AsQueryable()); } }
public PartialViewResult GetImages(NewListingView List, int id) { var query = o.GetPropertyImages(List, id); return(PartialView("_PropertyImages", query)); }
public PartialViewResult GetFeatures(NewListingView List, int id) { var query = o.GetFeatureOverview(List, id); return(PartialView("_PropertyFeatures", query)); }
public ActionResult UpdateListings(NewListingView list, int id) { o.MainUpdate(list, id); return(RedirectToAction("Index")); }
//private static JazMax.DataAccess.JazMaxDBProdContext db = new JazMax.DataAccess.JazMaxDBProdContext(); #region GetLists public IQueryable <NewListingView> GetPrimaryListing() { using (JazMax.DataAccess.JazMaxDBProdContext db = new DataAccess.JazMaxDBProdContext()) { List <NewListingView> view = new List <NewListingView>(); #region Joins Query var query = (from a in db.PropertyListings join b in db.PropertyListingAgents on a.PropertyListingId equals b.PropertyListingId join c in db.PropertyListingDetails on a.PropertyListingId equals c.PropertyListingId join d in db.ProprtyListingYoutubeLibraries on a.PropertyListingId equals d.PrfoprtyListingId join e in db.ProprtyListingFeatures on a.PropertyListingId equals e.PropertyListingId select new { a.PropertyListingId, a.BranchId, a.FriendlyName, a.ProprtyDesciption, a.IsListingActive, a.PropertyListingPricingTypeId, a.Price, a.PropertyTypeId, a.LastUpdate, a.ListingDate, a.ProvinceId, b.AgentId, b.IsActive, c.RatesAndTaxes, c.NumberOfBathRooms, c.NumberOfBedrooms, c.NumberOfGarages, c.NumberOfSquareMeters, d.YoutubeVideoLink, e.PropertyFeatureId, }).ToList().AsQueryable(); #endregion foreach (var item in query) { #region Property Listing View PropertyListingView list = new PropertyListingView() { PropertyListingId = item.PropertyListingId, BranchId = item.BranchId, FriendlyName = item.FriendlyName, IsListingActive = item.IsListingActive, PropertyListingPricingTypeId = item.PropertyListingPricingTypeId, Price = item.Price, PropertyTypeId = item.PropertyTypeId, LastUpdate = item.LastUpdate, ListingDate = item.ListingDate, ProvinceId = item.ProvinceId, ProprtyDesciption = item.ProprtyDesciption }; #endregion #region Agent View PropertyListingAgentsView agent = new PropertyListingAgentsView() { AgentId = item.AgentId, IsActive = item.IsActive, }; #endregion #region Details View PropertyListingDetailView details = new PropertyListingDetailView() { RatesAndTaxes = item.RatesAndTaxes, NumberOfBathRooms = item.NumberOfBathRooms, NumberOfBedrooms = item.NumberOfBedrooms, NumberOfGarages = item.NumberOfGarages, NumberOfSquareMeters = item.NumberOfSquareMeters, }; #endregion #region Youtube View PropertyListingYoutubeView youtube = new PropertyListingYoutubeView() { YoutubeVideoLink = item.YoutubeVideoLink, }; #endregion #region Features View PropertyListingFeatureView feature = new PropertyListingFeatureView() { PropertyFeatureId = item.PropertyFeatureId, }; #endregion #region NewList NewListingView lists = new NewListingView() { PropertyListingView = list, PropertyListingAgentsView = agent, PropertyListingDetailView = details, PropertyListingYoutubeView = youtube, PropertyListingFeatureView = feature, }; #endregion view.Add(lists); } return(view.AsQueryable()); } }