Esempio n. 1
0
        public ActionResult AddMembers()
        {
            GroupMemberCreateModel gc = new GroupMemberCreateModel();

            gc.users = new List <string> {
                "smit",
            };
            gc.owner = "MMR";
            gc.id    = "MMRsdp";

            var tsk = ApiRequester.requestToApi(gc, (string)Session["auth"], "groups/add", HttpMethod.Post);

            tsk.Wait();
            var res    = tsk.Result;;
            var reader = res.Content.ReadAsStringAsync();

            reader.Wait();
            var data = reader.Result;
            var id   = JsonConvert.DeserializeObject(data);

            if ((bool)id)
            {
                TempData["gid"] = "True";
            }
            else
            {
                TempData["gid"] = "false";
            }
            TempData["stat"] = "Completed";


            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public ActionResult deleteGroup()
        {
            string id    = "LAST";
            string owner = "MMR";
            var    tsk   = ApiRequester.requestToApi((string)Session["auth"], "groups/remove/" + owner + "/" + id, HttpMethod.Delete);

            tsk.Wait();
            var res    = tsk.Result;;
            var reader = res.Content.ReadAsStringAsync();

            reader.Wait();
            var data = reader.Result;
            var stat = JsonConvert.DeserializeObject(data);

            if ((bool)stat)
            {
                TempData["gid"] = "True";
            }
            else
            {
                TempData["gid"] = "false";
            }
            TempData["stat"] = res.StatusCode.ToString();
            return(View("Index"));
        }
Esempio n. 3
0
        public ActionResult GetGroups()
        {
            string username = "******";
            bool   st       = true;
            var    tsk      = ApiRequester.requestToApi((string)Session["auth"], "groups/get/" + username + "/" + st, HttpMethod.Get);

            tsk.Wait();
            var res    = tsk.Result;;
            var reader = res.Content.ReadAsStringAsync();

            reader.Wait();
            var data = reader.Result;
            var stat = JsonConvert.DeserializeObject(data);

            if (stat == null)
            {
                TempData["stat"] = "NULL";
            }
            else
            {
                foreach (var g in (List <GroupModel>)stat)
                {
                    TempData["gid"] += g.groupName + " ";
                }
            }
            TempData["stat"] = res.StatusCode.ToString();

            return(View("Index"));
        }
Esempio n. 4
0
        public ActionResult deleteFile()
        {
            string token    = "MM521RR521RR520";
            string id       = "MMRFirstGRPSystem.Random";
            string username = "******";

            var tsk = ApiRequester.requestToApi((string)Session["auth"], "groups/remove/file/" + id + "/" + username + "/" + token, HttpMethod.Delete);

            tsk.Wait();
            var res    = tsk.Result;;
            var reader = res.Content.ReadAsStringAsync();

            reader.Wait();
            var data = reader.Result;
            var stat = JsonConvert.DeserializeObject(data);

            if ((bool)stat)
            {
                TempData["gid"] = "True";
            }
            else
            {
                TempData["gid"] = "false";
            }
            TempData["stat"] = res.StatusCode.ToString();
            return(View("Index"));
        }
Esempio n. 5
0
        public ActionResult AckUser()
        {
            bool   st       = true;
            string username = "******";
            string id       = "MMRsdp";

            var tsk = ApiRequester.requestToApi(id, (string)Session["auth"], "groups/ack/" + username + "/" + st, HttpMethod.Post);

            tsk.Wait();
            var res    = tsk.Result;;
            var reader = res.Content.ReadAsStringAsync();

            reader.Wait();
            var data = reader.Result;
            var stat = JsonConvert.DeserializeObject(data);

            if ((bool)stat)
            {
                TempData["gid"] = "True";
            }
            else
            {
                TempData["gid"] = "false";
            }
            TempData["stat"] = res.StatusCode.ToString();

            return(View("Index"));
            //return RedirectToAction("Index");
        }