private void mSendBtn_Click(object sender, RoutedEventArgs e) { HttpHandler handler = new HttpHandler(mConsoleUrlBox.Text); switch (((ComboBoxItem)mHttpMethodBox.SelectedItem).Content.ToString()) { case "POST": handler.goSingleAsync <ConsoleCodeDownTransmissionType>(mPostParams.getObject <ConsoleCodeUpTransmissionType>(), "POST", handleHttpResponse); mHttpResponseBox.Text = "..."; break; case "GET": default: handler.goSingleAsync <ConsoleCodeDownTransmissionType>(mGetParams.getKeyPairs(), "GET", handleHttpResponse); mHttpResponseBox.Text = "..."; break; } }
private void Page_Loaded(object sender, RoutedEventArgs e) { mHttpMethodBox.SelectedIndex = 0; mPostParams.layObject(new ConsoleCodeUpTransmissionType()); mConsoleUrlBox.Text = DAO.sConsoleUrl; ConsoleCodeUpTransmissionType up = new ConsoleCodeUpTransmissionType(); up.mCode = "00T1"; up.mParamL = StdMd5Maker.toMd5String(DAO.sUserName + DAO.sPassword); HttpHandler handler = new HttpHandler(mConsoleUrlBox.Text); handler.goSingleAsync <ConsoleCodeDownTransmissionType>(up, "POST", handleHttpResponse); }
private void refreshTable() { this.Dispatcher.Invoke(new Action(delegate { mPicTable.Children.Clear(); })); HttpHandler handler = new HttpHandler(DAO.sConsoleUrl); ConsoleCodeUpTransmissionType up = new ConsoleCodeUpTransmissionType(); up.mCode = "11P1"; up.mParamL = StdMd5Maker.toMd5String(DAO.sUserName + DAO.sPassword); up.mParamU = "RPFP&" + (sPageSize * mPageNo).ToString() + "&" + sPageSize.ToString(); handler.goSingleAsync(up, "POST", new Action <ConsoleCodeDownTransmissionType, HttpHandlerException>( delegate(ConsoleCodeDownTransmissionType idDown, HttpHandlerException idE) { if (!idE.IsOK()) { this.Dispatcher.Invoke(new Action(delegate { mHttpState.Content = idE.getMessage(); })); return; } string[] idGrp = idDown.mServiceAnwser.Split('&'); Action onDelete = new Action(delegate { refreshTable(); }); foreach (string id in idGrp) { if (id.Equals("")) { break; } this.Dispatcher.Invoke(new Action(delegate { FlowerPicCtrl ctrl = new FlowerPicCtrl(Convert.ToInt32(id), onDelete); mPicTable.Children.Add(ctrl); })); } this.Dispatcher.Invoke(new Action(delegate { mHttpState.Content = "OK"; })); })); }
private void refreshTable() { List <AccountType> accountList = new List <AccountType>(); HttpHandler handler = new HttpHandler(DAO.sConsoleUrl); ConsoleCodeUpTransmissionType up = new ConsoleCodeUpTransmissionType(); up.mCode = "11P1"; up.mParamL = StdMd5Maker.toMd5String(DAO.sUserName + DAO.sPassword); up.mParamU = "RPAT&" + (sPageSize * mPageNo).ToString() + "&" + sPageSize.ToString(); handler.goSingleAsync(up, "POST", new Action <ConsoleCodeDownTransmissionType, HttpHandlerException>( delegate(ConsoleCodeDownTransmissionType idDown, HttpHandlerException idE) { if (!idE.IsOK()) { this.Dispatcher.Invoke(new Action(delegate { mHttpState.Content = idE.getMessage(); })); return; } string[] idGrp = idDown.mServiceAnwser.Split('&'); foreach (string id in idGrp) { if (id.Equals("")) { break; } AccountType account = new AccountType(Convert.ToInt32(id)); accountList.Add(account); } this.Dispatcher.Invoke(new Action(delegate { mAccountTable.ItemsSource = accountList; mHttpState.Content = "OK"; })); })); }