示例#1
0
文件: ChargeApply.cs 项目: jjg0519/OA
        public void SaveFile(UploadFileModel UploadFile, out string strFilePath)
        {
            // Store File to File System
            string strNewFileName = string.Empty;
            string strVirtualPath = System.Configuration.ConfigurationManager.AppSettings["FileUploadLocation"].ToString();

            if (!string.IsNullOrWhiteSpace(UploadFile.FileName))
            {
                strNewFileName = DateTime.Now.ToString("yyMMddhhmmss") + DateTime.Now.Millisecond.ToString() + UploadFile.FileName.Substring(UploadFile.FileName.LastIndexOf("."));
            }

            string strPath = HttpContext.Current.Server.MapPath(strVirtualPath) + strNewFileName;

            if (Directory.Exists(HttpContext.Current.Server.MapPath(strVirtualPath)) == false)
            {
                Directory.CreateDirectory(HttpContext.Current.Server.MapPath(strVirtualPath));
            }
            FileStream FileStream = new FileStream(strPath, FileMode.Create);

            FileStream.Write(UploadFile.File, 0, UploadFile.File.Length);

            FileStream.Close();
            FileStream.Dispose();

            strFilePath = strVirtualPath + strNewFileName;
        }
示例#2
0
文件: ChargeApply.cs 项目: jjg0519/OA
        public List <V_ChargeApplyReport> ImportAttendMonthlyBalanceFromCSV(UploadFileModel UploadFile, string strCreateUserID, ref string strMsg)
        {
            string strPath = string.Empty;

            SaveFile(UploadFile, out strPath);
            string strPhysicalPath = HttpContext.Current.Server.MapPath(strPath);

            using (ChargeApplyMasterBLL chargeBLL = new ChargeApplyMasterBLL())
            {
                return(chargeBLL.ImportChargeApplyByImportExcel(strCreateUserID, strPhysicalPath, ref strMsg));
            }
        }
示例#3
0
文件: ChargeApply.cs 项目: JuRogn/OA
        public void SaveFile(UploadFileModel UploadFile, out string strFilePath)
        {
            // Store File to File System
            string strNewFileName = string.Empty;
            string strVirtualPath = System.Configuration.ConfigurationManager.AppSettings["FileUploadLocation"].ToString();
            if (!string.IsNullOrWhiteSpace(UploadFile.FileName))
            {
                strNewFileName = DateTime.Now.ToString("yyMMddhhmmss") + DateTime.Now.Millisecond.ToString() + UploadFile.FileName.Substring(UploadFile.FileName.LastIndexOf("."));
            }

            string strPath = HttpContext.Current.Server.MapPath(strVirtualPath) + strNewFileName;
            if (Directory.Exists(HttpContext.Current.Server.MapPath(strVirtualPath)) == false)
            {
                Directory.CreateDirectory(HttpContext.Current.Server.MapPath(strVirtualPath));
            }
            FileStream FileStream = new FileStream(strPath, FileMode.Create);
            FileStream.Write(UploadFile.File, 0, UploadFile.File.Length);

            FileStream.Close();
            FileStream.Dispose();

            strFilePath = strVirtualPath + strNewFileName;
        }
示例#4
0
文件: ChargeApply.cs 项目: JuRogn/OA
        public List<V_ChargeApplyReport> ImportAttendMonthlyBalanceFromCSV(UploadFileModel UploadFile, string strCreateUserID, ref string strMsg)
        {
            string strPath = string.Empty;
            SaveFile(UploadFile, out strPath);
            string strPhysicalPath = HttpContext.Current.Server.MapPath(strPath);

            using (ChargeApplyMasterBLL chargeBLL = new ChargeApplyMasterBLL())
            {
                return chargeBLL.ImportChargeApplyByImportExcel(strCreateUserID, strPhysicalPath, ref strMsg);
            }
        }