コード例 #1
0
 internal void Accept()
 {
     ApiConn.AcceptPetition(hubWindowVM.SelectedPetition, true);
     hubWindowVM.FriendPetitions.Remove(hubWindowVM.SelectedPetition);
     hubWindowVM.SelectedPetition = null;
     Beautifiers.ToastNotificator.ToastNotificator.ToastNotificatorControl.Content = null;
 }
コード例 #2
0
        public static async void AcceptPetitionResponse(ApiResponse response)
        {
            if ((int)response.StatusCode >= 200 && (int)response.StatusCode < 300)
            {
                await Task.Delay(100);

                ApiConn.GetFriends(Id);
            }
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: FlaviusAB/Sep3reexam
        private void SearchForParts_Click(object sender, EventArgs e)
        {
            string carManufactorer = carManufactorerTextBox.Text;
            string carModel        = carModelTextBox.Text;
            string carYear         = carYearTextBox.Text;
            string endPoint        = "http://localhost:51907/api/SearchForParts?carManufactorer=" + carManufactorer + "&carModel=" + carModel + "&carYear=" + carYear;

            ApiConn tier2 = new ApiConn(endPoint, httpVerb.GET);

            String json = tier2.makeRequest();

            DescriptionTextBox.Text = json;
        }
コード例 #4
0
        private async void RefreshFriends_Button_Click(object sender, RoutedEventArgs e)
        {
            ApiConn.GetFriends(Client.Id);
            await Task.Delay(100);

            ApiConn.GetGroups(Client.Id);
            await Task.Delay(100);

            ApiConn.GetPetitions(Client.Id);
            await Task.Delay(100);

            ApiConn.GetProfilePictureFromApiRest(Client.Nickname);
        }
コード例 #5
0
        public DataTable OpenApiSampleForJusoGoKr(string keyword, out string apiurlNcnt)
        {
            if (String.IsNullOrWhiteSpace(keyword))
            {
                apiurlNcnt = String.Empty;
                return(null);
            }

            ApiConn   api          = new ApiConn();
            string    currentPage  = "1";    //현재 페이지
            string    countPerPage = "1000"; //1페이지당 출력 갯수
            string    confmKey     = api.GetJusoGoKr();
            DataTable tblResult    = null;

            string apiurl = $"http://www.juso.go.kr/addrlink/addrLinkApi.do?currentPage={currentPage}&countPerPage={countPerPage}&keyword={keyword}&confmKey={confmKey}";

            apiurlNcnt = apiurl + "\r\n";

            try
            {
                WebClient wc = new WebClient();

                XmlReader read = new XmlTextReader(wc.OpenRead(apiurl));

                DataSet ds = new DataSet();
                ds.ReadXml(read);

                tblResult = ds.Tables[0];

                DataRow[] rows = ds.Tables[0].Select();

                apiurlNcnt += rows[0]["totalCount"].ToString();

                if (rows[0]["totalCount"].ToString() != "0")
                {
                    tblResult = ds.Tables[1].DefaultView.ToTable(false, new string[] { "roadAddrPart1", "roadAddrPart2", "ZipNo" });
                }
                else
                {
                    tblResult = null;
                }
            }
            catch (Exception)
            {
            }

            return(tblResult);
        }
コード例 #6
0
        // GET: api/SearchForParts/
        public string Get(String carManufactorer, String carModel, int carYear)
        {
            //supplier1 interface start here
            string endPoint = "http://localhost:8080/AutoPartsServerDatabaseTier3/api/rest/getpart/" + carManufactorer + "/" + carModel + "/" + carYear;

            //string endPoint = "http://localhost:8080/AutoPartsServerDatabaseTier3/api/rest/getpart?carManufactorer=" + carManufactorer +"&carModel="+ carModel +"&carYear="+ carYear;

            //Call GET method from Tier3 API
            ApiConn tier3 = new ApiConn(endPoint, httpVerb.GET);

            string  tempStr = tier3.makeRequest();
            JObject json    = JObject.Parse(tempStr);



            //Supplier interface 1 end here (move to external classes eventially) One class for each supplier interface (traslation to supplier database attribute names, encription ect"

            return(json);
        }