Пример #1
0
        public void chiphidien_vc(Dictionary <string, string> dicPara, Dictionary <string, string> dicConfig)
        {
            try
            {
                for (int i = 0; i < 12; i++)
                {
                    for (int ky = 1; ky <= 3; ky++)
                    {
                        try
                        {
                            WS  ws   = new WS();
                            var json = ws.GetCP_VC(dicPara["usercode"], DateTime.Now.AddMonths(-i).Month, DateTime.Now.AddMonths(-i).Year, ky, 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.AutoInsertChiPhiDienVoCong_New", parameters);
                            }
                        }
                        catch { }
                    }
                }
            }
            catch (Exception ex)
            {
                WriterToFileLog(ex.Message);
            }
        }