using System.Web;
using BP.DA;
using BP.Difference;
namespace BP.WF.HttpHandler
{
///
/// 页面功能实体
///
public class WF_Admin_FoolFormDesigner_Template_FrmAttachmentSingle : BP.WF.HttpHandler.DirectoryPageBase
{
///
/// 构造函数
///
public WF_Admin_FoolFormDesigner_Template_FrmAttachmentSingle()
{
}
#region 界面 .
///
/// 生成模板文件
///
///
public string UploadAthTemplateWPS_Init()
{
BP.Sys.FrmUI.FrmAttachmentSingle ath = new Sys.FrmUI.FrmAttachmentSingle(this.MyPK);
string file = BP.Difference.SystemConfig.PathOfTemp + "/" + this.MyPK + ".wps";
DBAccess.GetFileFromDB(file, ath.EnMap.PhysicsTable, "MyPK", this.MyPK, "TemplateFile");
return file;
}
///
/// 保存模板文件
///
///
public string UploadAthTemplateWPS_Save()
{
if (HttpContextHelper.RequestFilesCount == 0)
return "err@请上传文件模板";
//HttpPostedFile file = HttpContextHelper.RequestFiles(0);
//保存文件到临时目录
string path = BP.Difference.SystemConfig.PathOfTemp + HttpContextHelper.GetNameByIdx(0);
HttpContextHelper.UploadFile(HttpContextHelper.RequestFiles(0), path);
BP.Sys.FrmUI.FrmAttachmentSingle ath = new Sys.FrmUI.FrmAttachmentSingle(this.MyPK);
//存储到模板库里。
DBAccess.SaveFileToDB(path, ath.EnMap.PhysicsTable, "MyPK", this.MyPK, "TemplateFile");
return "保存成功";
}
#endregion 界面.
}
}