Example #1
0
        public JsonResult DeleteRoomRole()
        {
            int    userid  = -1;
            string token   = string.Empty;
            string message = "";
            bool   result  = false;

            if (GetToken(out userid, out token))
            {
                string   roomId      = Request.Form["roomId"];
                string   roomAdminId = Request.Form["roomAdminId"];
                string   roomDirId   = Request.Form["roomDirId"];
                DSClient client      = new DSClient(Models.Const.ApplicationId);
                try
                {
                    client.DeleteRoomRole(userid, token, int.Parse(roomId), int.Parse(roomAdminId), BuiltIns._9258RoomAdministratorRole.Id);
                    client.DeleteRoomRole(userid, token, int.Parse(roomId), int.Parse(roomDirId), BuiltIns._9258RoomDirectorRole.Id);
                    result = true;
                }
                catch (DatabaseException ex)
                {
                    message = ex.Message;
                }
            }
            return(Json(new { Success = result, Message = message }, JsonRequestBehavior.AllowGet));
        }