private void Follow_Users(object sender, EventArgs e) { TJSONArray users = new TJSONArray(); if (listBox1.SelectedItems.Count != 0) { for (int i = 0; i < listBox1.SelectedItems.Count; i++) { int sindex = listBox1.Items.IndexOf(listBox1.SelectedItems[i]); if (sindex > -1) { if (CTConnection.getCurUserID() != UsersArray[sindex].UserID) { users.add(new TJSONString(UsersArray[sindex].UserID)); } //users.add(new TJSONString(listBox1.SelectedItems[i].ToString())); } } CTConnection.getLoginUserInstance().SetUsersToFollow(users, () => { this.Dispatcher.BeginInvoke(() => { this.NavigationService.Navigate(new Uri("/MainTweetPage.xaml", UriKind.Relative)); }); }); } else { this.Dispatcher.BeginInvoke(() => { this.NavigationService.Navigate(new Uri("/MainTweetPage.xaml", UriKind.Relative)); }); } }
/** * JSON representation of a TParam * * @return a JArray that represents a TParam */ public TJSONArray tojson() { TJSONArray arr = new TJSONArray(); arr.add(new TJSONString(getName())); arr.add(new TJSONNumber(getDataType())); arr.add(new TJSONNumber(getOrdinal())); arr.add(new TJSONNumber(getSubType())); arr.add(new TJSONNumber(getScale())); arr.add(new TJSONNumber(getSize())); arr.add(new TJSONNumber(getPrecision())); arr.add(new TJSONNumber(getChildPosition())); if (getNullable()) { arr.add(new TJSONTrue()); } else { arr.add(new TJSONFalse()); } if (getHidden()) { arr.add(new TJSONTrue()); } else { arr.add(new TJSONFalse()); } arr.add(new TJSONNumber(getParameterDirection())); if (getValueParameter()) { arr.add(new TJSONTrue()); } else { arr.add(new TJSONFalse()); } if (getLiteral()) { arr.add(new TJSONTrue()); } else { arr.add(new TJSONFalse()); } return(arr); }
private void Follow_Users(object sender, EventArgs e) { TJSONArray users = new TJSONArray(); if (listBox1.SelectedItems.Count != 0) { for (int i = 0; i < listBox1.SelectedItems.Count; i++) { users.add(new TJSONString(listBox1.SelectedItems[i].ToString())); } CTConnection.getCompanyTweet().SetUsersToFollow(users, () => { this.Dispatcher.BeginInvoke(() => { this.NavigationService.Navigate(new Uri("/MainTweetPage.xaml", UriKind.Relative)); }); }); } else { this.Dispatcher.BeginInvoke(() => { this.NavigationService.Navigate(new Uri("/MainTweetPage.xaml", UriKind.Relative)); }); } }
/** * JSON representation of a TParam * * @return a JArray that represents a TParam */ public TJSONArray tojson() { TJSONArray arr = new TJSONArray(); arr.add(new TJSONString(getName())); arr.add(new TJSONNumber(getDataType())); arr.add(new TJSONNumber(getOrdinal())); arr.add(new TJSONNumber(getSubType())); arr.add(new TJSONNumber(getScale())); arr.add(new TJSONNumber(getSize())); arr.add(new TJSONNumber(getPrecision())); arr.add(new TJSONNumber(getChildPosition())); if (getNullable()) arr.add(new TJSONTrue()); else arr.add(new TJSONFalse()); if (getHidden()) arr.add(new TJSONTrue()); else arr.add(new TJSONFalse()); arr.add(new TJSONNumber(getParameterDirection())); if (getValueParameter()) arr.add(new TJSONTrue()); else arr.add(new TJSONFalse()); if (getLiteral()) arr.add(new TJSONTrue()); else arr.add(new TJSONFalse()); return arr; }
private void LoadAccBookList() { CTConnection.getLoginUserInstance().GetAccListJSON(result => { this.Dispatcher.BeginInvoke(() => { lbAccBook.Items.Clear(); AccBookArray.Clear(); TJSONArray accbooks = result.getJSONArray("accbooks"); int i = 0; for (i = 0; i < accbooks.size(); i++) { TJSONObject AccItem = accbooks.getJSONObject(i); AccBookArray.Add(new AccBook(AccItem.getString("syaccbookcode"), AccItem.getString("syaccbookname"))); lbAccBook.Items.Add(AccItem.getString("syaccbookname")); } if (lbAccBook.Items.Count > 0) { lbAccBook.SelectedIndex = 0; } }); }, ManageExceptionCallback); }