I'm working at a property management website. There are sold properties that i don't want to show to the users. What should I do with it? Should I make changes in the controller or the view?
This is my Sold properties controller code.
public ActionResult ViewSoldProperties()
{
ViewBag.Principles = db.UCDs.GetUCDs(UCLTypes.PropertyStatus).AsUcdSelectList();
var propertiesViewAll = db.Properties.Where(x => x.IsDeleted == false && x.Status == 2353).OrderByDescending(i => i.ID);
var ucds = db.UCDs.AsNoTracking().ActiveOnly().ToList();
foreach (var i in propertiesViewAll)
{
i.StatusName = ucds.Where(x => x.ID == i.Status).Select(t => t.Title).FirstOrDefault();
i.FinancingName = ucds.Where(x => x.ID == i.Financing).Select(t => t.Title).FirstOrDefault();
System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
client.BaseAddress = new Uri("http://gis.hcpafl.org/propertysearch/#/search/basic/address=" + i.StreetAddress + " " + i.RouteAddress + ", " + i.City);
//Address2 is used as base address
i.Address2 = client.BaseAddress.ToString();
var compId = db.BuyingInfoes.Where(x => x.PropertyID == i.ID).Select(x => x.CompanyID).FirstOrDefault();
if (compId != null)
{
var compAbbr = db.Owners.Where(x => x.ID == compId).Select(x => x.CompanyAbbreviation).FirstOrDefault();
if (compAbbr != null)
{
i.OwnerAbbriviation = compAbbr;
}
}
}
ViewBag.data = propertiesViewAll;
//if (NumberOfRecords != null)
//{
// return PartialView("PartialViewAll");
//}
return View();
Below are the images I want to hide from the customers on the live website.
These are the example images I don't want to show to the users