63 lines
2.6 KiB
C#
63 lines
2.6 KiB
C#
using System;
|
|
using System.Data;
|
|
using System.Configuration;
|
|
using System.Collections;
|
|
using System.Web;
|
|
using System.Web.Security;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
using System.Web.UI.WebControls.WebParts;
|
|
using System.Web.UI.HtmlControls;
|
|
|
|
public partial class DocCenter_DocAdd : System.Web.UI.Page
|
|
{
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!Page.IsPostBack)
|
|
{
|
|
ZWL.Common.PublicMethod.CheckSession();
|
|
}
|
|
}
|
|
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
|
|
{
|
|
string FileNameStr = ZWL.Common.PublicMethod.UploadFileIntoDir(this.FileUpload1, DateTime.Now.Ticks.ToString() + System.IO.Path.GetExtension(FileUpload1.PostedFile.FileName));
|
|
if (FileNameStr.Trim().Length > 0)
|
|
{
|
|
ZWL.BLL.ERPFileList MyModel = new ZWL.BLL.ERPFileList();
|
|
MyModel.FileName = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
|
|
MyModel.BianHao = this.TextBox1.Text;
|
|
MyModel.BackInfo = this.TxtContent.Text;
|
|
MyModel.DaXiao = (this.FileUpload1.PostedFile.ContentLength / 1024)+1;
|
|
try
|
|
{
|
|
MyModel.FileType = this.FileUpload1.FileName.Remove(0, this.FileUpload1.FileName.LastIndexOf('.') + 1);
|
|
}
|
|
catch
|
|
{ }
|
|
MyModel.DirID = int.Parse(Request.QueryString["DirID"].ToString());
|
|
MyModel.ShangChuanTime = DateTime.Now;
|
|
MyModel.FilePath = FileNameStr;
|
|
MyModel.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
|
|
MyModel.IFDel = "否";
|
|
MyModel.TypeName = Request.QueryString["Type"].ToString();
|
|
MyModel.IfShare = "否";
|
|
MyModel.DirOrFile =0;
|
|
|
|
MyModel.CanView = txtCanView.Text;
|
|
MyModel.CanAdd = txtCanAdd.Text;
|
|
MyModel.CanMod = txtCanMod.Text;
|
|
MyModel.CanDel = txtCanDel.Text;
|
|
|
|
MyModel.Add();
|
|
|
|
//写系统日志
|
|
ZWL.BLL.ERPRiZhi MyRiZhi = new ZWL.BLL.ERPRiZhi();
|
|
MyRiZhi.UserName = ZWL.Common.PublicMethod.GetSessionValue("UserName");
|
|
MyRiZhi.DoSomething = "用户添加文件信息(" + System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName) + ")";
|
|
MyRiZhi.IpStr = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
|
|
MyRiZhi.Add();
|
|
|
|
ZWL.Common.MessageBox.ShowAndRedirect(this, "文件添加成功!", "DocCenter.aspx?Type=" + Request.QueryString["Type"].ToString() + "&DirID=" + Request.QueryString["DirID"].ToString());
|
|
}
|
|
}
|
|
} |