Ejemplo n.º 1
0
        public void chiphisanluongcacnam_3ThangGanNhat(Dictionary <string, string> dicPara, Dictionary <string, string> dicConfig)
        {
            for (int i = 0; i <= 3; i++)
            {
                for (int ky = 1; ky <= 3; ky++)
                {
                    try
                    {
                        WS  ws   = new WS();
                        var json = ws.GetCP(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.AutoInsertChiPhiDienNam_LS_New", parameters);
                        }
                    }
                    catch (Exception ex)
                    {
                        WriterToFileLog(ex.Message);
                    }
                }
            }
        }