private void GetAllProducts() { DateTime indbT = DateTime.Now; FuctionPack F = new FuctionPack(); DataTable DT = new DataTable(); GetDataDB(ref DT); for (int i = 0; i < DT.Rows.Count; i++) { string RequestApi = string.Format("http://localhost:50199/api/qrcode?QR_code='{0}'&QR_time='{1:yyyyMMdd}'", DT.Rows[i]["TK_QRCODE"].ToString(), DT.Rows[i]["TK_USED_DT"].ToString()); F.GetApiData(RequestApi); updatedb(F.obj, indbT, DT.Rows[i]["TK_QRCODE"].ToString(), DT.Rows[i]["TK_USED_DT"].ToString()); } }
private void GetAllProducts() { FuctionPack F = new FuctionPack(); string beginT = string.Format("{0:yyyy/MM/dd HH:00:00}", DateTime.Now); string endT = string.Format("{0:yyyy/MM/dd HH:00:00}", DateTime.Now.AddHours(1)); string RequestApi = string.Empty; string Pro_code = (string)checkBox1.Text.ToString(); string Pro_code2 = (string)checkBox2.Text.ToString(); if (checkBox2.Checked == true) { RequestApi = string.Format("http://localhost:54191/api/tic?Products_Code={0}|{1}&Orders_STIME={2}&Orders_ETIME={3}", Pro_code, Pro_code2, beginT, endT); } else { RequestApi = string.Format("http://localhost:54191/api/tic?Products_Code={0}&Orders_STIME={1}&Orders_ETIME={2}", Pro_code, beginT, endT); } DateTime indbT = DateTime.Now; F.GetApiData(RequestApi); insertdb(F.obj, indbT); }