Ejemplo n.º 1
0
 public IHttpActionResult GetUserLocationsInfo(Models.SearchParams search)
 {
     return(GetJsonResult(new Models.BaseResponse()
     {
         ResponseObject = new MiddelLayer.Users().GetLocation(search),
         Message = "Records fetched successfully."
     }));
 }
Ejemplo n.º 2
0
 public IHttpActionResult GetChatSetting(Models.SearchParams search)
 {
     return(GetJsonResult(new Models.BaseResponse()
     {
         ResponseObject = new MiddelLayer.ChatMessage().GetSetting(search),
         Message = "Chat list fetched successfully.",
         StatusCode = 200
     }));
 }
Ejemplo n.º 3
0
 public IHttpActionResult GetSettings(Models.SearchParams search)
 {
     return(GetJsonResult(new Models.BaseResponse()
     {
         ResponseObject = new MiddelLayer.AppUserSettings().Get(search),
         Message = "Settings updated successfully.",
         StatusCode = 200
     }));
 }
        public ActionResult Search(Models.SearchParams Params)
        {
            //инициализируем строки если они пустые
            if (Params.NamePattern == null)
            {
                Params.NamePattern = "";
            }
            if (Params.OwnerNamePattern == null)
            {
                Params.OwnerNamePattern = "";
            }

            //проверяем роль
            if (!User.IsInRole("Admin"))
            {
                return(Redirect("~/"));
            }

            //осуществляем поиск
            List <Models.FileModel> files = new List <Models.FileModel>();

            foreach (FileEntity f in Logic.GetAllFiles())
            {
                if (f.Extension != "folder" && f.Name.Contains(Params.NamePattern) &&
                    f.Owner.Name.Contains(Params.OwnerNamePattern))
                {
                    files.Add(new Models.FileModel(f));
                }
            }

            //сохраняем параметры поиска
            ViewBag.NamePattern      = Params.NamePattern;
            ViewBag.OwnerNamePattern = Params.OwnerNamePattern;
            ViewBag.Searching        = 1;
            return(View(files));
        }