Example #1
0
        public void UpdateDMVT()
        {
            DataTable dt = LibQLSX.Select("exec spGetNewModule");

            if (dt.Rows.Count == 0)
            {
                return;
            }
            foreach (DataRow item in dt.Rows)
            {
                try
                {
                    string moduleCode    = TextUtils.ToString(item["FolderCode"]);
                    string _serverPathCK = string.Format("Thietke.Ck/{0}/{1}.Ck/VT.{1}.xlsm", moduleCode.Substring(0, 6), moduleCode);
                    DocUtils.InitFTPQLSX();
                    if (DocUtils.CheckExits(_serverPathCK))
                    {
                        DocUtils.DownloadFile(_path, "VT." + moduleCode + ".xlsm", _serverPathCK);
                        string filePathDMVT = _path + "VT." + moduleCode + ".xlsm";
                        if (!File.Exists(filePathDMVT))
                        {
                            continue;
                        }
                        DataTable dtDMVT = TextUtils.ExcelToDatatableNoHeader(filePathDMVT, "DMVT");
                        TextUtils.AddDMVTfromModule(filePathDMVT);
                        File.Delete(filePathDMVT);
                    }
                }
                catch
                {
                }
            }
        }