public static int CreateNewDownload(SqlConnection oConnData, string downloadName, string filetype, int studyID, int inclREL, string mlist, string tplist, string grplist, string sslist) { //!!!!!!!!!!!!!!!!!!!!!!!! //LOG THE NEW DOWNLOAD int new_downloadPK = DownloadData.NewDownload_INSERT(oConnData, downloadName, filetype, studyID, inclREL, mlist, tplist, grplist, sslist); int new_ddversPK = DownloadData.NewDownload_vers_INSERT(oConnData, new_downloadPK); //The vers should always be 1 for new downloads SqlCommand cmdVers = new SqlCommand("select vers from datDownload_vers where ddversPK =" + new_ddversPK.ToString(), oConnData); int vers = (int)cmdVers.ExecuteScalar(); /// string[] measnames = mlist_names.Split('|'); //RETRIEVE THE DATA DataTable[] myDT = DownloadData.DownloadDataArray2(oConnData, Convert.ToInt16(new_ddversPK)); string filename = "zipdata_" + new_downloadPK.ToString() + "_v" + vers.ToString(); //string info_msg = ""; //string data_msg = ""; if (filetype == "Excel XML") { CreateExcel(myDT, filename); } else if (filetype == "TAB zip") { CreateTABzip(myDT, filename); } // Handle other file types here... ///!!!!!!!!!!!!!!!!!!!!!!!!!! return(new_ddversPK); }