public void chiphidien_kh(Dictionary <string, string> dicPara, Dictionary <string, string> dicConfig) { for (int i = 0; i < 12; i++) { try { WS ws = new WS(); var json = ws.GetCP_CT(dicPara["usercode"], DateTime.Now.AddMonths(-i).Month, DateTime.Now.AddMonths(-i).Year, password); var dt = gn.ConvertJsonToDataTable(json, "dt"); if (dt != null && dt.Rows.Count > 0) { var prDt = new SqlParameter("@dt", SqlDbType.Structured); prDt.Value = dt; var parameters = new[] { prDt }; ExecuteSqlDataset("DNPC.AutoInsertChiPhiDienKh_New", parameters); } } catch (Exception ex) { WriterToFileLog(ex.Message); } } }