public ActionResult AcceptProperty(int id) { BuyerProperty property = propertyBL.DisplayBuyerPropertyByID(id); propertyBL.AcceptRequest(property); return(View()); }
public ActionResult Create(BuyerPropertyModel propertyModel, HttpPostedFileBase fileBase) { IEnumerable <PropertyType> propertyTypes = propertyBL.GetPropertyType(); ViewBag.propertyId = new SelectList(propertyTypes, "PropertyTypeID", "Type"); BuyerProperty property = new BuyerProperty(); propertyModel.UserId = (int)TempData["UserId"]; if (fileBase != null && fileBase.ContentLength > 0) { var fileName = Path.GetFileName(fileBase.FileName); var path = Path.Combine(Server.MapPath("~/App_Data/Images"), fileName); fileBase.SaveAs(path); } if (ModelState.IsValid) { propertyModel.Image = new byte[fileBase.ContentLength]; fileBase.InputStream.Read(propertyModel.Image, 0, fileBase.ContentLength); propertyModel.Status = "Reject"; property = AutoMapper.Mapper.Map <BuyerPropertyModel, BuyerProperty>(propertyModel); if (propertyBL.Create(property) > 0) { ViewBag.Message = "Your property registration is under processed"; } else { ViewBag.Message = "failed"; } } return(View()); }
public BuyerProperty DisplayBuyerPropertyByID(int id) { using (PropertyContext propertyContext = new PropertyContext()) { BuyerProperty buyerProperty = propertyContext.BuyerProperty.Find(id); return(buyerProperty); } }
//buyer public int Create(BuyerProperty buyerProperty) { using (PropertyContext propertyContext = new PropertyContext()) { propertyContext.BuyerProperty.Add(buyerProperty); return(propertyContext.SaveChanges()); } }
public ActionResult PropertyStatus() { int id = (int)TempData["UserId"]; BuyerProperty property = propertyBL.DisplayBuyerPropertyByID(id); TempData["Property"] = property; return(View()); }
public void AcceptRequest(BuyerProperty buyerProperty) { buyerProperty.Status = "Accept"; Property property = new Property(); property.PropertyId = buyerProperty.PropertyId; property.PropertyTypeID = buyerProperty.PropertyTypeID; property.UserId = buyerProperty.UserId; property.Image = buyerProperty.Image; property.Location = buyerProperty.Location; property.Price = buyerProperty.Price; property.Area = buyerProperty.Area; using (PropertyContext propertyContext = new PropertyContext()) { propertyContext.Property.Add(property); propertyContext.SaveChanges(); } }
//buyer public int Create(BuyerProperty buyerProperty) { return(propertyRepositary.Create(buyerProperty)); }
public void AcceptRequest(BuyerProperty property) { propertyRepositary.AcceptRequest(property); }