private static string getFileName(string sUserName, DownloadFilesExportTypes type) { string sName = ""; if (type == DownloadFilesExportTypes.PATIENT_LIST) { sName = Exports_Patients; } if (type == DownloadFilesExportTypes.VISIT_LIST) { sName = Exports_Visits; } if (type == DownloadFilesExportTypes.BILL_LIST) { sName = Exports_Bills; } if (type == DownloadFilesExportTypes.RECONCILIATION_LIST) { sName = Exports_Reconciliation; } if (type == DownloadFilesExportTypes.UNPROCESS_BILLS) { sName = Exports_UnprocessBill; } return(sUserName + "_" + sName + "_" + DateTime.Now.ToString("MM_dd_yyyyhhmm") + ".xlsx"); }
//protected void ASPxCallback2_Callback(object sender, CallbackEventArgs e) //{ // string sUserName = ((Bill_Sys_UserObject)Session["USER_OBJECT"]).SZ_USER_NAME; // //Bind_Grid(); // string sFileName = null; // string sFile = GetExportPhysicalPath1(sUserName, gb.web.utils.DownloadFilesExportTypes.UNPROCESS_BILLS, out sFileName); // System.IO.Stream stream1 = new System.IO.FileStream(sFile, System.IO.FileMode.Create); // grdUnseenExport1.WriteXlsx(stream1); // stream1.Close(); // ArrayList list = new ArrayList(); // list.Add(gb.web.utils.DownloadFilesUtils.GetExportRelativeURL(sFileName)); // Session["Download_Files"] = list; //} public static string GetExportPhysicalPath1(string sUserName, DownloadFilesExportTypes type, out string sFileName) { string sRoot = getUploadDocumentPhysicalPath1(); string sFolder = ConfigurationSettings.AppSettings["REPORTFOLDER"].ToString(); sFileName = getFileName1(sUserName); return(sRoot + sFolder + sFileName); }