示例#1
0
        public async Task <ActionResult> ActivityLog(ActivitlogSearchInfo searchvm)
        {
            try
            {
                if (!string.IsNullOrEmpty(searchvm.SelectedController))
                {
                    int Textlength   = searchvm.SelectedController.Length;
                    int removelength = "Controller".ToString().Length;

                    string realText = searchvm.SelectedController.Substring(Textlength, removelength);
                    // string realText = Regex.Replace(searchvm.SelectedController, @"\([Controller]\)", "");
                    searchvm.SelectedController = realText;
                }
                var activitylogModel = await _activitylogQuery.SelectQuery("SpGetActivitlog  @UserId,@Controller,@StartDate,@EndDate", new SqlParameter("UserId", searchvm.SelectedUser), new SqlParameter("controller", searchvm.SelectedController), new SqlParameter("StartDate", searchvm.SelectedStartDate), new SqlParameter("EndDate", searchvm.SelectedEndDate)).ToListAsync();

                ViewData["SearchResult"] = activitylogModel;
                LoadViewDataForDropDownList();
                return(View(""));
            }
            catch (Exception ex)
            {
                _log.Error(ex);
                return(View("Error"));
            }
        }