Ejemplo n.º 1
0
        public ActionResult AddItem(string groupID, string title, string method, string url, string header, string json)
        {
            var result = "0";

            if (!string.IsNullOrWhiteSpace(groupID) && !string.IsNullOrWhiteSpace(title) && !string.IsNullOrWhiteSpace(method) && !string.IsNullOrWhiteSpace(url))
            {
                title = HttpUtility.UrlDecode(title);

                url = HttpUtility.UrlDecode(url);

                if (title.Length <= 15 && url.Length <= 2083)
                {
                    if (!string.IsNullOrWhiteSpace(header))
                    {
                        header = HttpUtility.UrlDecode(header);
                    }

                    if (!string.IsNullOrWhiteSpace(json))
                    {
                        json = HttpUtility.UrlDecode(json);
                    }

                    RecordDataHelper.AddItem(groupID, title, method, url, header, json);

                    result = "1";
                }
            }
            return(Content(result));
        }
Ejemplo n.º 2
0
        public ActionResult GetList()
        {
            string groupID = string.Empty;

            HttpContext.Current.Request.Parmas.TryGetValue("groupID", out groupID);

            return(Content(RecordDataHelper.GetRightList(groupID)));
        }
Ejemplo n.º 3
0
        public ActionResult RemoveGroup(string groupID)
        {
            var result = "0";

            if (!string.IsNullOrWhiteSpace(groupID))
            {
                RecordDataHelper.RemoveGroup(groupID);

                result = "1";
            }
            return(Content(result));
        }
Ejemplo n.º 4
0
        public ActionResult AddGroup(string groupName)
        {
            var result = "0";

            if (!string.IsNullOrWhiteSpace(groupName))
            {
                RecordDataHelper.AddGroup(groupName);

                result = "1";
            }
            return(Content(result));
        }
Ejemplo n.º 5
0
        public ActionResult UpdateGroup(string groupID, string groupName)
        {
            var result = "0";

            if (!string.IsNullOrWhiteSpace(groupID) && !string.IsNullOrWhiteSpace(groupName))
            {
                groupName = SAEA.Http.HttpUtility.UrlDecode(groupName);

                RecordDataHelper.UpdateGroup(groupID, groupName);

                result = "1";
            }
            return(Content(result));
        }
Ejemplo n.º 6
0
        public ActionResult GetItem(string groupID, string itemID)
        {
            ListItem listItem = new ListItem();

            if (!string.IsNullOrWhiteSpace(groupID) && !string.IsNullOrWhiteSpace(itemID))
            {
                listItem = RecordDataHelper.GetItem(groupID, itemID);
            }

            if (listItem == null)
            {
                return(Content(string.Empty));
            }
            return(Json(listItem));
        }
Ejemplo n.º 7
0
        public ActionResult AddGroup(string groupName)
        {
            var result = "0";

            if (!string.IsNullOrWhiteSpace(groupName))
            {
                groupName = HttpUtility.UrlDecode(groupName);

                if (groupName.Length <= 13)
                {
                    RecordDataHelper.AddGroup(groupName);
                }
                result = "1";
            }
            return(Content(result));
        }
Ejemplo n.º 8
0
        public ActionResult AddItem(string groupID, string title, string method, string url, string json)
        {
            var result = "0";

            if (!string.IsNullOrWhiteSpace(groupID) && !string.IsNullOrWhiteSpace(title) && !string.IsNullOrWhiteSpace(method) && !string.IsNullOrWhiteSpace(url))
            {
                title = SAEA.Http.HttpUtility.UrlDecode(title);

                url = SAEA.Http.HttpUtility.UrlDecode(url);

                if (!string.IsNullOrWhiteSpace(json))
                {
                    json = SAEA.Http.HttpUtility.UrlDecode(json);
                }

                RecordDataHelper.AddItem(groupID, title, method, url, json);

                result = "1";
            }
            return(Content(result));
        }
Ejemplo n.º 9
0
        public ActionResult Import(string json)
        {
            var result = "0";

            try
            {
                if (!string.IsNullOrWhiteSpace(json))
                {
                    json = SAEA.Http.HttpUtility.UrlDecode(json);

                    var rd = Deserialize <RecordData>(json);

                    if (rd != null)
                    {
                        RecordDataHelper.Write(rd);

                        result = "1";
                    }
                }
            }
            catch { }

            return(Content(result));
        }
Ejemplo n.º 10
0
 public ActionResult GetGroups()
 {
     return(Content(RecordDataHelper.GetGroups()));
 }
Ejemplo n.º 11
0
 public ActionResult Export()
 {
     return(Json(RecordDataHelper.Read()));
 }
Ejemplo n.º 12
0
 public ActionResult Search(string keywords)
 {
     return(Content(RecordDataHelper.Search(keywords)));
 }