Esempio n. 1
0
        public ActionResult AcceptProperty(int id)
        {
            BuyerProperty property = propertyBL.DisplayBuyerPropertyByID(id);

            propertyBL.AcceptRequest(property);
            return(View());
        }
Esempio n. 2
0
        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());
     }
 }
Esempio n. 5
0
        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();
            }
        }
Esempio n. 7
0
 //buyer
 public int Create(BuyerProperty buyerProperty)
 {
     return(propertyRepositary.Create(buyerProperty));
 }
Esempio n. 8
0
 public void AcceptRequest(BuyerProperty property)
 {
     propertyRepositary.AcceptRequest(property);
 }