public async Task <APIResult> PostAsync(List <ExceptionRecordRequestDTO> exceptionRecordRequestDTO, CancellationToken ctoken = default(CancellationToken)) { token = appStatus.SystemStatus.Token; encodingType = EnctypeMethod.JSON; needSave = false; isCollection = true; routeUrl = $""; #region 要傳遞的參數 //Dictionary<string, string> dic = new Dictionary<string, string>(); WebQueryDictionary dic = new WebQueryDictionary(); // ---------------------------- 另外兩種建立 QueryString的方式 //dic.Add(Global.getName(() => memberSignIn_QS.app), memberSignIn_QS.app); //dic.AddItem<string>(() => 查詢資料QueryString.strHospCode); //dic.Add("Price", SetMemberSignUpVM.Price.ToString()); dic.Add(LOBGlobal.JSONDataKeyName, JsonConvert.SerializeObject(exceptionRecordRequestDTO)); #endregion var mr = await this.SendAsync(dic, HttpMethod.Post, ctoken); //mr.Success = false; //mr.Message = "測試用的錯誤訊息"; return(mr); }
public async Task <APIResult> PostAsync(List <ExceptionRecordDto> exceptionRecordRequestDTO, CancellationToken ctoken = default(CancellationToken)) { #region 指定此次呼叫 Web API 要執行參數 Token = appStatus.SystemStatus.Token; EnctypeMethod = EnctypeMethod.JSON; ApiResultIsCollection = true; Route = $"Collection"; #endregion #region 要傳遞的參數 //Dictionary<string, string> dic = new Dictionary<string, string>(); WebQueryDictionary dic = new WebQueryDictionary(); // ---------------------------- 另外兩種建立 QueryString的方式 //dic.Add(Global.getName(() => memberSignIn_QS.app), memberSignIn_QS.app); //dic.AddItem<string>(() => 查詢資料QueryString.strHospCode); //dic.Add("Price", SetMemberSignUpVM.Price.ToString()); dic.Add(LOBGlobal.JSONDataKeyName, JsonConvert.SerializeObject(exceptionRecordRequestDTO)); #endregion APIResult apiResult = await this.SendAsync(dic, HttpMethod.Post, ctoken); SetDefaultPersistentBehavior(); return(apiResult); }
public async Task <ManagerResult> GetAsync() { IsCollection = true; NeedSaveToStorage = true; EncodingType = EncodingMethod.JSON; #region 要傳遞的參數 WebQueryDictionary dic = new WebQueryDictionary(); #endregion var mr = await this.GetItemsFromNetAsync(dic, HttpMethod.Get); return(mr); }
public async Task <APIResult> GetAsync() { #region 指定此次呼叫 Web API 要執行參數 Token = ""; ApiResultIsCollection = true; EnctypeMethod = EnctypeMethod.JSON; Route = $""; #endregion #region 要傳遞的參數 WebQueryDictionary dic = new WebQueryDictionary(); #endregion APIResult apiResult = await this.SendAsync(dic, HttpMethod.Get, CancellationToken.None); SetDefaultPersistentBehavior(); return(apiResult); }
public async Task <APIResult> GetAsync(CancellationToken ctoken = default(CancellationToken)) { encodingType = EnctypeMethod.JSON; needSave = true; #region 要傳遞的參數 //Dictionary<string, string> dic = new Dictionary<string, string>(); WebQueryDictionary dic = new WebQueryDictionary(); // ---------------------------- 另外兩種建立 QueryString的方式 //dic.Add(Global.getName(() => memberSignIn_QS.app), memberSignIn_QS.app); //dic.AddItem<string>(() => 查詢資料QueryString.strHospCode); //dic.Add("Price", SetMemberSignUpVM.Price.ToString()); //dic.Add(LOBGlobal.JSONDataKeyName, JsonConvert.SerializeObject(loginRequestDTO)); #endregion var mr = await this.SendAsync(dic, HttpMethod.Get, ctoken); return(mr); }
public async Task <APIResult> PostAsync(LoginRequestDTO loginRequestDTO) { encodingType = EnctypeMethod.JSON; #region 要傳遞的參數 //Dictionary<string, string> dic = new Dictionary<string, string>(); WebQueryDictionary dic = new WebQueryDictionary(); // ---------------------------- 另外兩種建立 QueryString的方式 //dic.Add(Global.getName(() => memberSignIn_QS.app), memberSignIn_QS.app); //dic.AddItem<string>(() => 查詢資料QueryString.strHospCode); //dic.Add("Price", SetMemberSignUpVM.Price.ToString()); dic.Add(LOBGlobal.JSONDataKeyName, JsonConvert.SerializeObject(loginRequestDTO)); #endregion var mr = await this.SendAsync(dic, HttpMethod.Post, CancellationToken.None); //mr.Success = false; //mr.Message = "測試用的錯誤訊息"; return(mr); }
public async Task <APIResult> DeleteAsync(TravelExpenseDetailDto item) { #region 指定此次呼叫 Web API 要執行參數 Token = appStatus.SystemStatus.Token; ApiResultIsCollection = false; EnctypeMethod = EnctypeMethod.JSON; Route = $"{item.Id}"; #endregion #region 要傳遞的參數 WebQueryDictionary dic = new WebQueryDictionary(); dic.Add(LOBGlobal.JSONDataKeyName, JsonConvert.SerializeObject(item)); #endregion APIResult apiResult = await this.SendAsync(dic, HttpMethod.Delete, CancellationToken.None); SetDefaultPersistentBehavior(); return(apiResult); }
public async Task <APIResult> PostAsync(ProductDto item) { #region 指定此次呼叫 Web API 要執行參數 Token = LOBGlobal.AccessToken; ApiResultIsCollection = false; EnctypeMethod = EnctypeMethod.JSON; Route = $""; #endregion #region 要傳遞的參數 WebQueryDictionary dic = new WebQueryDictionary(); dic.Add(LOBGlobal.JSONDataKeyName, JsonConvert.SerializeObject(item)); #endregion APIResult apiResult = await this.SendAsync(dic, HttpMethod.Post, CancellationToken.None); SetDefaultPersistentBehavior(); return(apiResult); }
public async Task <APIResult> PostAsync(LoginRequestDto loginRequestDTO) { EnctypeMethod = EnctypeMethod.JSON; #region 要傳遞的參數 //Dictionary<string, string> dic = new Dictionary<string, string>(); WebQueryDictionary dic = new WebQueryDictionary(); // ---------------------------- 另外兩種建立 QueryString的方式 //dic.Add(Global.getName(() => memberSignIn_QS.app), memberSignIn_QS.app); //dic.AddItem<string>(() => 查詢資料QueryString.strHospCode); //dic.Add("Price", SetMemberSignUpVM.Price.ToString()); dic.Add(LOBGlobal.JSONDataKeyName, JsonConvert.SerializeObject(loginRequestDTO)); #endregion APIResult apiResult = await this.SendAsync(dic, HttpMethod.Post, CancellationToken.None); SetDefaultPersistentBehavior(); return(apiResult); }
public async Task <ManagerResult> PostAsync(LoginQueryString LoginQueryString) { IsCollection = false; NeedSaveToStorage = true; EncodingType = EncodingMethod.JSON; #region 要傳遞的參數 //Dictionary<string, string> dic = new Dictionary<string, string>(); WebQueryDictionary dic = new WebQueryDictionary(); // ---------------------------- 另外兩種建立 QueryString的方式 //dic.Add(Global.getName(() => memberSignIn_QS.app), memberSignIn_QS.app); //dic.AddItem<string>(() => 查詢資料QueryString.strHospCode); //dic.Add("Price", SetMemberSignUpVM.Price.ToString()); dic.Add("JSON", JsonConvert.SerializeObject(LoginQueryString)); #endregion var mr = await this.GetItemsFromNetAsync(dic, HttpMethod.Post); //mr.Success = false; //mr.Message = "測試用的錯誤訊息"; return(mr); }