protected void Button1_Click(object sender, EventArgs e) { Tz888.SQLServerDAL.MemberResourceDAL objSendImage = new Tz888.SQLServerDAL.MemberResourceDAL(); Tz888.Model.MemberResourceModel ResourceModel = new Tz888.Model.MemberResourceModel(); //保存上传图片 string[] UploadImgFileName = SaveImages(this.InfoType); string Pic1 = ""; if (UploadImgFileName.Length > 0) { Pic1 = UploadImgFileName[0]; //图片加载 this.Img = ConfigurationManager.AppSettings["ImageDomain"].ToString() + "/" + Pic1; this.ButtonName = ""; //图片上传 ResourceModel.ResourceID = 0; ResourceModel.LoginName = Page.User.Identity.Name; ResourceModel.ResourceName = "登记介绍"; ResourceModel.ResourceTitle = "登记介绍"; ResourceModel.ResourceDescrib = "登记介绍"; ResourceModel.ResourceType = 1; ResourceModel.ResourceAddr = Pic1; ResourceModel.ResourceProperty = 0; ResourceModel.ResourcePassword = null;// Convert.ToByte(""); ResourceModel.UpDate = DateTime.Now; ResourceModel.IsDel = false; ResourceModel.remark = "Result.aspx页面添加"; objSendImage.AddFromResult(ResourceModel); Tz888.Common.MessageBox.Show(this.Page, "上传成功!"); } }
protected void UpLoadImage(Tz888.Model.MemberResourceModel UpLoadImage) { Tz888.SQLServerDAL.MemberResourceDAL objSendImage = new Tz888.SQLServerDAL.MemberResourceDAL(); Tz888.Model.MemberResourceModel ResourceModel = new Tz888.Model.MemberResourceModel(); //保存进数据库 ResourceModel.ResourceID = 0; ResourceModel.LoginName = UpLoadImage.LoginName; ResourceModel.ResourceName = UpLoadImage.ResourceName; ResourceModel.ResourceTitle = UpLoadImage.ResourceTitle; ResourceModel.ResourceDescrib = UpLoadImage.ResourceDescrib; ResourceModel.ResourceType = UpLoadImage.ResourceType; ResourceModel.ResourceAddr = UpLoadImage.ResourceAddr; ResourceModel.ResourceProperty = UpLoadImage.ResourceProperty; ResourceModel.ResourcePassword = null; ResourceModel.UpDate = DateTime.Now; ResourceModel.IsDel = false; ResourceModel.remark = "附件添加"; objSendImage.AddFromResult(ResourceModel); }