コード例 #1
0
        public ActionResult PropertyCreate(PropertyDetailsEdit PD)
        {
            //int id = PD.PropertyID;
            bool status = false;

            try
            {
                //if (ModelState.IsValid)
                //{
                PropertyDetailsAction pm = new PropertyDetailsAction();
                status = pm.insertProperty(PD);
                ModelState.Clear();
                //}
                //else { }
            }
            catch { }

            if (status == true)
            {
                CallListForPeoperty();
                ViewBag.Message = "Data Saved Sucessfuly";
                return(View());
            }
            else
            {
                CallListForPeoperty();
                ViewBag.Message = "Ah... somthing wrong, Please try after sometime";
                return(View());
            }
        }
コード例 #2
0
        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]));
        }
コード例 #3
0
        /// <summary>
        /// Property Action
        /// </summary>
        /// <returns></returns>
        ///
        public ActionResult PropertyList()
        {
            //GetPropertyData propertydata = new GetPropertyData();

            List <PropertyDetailsAll> data = new List <PropertyDetailsAll>();
            PropertyDetailsAction     gpd  = new PropertyDetailsAction();

            data = gpd.GetAllPropertyList();
            return(View(data));
        }
コード例 #4
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);
        }
コード例 #5
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]));
            }
        }