public ActionResult PropertyEdit(int ID) { //GetPropertyData propertydata = new GetPropertyData(); PropertyDetailsEdit datae = new PropertyDetailsEdit(); PropertyDetailsAction gpd = new PropertyDetailsAction(); datae.PropertyEdit = gpd.GetAllPropertyEdit(ID); CallListForPeoperty(); return(View(datae.PropertyEdit[0])); }
public ActionResult PropertyEdit(PropertyDetailsEdit PD) { PropertyDetailsEdit datae = new PropertyDetailsEdit(); PropertyDetailsAction gpd = new PropertyDetailsAction(); int id = PD.PropertyID; bool status = false; try { if (ModelState.IsValid) { PropertyDetailsAction pm = new PropertyDetailsAction(); status = pm.UpdateProperty(PD); ModelState.Clear(); } else { } } catch {} if (status == true) { datae.PropertyEdit = gpd.GetAllPropertyEdit(id); CallListForPeoperty(); ViewBag.Message = "Data Saved Sucessfuly"; return(View(datae.PropertyEdit[0])); } else { datae.PropertyEdit = gpd.GetAllPropertyEdit(id); CallListForPeoperty(); ViewBag.Message = "Ah... somthing wrong, Please try after sometime"; return(View(datae.PropertyEdit[0])); } }
public ActionResult DeleteImage(int ID) { //GetPropertyData propertydata = new GetPropertyData(); string pid = Request.QueryString["PropertyID"]; SqlCommand cmd = new SqlCommand("Delete from PropertyImage where ImageId=" + ID, conn); if (conn.State == ConnectionState.Closed) { conn.Open(); } cmd.ExecuteNonQuery(); PropertyDetailsEdit datae = new PropertyDetailsEdit(); PropertyDetailsAction gpd = new PropertyDetailsAction(); datae.PropertyEdit = gpd.GetAllPropertyEdit(ID); CallListForPeoperty(); return(RedirectToAction("UploadImages", "pmoadmin", new { id = pid })); //return View("UploadImage/"+pid); }