Exemple #1
0
        public ActionResult getArealist(int ID)
        {
            CustomeDbContext db = new CustomeDbContext();

            db.Configuration.ProxyCreationEnabled = false;
            return(Json(db.Areas.Where(a => a.CityId == ID), JsonRequestBehavior.AllowGet));
        }
Exemple #2
0
        public JsonResult GetStateList(int ID)
        {
            CustomeDbContext db = new CustomeDbContext();

            db.Configuration.ProxyCreationEnabled = false;
            return(Json(db.States.Where(k => k.CountryId == ID), JsonRequestBehavior.AllowGet));
        }
Exemple #3
0
        public ActionResult GetCityList(int ID)
        {
            CustomeDbContext db = new CustomeDbContext();

            db.Configuration.ProxyCreationEnabled = false;
            return(Json(db.City.Where(m => m.StateId == ID), JsonRequestBehavior.AllowGet));

//return Json(result, JsonRequestBehavior.AllowGet);
        }
        //from here customer dashboard starts
        public ActionResult CustomerDashboard(int id)
        {
            CustomeDbContext db = new CustomeDbContext();

            ViewBag.userapproved = iUnitOfWork.Repository <PropertyDetail>().GetMany(k => k.UserId == id).Where(k => k.Approved == true && k.Approved != false).Count();

            ViewBag.pendindapprove = iUnitOfWork.Repository <PropertyDetail>().GetMany(r => r.UserId == id).Where(k => k.Approved == false).Count();

            ViewBag.newenquiry = iUnitOfWork.Repository <PropertyDetail>().GetMany(m => m.UserId == id).Count();

            return(View());
        }
        public ActionResult ApprovedProperty(System.Web.Mvc.FormCollection formcollection)
        {
            CustomeDbContext db = new CustomeDbContext();

            string[] ids = formcollection["UserID"].Split(new char[] { ',' });
            foreach (string id in ids)
            {
                var list1 = iUnitOfWork.Repository <PropertyDetail>().GetById(int.Parse(id));
                list1.Approved = false;
                iUnitOfWork.Commit();
            }
            var list = iUnitOfWork.Repository <PropertyDetail>().GetMany((k => k.Approved == true && k.Approved != false));

            return(RedirectToAction("AdminDashboard"));
        }
        public ActionResult AdminDashboard()
        {
            CustomeDbContext db = new CustomeDbContext();

            IList <Users> UserList = new List <Users>();

            ViewBag.UserList = iUnitOfWork.Repository <Users>().GetAll().ToList().Count();

            //IList<PropertyDetail> pendingapproved = new List<PropertyDetail>();
            // ViewBag.approved = pendingapproved.Where(x => x.Approved == null).Count() == 0 ? 0 : pendingapproved.Where(x => x.Approved == null).Count();

            ViewBag.approved   = iUnitOfWork.Repository <PropertyDetail>().GetMany((k => k.Approved == false && k.Approved != true)).Count();
            ViewBag.Unapproved = iUnitOfWork.Repository <PropertyDetail>().GetMany((k => k.Approved == true && k.Approved != false)).Count();
            ViewBag.salescount = db.ContractTypes.Select(k => k.Id == 1).Count();
            ViewBag.rentcount  = db.ContractTypes.Select(k => k.Id == 2).Count();

            ViewBag.propertyRequest = db.PropertyRequests.Count();
            var dateCriteria = DateTime.Now.Date.AddDays(-7);

            ViewBag.newlisting = iUnitOfWork.Repository <PropertyRequest>().GetMany(r => r.CreatedDate >= dateCriteria).Count();

            return(View());
        }
Exemple #7
0
 public Repository(CustomeDbContext DbContext)
 {
     this.DbContext = DbContext;
 }