protected void Page_Load(object sender, EventArgs e) { entities = new PropertyDbEntities(); int ID = Convert.ToInt32(Request.QueryString["PropertyID"]); PropertyDetail obj = entities.PropertyDetails.Where(x => x.PropertyID == ID).FirstOrDefault(); //lblPrice.Text = obj.Price.ToString(); PropertyLocation propertyLoc = entities.PropertyLocations.Where(x => x.PropertyID == obj.PropertyID).FirstOrDefault(); lblAddress.Text = propertyLoc.Address + propertyLoc.City + propertyLoc.Region; lblType.Text = entities.PropertyTypes.Where(x => x.TypeID == obj.TypeID).Select(y => y.Type).FirstOrDefault().ToString(); lblSubType.Text = entities.PropertySubtypes.Where(x => x.TypeID == obj.TypeID).Select(y => y.Subtype).FirstOrDefault().ToString(); lblSize.Text = obj.Size.ToString(); lblFloorLvl.Text = obj.FloorLevel.ToString(); lblTenure.Text = entities.PropertyTenures.Where(x => x.TenureID == obj.TenureID).Select(y => y.TenureType).FirstOrDefault().ToString(); lblDev.Text = obj.Developer.ToString(); lblListDate.Text = obj.ListedDate.ToString(); lblMRT.Text = obj.MRT.ToString(); lblSchool.Text = obj.School.ToString(); lblChildcare.Text = obj.ChildCare.ToString(); lblDesc.Text = obj.Description.ToString(); }
public PropertyDetail AddPDetail(PropertyDetail detail) { if (detail.RDate != null && detail.RTime != null) { var date = DateTime.MinValue; if (DateTime.TryParse($"{detail.RDate}T{detail.RTime}", out date)) { detail.RemainderDate = date; } } var r = StaticFunctions.Request( "Farms/Properties/Details/", JsonConvert.SerializeObject(detail), HttpMethod.Post, User.FindFirst(claim => claim.Type == "Token")?.Value ); if (detail.ExpenseFlag && detail.Cost != null && detail.Cost != 0) { var r2 = AddExpense(new IncomeAndExpeneses { Fuid = new Guid(Sessions.CurrentFarmUID), Cost = (decimal)detail.Cost, Date = DateTime.Now, Head = detail.Name, Description = detail.Description }); } if (r != null) { var _detail = JsonConvert.DeserializeObject <PropertyDetail>(r); return(_detail); } return(null); }
public override void ViewWillAppear(bool animated) { base.ViewWillAppear(animated); propertyManager = new PropertyMangager(); if (currentPropertyId > 0) { propertyDetail = propertyManager.GetItemAsync(currentPropertyId.ToString()).Result; byte[] imageBytes = null; imageBytes = propertyManager.GetImageAsync(propertyDetail.Image).Result; //ImageHelper.SetImage(imageBytes, propertyDetail.ListingID, PropertyImage, 150); ImageHelper.SetImage(propertyManager, propertyDetail.ListingID, propertyDetail.Image, PropertyImage); AddressLabel.Text = propertyDetail.Address; BedsLabel.Text = string.Format("Beds: {0}", propertyDetail.Beds); BathsLabel.Text = string.Format(", Baths: {0}", propertyDetail.Baths); EstimatedValueLabel.Text = string.Format(", {0:C}, ", propertyDetail.EstimatedValue); RateChangeLabel.Text = string.Format("{0}%", Convert.ToString(propertyDetail.ChangeOverLastYear)); FeatureText.Text = propertyDetail.Features; if (Convert.ToDouble(propertyDetail.ChangeOverLastYear) < 0) { RateChangeLabel.TextColor = UIColor.Red; } } }
public IHttpActionResult PutPropertyDetail(int id, PropertyDetail propertyDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != propertyDetail.Id) { return(BadRequest()); } db.Entry(propertyDetail).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!PropertyDetailExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public async Task <ActionResult <PropertyDetail> > PostPropertyDetail(PropertyDetail propertyDetail) { _context.PropertyDetails.Add(propertyDetail); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPropertyDetail", new { id = propertyDetail.Id }, propertyDetail)); }
public void Property_Extraction() { PropertyDetail pi = ExtractProperty(Subjects.One, "BasicClass", "SimplePublicProperty"); Assert.AreEqual(Status.Present, pi.Status); Assert.AreEqual("public string SimplePublicProperty", pi.ToString()); }
/// <summary> /// OnCreate /// </summary> /// <param name="savedInstanceState"></param> protected async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); progress = ProgressDialog.Show(this, "Loading", "Please Wait...", true); //propertyManager = TinyIoC.TinyIoCContainer.Current.Resolve<IPropertyMangager>(); propertyManager = Mvx.GetSingleton <IPropertyMangager>(); // propertyManager = new PropertyMangager(); int listingID = Intent.GetIntExtra("ListingID", 0); if (listingID > 0) { propertydetail = await propertyManager.GetItemAsync(listingID.ToString()); } SetContentView(Resource.Layout.PropertyDetailView); if (propertydetail != null) { BindFields(); } if (CrossConnectivity.Current.IsConnected) { SQLLiteHelper.InsertPropertyDetails(propertydetail); } if (progress != null) { progress.Hide(); } }
public void Property_WithAttributes() { PropertyDetail pi = ExtractProperty(Subjects.One, "BasicClass", "PropertyWithAttribute"); Assert.AreEqual(Status.Present, pi.Status); CheckForAttribute(pi); }
public async Task <IActionResult> AddPropertyDetails([FromBody] PropertyDetail propertyDetail) { try { if (propertyDetail == null) { return(_hTTPResponseManager.ReturnHTTPResponse("Model Class can not be null, please check your request body", HttpStatusCode.BadRequest)); } if (!ModelState.IsValid) { string modelErrorMessage = string.Join(" | ", ModelState.Values .SelectMany(v => v.Errors) .Select(e => e.ErrorMessage)); return(_hTTPResponseManager.ReturnHTTPResponse(modelErrorMessage, HttpStatusCode.BadRequest)); } await _context.PropertyDetails.AddAsync(propertyDetail); await _context.SaveChangesAsync(); return(_hTTPResponseManager.ReturnHTTPResponse("Added successfully", HttpStatusCode.OK)); } catch (Exception ex) { return(_hTTPResponseManager.ReturnHTTPResponse("Failed because: {ex.Message}", HttpStatusCode.InternalServerError)); } }
public async Task <IActionResult> PutPropertyDetail(int id, PropertyDetail propertyDetail) { if (id != propertyDetail.Id) { return(BadRequest()); } _context.Entry(propertyDetail).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PropertyDetailExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public void Property_InternalSet() { PropertyDetail pi = ExtractProperty(Subjects.One, "BasicClass", "InternalSetProperty"); Assert.AreEqual(Status.Present, pi.Status); Assert.AreEqual("public string InternalSetProperty", pi.ToString()); // TODO exmaine description for accessors }
public ActionResult Create(PropertyDetail property) { var db = new ApnuGharEntities(); db.PropertyDetails.Add(property); db.SaveChanges(); return(RedirectToAction("Index")); }
protected PropertyDetail ExtractProperty(string assemblyFile, string typeName, string propertyName, DiffConfig config) { ClassDetail ci = ExtractClass(assemblyFile, typeName, config); PropertyDetail value = ListOperations.FindOrReturnMissing(ci.FilterChildren <PropertyDetail>(), propertyName); Log.Verbose("Extracted property : {0}", value); return(value); }
public ActionResult Self(LoanDetail loanDetail, PropertyDetail propertyDetail) { dbContext.LoanDetails.Add(loanDetail); var regid = Session["regId"]; //dbContext.PropertyDetails.Add(propertyDetail); dbContext.SaveChanges(); return(RedirectToAction("Index", "Loan")); }
private void AssertChange(string from, string name, ChangeType change, DiffConfig config) { PropertyDetail r1 = ExtractProperty(Subjects.One, from, name, config); PropertyDetail r2 = ExtractProperty(Subjects.Two, from, name, config); Align(r1, r2); Assert.AreEqual(change, r2.PerformCompare(r1)); }
public string CreatePropertyDetail(string propertyReference, PropertyDetail propertyDetail) { var result = _propertyDetailService.CreatePropertyDetail(propertyReference, propertyDetail); if (!result.IsNullOrEmpty()) _autoAdvertiseService.AdvertiseProperty(propertyReference); return result; }
public bool UpdatePropertyDetail(string propertyReference, string propertyDetailReference, PropertyDetail propertyDetail) { var result = _propertyDetailService.UpdatePropertyDetail(propertyReference, propertyDetailReference, propertyDetail); if (result) _autoAdvertiseService.AdvertiseProperty(propertyReference); return result; }
public string CreatePropertyDetail(string propertyReference, PropertyDetail propertyDetail) { Check.If(propertyReference).IsNotNullOrEmpty(); Check.If(propertyDetail).IsNotNull(); var result = _propertyDetailRepository.CreatePropertyDetail(propertyReference, propertyDetail.CreateReference(_referenceGenerator)); return result ? propertyDetail.PropertyDetailReference : null; }
public ActionResult addprop() { PropertyDetail pk = new PropertyDetail(); pk.OwnerID = Convert.ToInt32(Session["Id"]); return(View(pk)); }
public bool UpdatePropertyDetail(string propertyReference, string propertyDetailReference, PropertyDetail propertyDetail) { Check.If(propertyReference).IsNotNullOrEmpty(); Check.If(propertyDetailReference).IsNotNullOrEmpty(); Check.If(propertyDetail).IsNotNull(); var result = _propertyDetailRepository.UpdatePropertyDetail(propertyReference, propertyDetailReference, propertyDetail); return result; }
public IHttpActionResult GetPropertyDetail(int id) { PropertyDetail propertyDetail = db.PropertyDetails.Find(id); if (propertyDetail == null) { return(NotFound()); } return(Ok(propertyDetail)); }
/// <summary> /// InsertPropertyDetails /// </summary> /// <param name="propertyDetail"></param> public static void InsertPropertyDetails(PropertyDetail propertyDetail) { using (var propertyRepository = new PropertyRepository(new SQLiteInfoMonodroid())) { var detail = propertyRepository.GetPropertyDetailById(propertyDetail.ListingID); if (detail.Result == null) { propertyRepository.InsertPropertyDetail(propertyDetail); } } }
public IHttpActionResult PostPropertyDetail(PropertyDetail propertyDetail) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.PropertyDetails.Add(propertyDetail); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = propertyDetail.Id }, propertyDetail)); }
public ActionResult upload(int propid = 0) { ViewBag.testid = propid; PropertyDetail pd = db.PropertyDetails.Find(propid); if (pd == null) { return(HttpNotFound()); } return(View(pd)); }
public ActionResult addprop(PropertyDetail pa) { if (ModelState.IsValid) { db.PropertyDetails.Add(pa); db.SaveChanges(); return(RedirectToAction("upload", new { propid = pa.PropertyID })); } return(View(pa)); }
public IHttpActionResult DeletePropertyDetail(int id) { PropertyDetail propertyDetail = db.PropertyDetails.Find(id); if (propertyDetail == null) { return(NotFound()); } db.PropertyDetails.Remove(propertyDetail); db.SaveChanges(); return(Ok(propertyDetail)); }
/// <summary> /// Get property detail by id /// </summary> /// <param name="id"></param> /// <returns></returns> public async Task <PropertyDetail> GetItemAsync(string id) { PropertyDetail propertyDetail = new PropertyDetail(); try { var propertyRepository = Mvx.GetSingleton <PropertyRepository>(); propertyDetail = await propertyRepository.GetPropertyDetailById(Convert.ToInt32(id)); } catch (Exception ex) { throw; } return(propertyDetail); }
public void EndToEnd_ChildrenOfAddedItem() { PropertyDetail pd1 = ExtractProperty(Subjects.One, "BasicClass", "PropertyAdded"); PropertyDetail pd2 = ExtractProperty(Subjects.Two, "BasicClass", "PropertyAdded"); Align(pd1, pd2); pd2.PerformCompare(pd1); Assert.AreEqual(ChangeType.Added, pd2.Change); foreach (ICanCompare child in pd2.FilterChildren <ICanCompare>()) { Assert.AreEqual(ChangeType.Added, child.Change); } }
public bool CreatePropertyDetail(string propertyReference, PropertyDetail propertyDetail) { if (string.IsNullOrEmpty(propertyReference)) return false; var property = _propertiesContext.Properties.Active() .Include(p => p.PropertyDetails) .FirstOrDefault(x => x.PropertyReference == propertyReference); if (property == null) return false; property.PropertyDetails.Add(propertyDetail); return _propertiesContext.SaveChanges() > 0; }
public ActionResult upload(HttpPostedFileBase[] files, int propid = 0) { string filepathtosave; PropertyDetail pm = db.PropertyDetails.Find(propid); //AddImageViewModel model1; try { /*Lopp for multiple files*/ foreach (HttpPostedFileBase file in files) { /*Geting the file name*/ string filename = System.IO.Path.GetFileName(file.FileName); /*Saving the file in server folder*/ file.SaveAs(Server.MapPath("~/Content/Images/" + filename)); filepathtosave = "~/Content/Images/" + filename; //ViewBag.retpath = filepathtosave; ViewBag.retpath = Url.Content(filepathtosave); /*HERE WILL BE YOUR CODE TO SAVE THE FILE DETAIL IN DATA BASE*/ //@Html.EditorFor(m=>m.LastImage=); var imageURL = Url.Content("~/Content/Images/" + filename); ViewData["ImageURL"] = imageURL; pm.Images = imageURL; pm.Views = 1; pm.Images = imageURL; db.SaveChanges(); return(RedirectToAction("TypeQues", new { proid = pm.PropertyID })); } ViewBag.Message = "file has been uploaded"; } catch { filepathtosave = null; ViewBag.Message = "cannot save the data"; } return(View()); }
public HttpResponseMessage Post([FromBody] PropertyDetail propertydetail) { try { using (TrustyloandbEntities entities = new TrustyloandbEntities()) { entities.Configuration.ProxyCreationEnabled = false; entities.PropertyDetails.Add(propertydetail); entities.SaveChanges(); var message = Request.CreateResponse(HttpStatusCode.Created, propertydetail); message.Headers.Location = new Uri(Request.RequestUri + propertydetail.ID.ToString()); return(message); } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex)); } }
public HttpResponseMessage Put(int id, [FromBody] PropertyDetail propertydetail) { try { using (TrustyloandbEntities entities = new TrustyloandbEntities()) { var entity = entities.PropertyDetails.FirstOrDefault(e => e.P_ID == id); if (entity == null) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "Person with P_Id " + id.ToString() + " Not Found!")); } else { entity.Ag_Prop_Type = propertydetail.Ag_Prop_Type; entity.Ag_Prop_Classif = propertydetail.Ag_Prop_Classif; entity.Ag_Building_Age = propertydetail.Ag_Building_Age; entity.Ag_Market_Value = propertydetail.Ag_Market_Value; entity.Ag_Regis_Value = propertydetail.Ag_Regis_Value; entity.Ag_Prop_Land_Area = propertydetail.Ag_Prop_Land_Area; entity.Ag_Buildup_Area = propertydetail.Ag_Buildup_Area; entity.Ag_Prop_Addr = propertydetail.Ag_Prop_Addr; entity.Ag_Landmark = propertydetail.Ag_Landmark; entity.Ag_Pin = propertydetail.Ag_Pin; entity.Ag_City = propertydetail.Ag_City; entity.Ag_State = propertydetail.Ag_State; entity.Ag_Country = propertydetail.Ag_Country; entity.Ag_Rev_Mortage = propertydetail.Ag_Rev_Mortage; entity.Ag_Lumpsum_Amount = propertydetail.Ag_Lumpsum_Amount; entity.Ag_Annuity_Periodicity = propertydetail.Ag_Annuity_Periodicity; entities.SaveChanges(); return(Request.CreateResponse(HttpStatusCode.OK)); } } } catch (Exception ex) { return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex)); } }
public ActionResult locationview(int id = 0) { SampleDBContext1 dbo = new SampleDBContext1(); PropertyDetail iy = new PropertyDetail(); var zzz = (from u in dbo.PropertyDetails where u.PropertyID.Equals(id) select u).FirstOrDefault(); zzz.Views = zzz.Views + 1; dbo.SaveChanges(); PropertyDetail st = db.PropertyDetails.Find(id); return(View(st)); }
public ActionResult bookprop(int ido) { PropertyDetail nh = db.PropertyDetails.Find(ido); BiddingProperty hu = new BiddingProperty(); PropertyQuestion pq = db.PropertyQuestions.Find(ido); hu.PropertyId = ido; hu.ClientId = Convert.ToInt32(Session["Id"]); ViewBag.ques1 = pq.Question1; ViewBag.ques2 = pq.Question2; ViewBag.ques3 = pq.Question3; ViewBag.ques4 = pq.Question4; return(View(hu)); }
public ActionResult Others(PropertyDetail propertyDetail, RegisteredUser registeredUser, HttpPostedFileBase IdProofDoc, HttpPostedFileBase AddressProofDoc, HttpPostedFileBase PropertyAgreementDoc) { var userName = dbContext.RegisteredUsers.SingleOrDefault(c => c.vEmailID == registeredUser.vEmailID && c.vPassword == registeredUser.vPassword); byte[] bytes; using (BinaryReader br = new BinaryReader(IdProofDoc.InputStream)) { bytes = br.ReadBytes(IdProofDoc.ContentLength); } byte[] bytes2; using (BinaryReader br2 = new BinaryReader(AddressProofDoc.InputStream)) { bytes2 = br2.ReadBytes(AddressProofDoc.ContentLength); } byte[] bytes3; using (BinaryReader br3 = new BinaryReader(PropertyAgreementDoc.InputStream)) { bytes3 = br3.ReadBytes(PropertyAgreementDoc.ContentLength); } int pId = propertyDetail.Id; dbContext.PropertyDetails.Add(new PropertyDetail { IdProof = bytes, AddressProof = bytes2, PropertyAgreement = bytes3, vPropertyHolderName = propertyDetail.vPropertyHolderName, vPropertyType = propertyDetail.vPropertyType, PropertyAddress = propertyDetail.PropertyAddress }); //dbContext.PropertyDetails.Add(propertyDetail); dbContext.SaveChanges(); var larId = dbContext.PropertyDetails.OrderByDescending(x => x.Id).Take(1).FirstOrDefault(); var regID = Session["regId"]; return(RedirectToAction("Self", "Loan", new { id = larId.Id, regisId = regID })); }
public bool UpdatePropertyDetail(string propertyReference, string propertyDetailReference, PropertyDetail propertyDetail) { var property = _propertiesContext.Properties.Active() .Include(p => p.PropertyDetails) .FirstOrDefault(x => x.PropertyReference == propertyReference); var existingPropertyDetail = property?.PropertyDetails.Active().FirstOrDefault(x => x.PropertyDetailReference == propertyDetailReference); if (existingPropertyDetail == null) return false; var isDirty = _propertyDetailMapper.Map(propertyDetail, existingPropertyDetail); return !isDirty || _propertiesContext.SaveChanges() > 0; }