public ActionResult AttendanceHistory(int PropID = 0, string PropName = "", bool IsEstate = false) { Models.AttendanceHistoryViewModel vm = new Models.AttendanceHistoryViewModel(); if (Session["CustomerID"] != null && (int)Session["CustomerID"] > 0) { if (PropID == 0) { PropID = (int)Session["SelectedPropertyID"]; } else { Session["SelectedPropertyID"] = PropID; Session["SelectedProperty"] = PropName; } if ((int)Session["UserType"] > 1 && !IsEstate) //get list of properties when not customer type { vm.PropListViewModel = new Models.ServiceChargeBudgetViewModel(); vm.PropListViewModel.PropertyList = Models.PropertyMethods.GetAllEstates(); vm.PropListViewModel.ControllerName = "Caretaking"; vm.PropListViewModel.ViewName = "AttendanceHistory"; Session["SelectedPropertyID"] = 0; } else if (PropID == 0 && (int)Session["UserType"] == 1) //display unit list where is customer type and property not selected { vm.PropListViewModel = new Models.ServiceChargeBudgetViewModel(); vm.PropListViewModel.PropertyList = Models.PropertyMethods.GetAllOwnedProperties((int)Session["CustomerID"]); vm.PropListViewModel.ControllerName = "Caretaking"; vm.PropListViewModel.ViewName = "ViewAttendanceHistory"; } else if (PropID > 0 && (int)Session["UserType"] == 1) { //this point propid will be unit id. need estateid Models.Estates es = Models.EstateMethods.GetEstatedByUnitID(PropID); vm.SetAttendanceList(es.EstatedID); } else if ((int)Session["UserType"] > 1 && PropID > 0 && IsEstate) //colleague and estate selected{ { vm.SetAttendanceList(PropID); } else { vm.SelectedPropertyid = PropID; vm.SetAttendanceList(); } return(View("ViewAttendanceHistory", vm)); } else { return(View("../Home/NotLoggedIn")); } }
public ViewResult AttendanceDetail(int VisitID = 0, bool isStatic = false, string guid = "") { if (isStatic) { //not logged in - must have guid and id if (!string.IsNullOrWhiteSpace(guid) && VisitID > 0) { Models.AttendanceHistoryViewModel vm1 = new Models.AttendanceHistoryViewModel(); vm1.GetVisit(VisitID); vm1.FromApp = true; // return View("ViewAttendanceHistory", vm); return(View(vm1)); } else { return(View("NotFound")); } } else { if (Session["CustomerID"] != null && (int)Session["CustomerID"] > 0) { if (VisitID > 0) { Models.AttendanceHistoryViewModel vm = new Models.AttendanceHistoryViewModel(); vm.FromApp = isStatic; vm.GetVisit(VisitID); return(View(vm)); } else { return(View("NotFound")); } } else { return(View("../Home/NotLoggedIn")); } } }