Exemplo n.º 1
0
        public ActionResult MySearches(string periodId, string typeName)
        {
            if (periodId == null || periodId == "" || string.IsNullOrEmpty(periodId))
            {
                periodId = "0";
            }

            var periodIdAsInt = int.Parse(periodId);
            var period        = (UserSearchDatePeriod)periodIdAsInt;

            if (typeName == null || typeName == "" || string.IsNullOrEmpty(typeName))
            {
                typeName = "All";
            }

            var type         = (UserSearchType)Enum.Parse(typeof(UserSearchType), typeName);
            int curProductId = 1;

            if (Session["SelectedProductId"] != null)
            {
                curProductId = int.Parse(Session["SelectedProductId"].ToString());
            }

            var model = UserSearches.GetSearchesFromDB(UserData.UserId, period, type, curProductId);

            return(Json(model));
        }
Exemplo n.º 2
0
        public ActionResult MySearches()
        {
            if (UserData.Username.ToLower() == "sysdemo")
            {
                if (ProductId == 1) // EuroCases
                {
                    return(RedirectToAction("ProductFeaturesInfo", "User", new { funcTypeId = (int)FunctionalityTypes.MySearches }));
                }
                else // Tax & Financial Standarts
                {
                    return(RedirectToAction("ProductFeaturesInfoFinances", "User", new { funcTypeId = (int)FunctionalityTypes.MySearches }));
                }
            }

            var userId = UserData.UserId;

            int curProductId = 1;

            if (Session["SelectedProductId"] != null)
            {
                curProductId = int.Parse(Session["SelectedProductId"].ToString());
            }

            var model = UserSearches.GetSearchesFromDB(userId, UserSearchDatePeriod.All, UserSearchType.All, curProductId);

            ViewData["UserSearchType"] = model.Filters.Type.ToSelectList();

            return(View(model));
        }