Example #1
0
        public RootObject UserFind(string userid)
        {
            string  connectionLine;
            Connect conection = new Connect();

            connectionLine = "https://app.asana.com/api/1.0/users/" + userid;
            string result = conection.ConnectToLinq(connectionLine);
            DeserializeThiseJson deser   = new DeserializeThiseJson();
            RootObject           meClass = new RootObject();

            meClass = (RootObject)deser.DeserializeMe(result, meClass);
            return(meClass);
        }
Example #2
0
        public List <DatumWSR> WorkspacesFind()
        {
            string  connectionLine;
            Connect conection = new Connect();

            connectionLine = "https://app.asana.com/api/1.0/workspaces/";
            string result = conection.ConnectToLinq(connectionLine);
            DeserializeThiseJson deser        = new DeserializeThiseJson();
            WorkspacesRoot       meWorkspaces = new WorkspacesRoot();

            meWorkspaces = (WorkspacesRoot)deser.DeserializeMe(result, meWorkspaces);
            return(meWorkspaces.data);
        }
Example #3
0
        public List <Datum> ProjectsFind(string gidOfWS)
        {
            string  connectionLine;
            Connect conection = new Connect();

            connectionLine = "https://app.asana.com/api/1.0/workspaces/" + gidOfWS + "/projects";
            string result = conection.ConnectToLinq(connectionLine);
            DeserializeThiseJson deser = new DeserializeThiseJson();
            //*******только для одного запроса про пользователя**********
            RootObjectUsers meClass = new RootObjectUsers();

            meClass = (RootObjectUsers)deser.DeserializeMe(result, meClass);
            return(meClass.data);
        }
Example #4
0
        public DataTaskFull TasksFind(string gid)
        {
            string  fullLine = "/" + gid;
            string  connectionLine;
            Connect conection = new Connect();

            connectionLine = "https://app.asana.com/api/1.0/tasks" + fullLine + "?opt_fields=gid,assignee.name,completed,due_on,followers.name,name,notes,projects.name";
            string result = conection.ConnectToLinq(connectionLine);
            DeserializeThiseJson deser = new DeserializeThiseJson();
            //*******только для одного запроса про пользователя**********
            RootObjectTaskFull meClass = new RootObjectTaskFull();

            meClass = (RootObjectTaskFull)deser.DeserializeMe(result, meClass);
            return(meClass.data);
        }
Example #5
0
        public List <Datum> UsersFind()
        {
            string          connectionLine = "https://app.asana.com/api/1.0/users";
            Connect         conection      = new Connect();
            string          result         = conection.ConnectToLinq(connectionLine);
            RootObjectUsers meClassUSD     = new RootObjectUsers();

            try
            {
                DeserializeThiseJson deser = new DeserializeThiseJson();
                meClassUSD = (RootObjectUsers)deser.DeserializeMe(result, meClassUSD);
            }
            catch (Exception e)
            {
            }
            return(meClassUSD.data);
        }
Example #6
0
        private void button1_Click(object sender, EventArgs e)
        {
            //добавление в Asan'у
            Connect con = new Connect();
            Dictionary <string, string> paramsDic = new Dictionary <string, string>();

            paramsDic.Add("name", HttpUtility.UrlEncode(textBox1.Text));
            paramsDic.Add("notes", HttpUtility.UrlEncode(textBox2.Text));
            paramsDic.Add("assignee", listOfUsers[comboBox3.SelectedIndex].gid);
            paramsDic.Add("workspace", listOfWorkspaces[comboBoxWs.SelectedIndex].gid);
            paramsDic.Add("due_on", dateTimePicker1.Value.Date.ToString("yyyy-MM-dd"));
            string data = "";

            foreach (var item in paramsDic)
            {
                data += "&" + item.Key + "=" + item.Value;
            }
            data = data.Remove(0, 1);
            int itemCount = 0;

            foreach (var item in lbaFollower.DataStorage)
            {
                data += "&followers[" + itemCount + "]=" + item;
                itemCount++;
            }
            itemCount = 0;
            foreach (var item in lbaProjects.DataStorage)
            {
                data += "&projects[" + itemCount + "]=" + item;
                itemCount++;
            }

            string toDesert = con.DownloadToAsana(data);
            DeserializeThiseJson   desert       = new DeserializeThiseJson();
            RootObjectTaskResponse taskResponse = new RootObjectTaskResponse();

            taskResponse    = (RootObjectTaskResponse)desert.DeserializeMe(toDesert, taskResponse);
            label4.Text     = taskResponse.data.gid;
            button1.Visible = false;
        }