예제 #1
0
        public void processAll(string SourcePath, string LocalPath, string LocalPathSuccess, string LocalPathError, string LocalPathLog, DateTime dateNow, string LocalPathRerun, string IsRerun, string LocalPathOtherLocation, Boolean IsLoadDatafromWebservice)
        {
            //Step 1 : DTS from Flat file to SQL Server
            DateTime DTCurrent = DateTime.Now;

            char[] delimiter  = { '|' };
            string formatDate = "yyyy-MM-dd";

            Service.WS_TrakcareCls ws_trak = new Service.WS_TrakcareCls();
            DataTable dtArr = ws_trak.GetPTArrivedIncaseFlatFileNotGen(dateNow.ToString(formatDate));

            foreach (DataRow drArr in dtArr.Rows)
            {
                string EN       = string.Empty;
                string Location = string.Empty;
                int    res      = 0;
                try
                {
                    Location = string.Empty;
                    EN       = drArr["PAADM_ADMNo"].ToString();
                    Location = drArr["CTLOC_Code"].ToString();

                    if (EN != string.Empty)
                    {
                        res = serviceGetPTArrivedCheckupFilter(Location, EN, dateNow);
                    }
                    if (res == 1)    //success
                    {
                        string PathSuccess = LocalPathSuccess + DateTime.Now.ToString(formatDate);
                        string FileSuccess = PathSuccess + "\\" + EN + "_S_" + Location + ".txt";
                        if (!Directory.Exists(PathSuccess))
                        {
                            Directory.CreateDirectory(PathSuccess);
                        }
                        if (!File.Exists(FileSuccess))
                        {
                            File.AppendAllText(FileSuccess, "Success : DateTime = " + DateTime.Now.ToString());
                        }
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }