protected void Button1_Click(object sender, EventArgs e) { Tunnel.Model.Tunnel_information model = new Tunnel.Model.Tunnel_information(); model.i_title = tb_Title.Text; model.i_content = FreeTextBox1.Value; if (RadioButton1.Checked) { TypeId = 1; } else { TypeId = 0; } model.i_sort = TypeId; // 0是新闻 1公告 model.i_user = ul.LoginID; model.i_time = DateTime.Now; model.i_hit = 0; model.i_Ip = Tunnel.Common.Common.GetIp(); model.i_id = Convert.ToInt32(i_id); HttpPostedFile hpf = file1.PostedFile; if (Convert.ToDouble(hpf.ContentLength) / 1024 / 1024 > 10) { Response.Write("<script>alert('附件大小不能大于10MB');</script>"); return; } else { CreateMdAndFilePaht(hpf); } if (filePaht.Equals("")) { model.i_files = Label3.Text; } else { model.i_files = filePaht; //infofiles } if (filenames.Equals("")) { model.i_files = Label3.Text.Replace("<br/>附件名:", ""); } else { model.i_files = filePaht; } int relt = -1; string str = titleName; relt = bll.Update(model); string strsql2 = "delete tunnel_remind where m_typeid=" + model.i_id.ToString() + " and m_type=4"; Tunnel.Data.DbHelperSQL.ExecuteSql(strsql2); //-------添加消息提示-------- Tunnel.Model.Tunnel_Remind remindmodel = new Tunnel.Model.Tunnel_Remind(); remindmodel.m_isread = 0; remindmodel.m_time = Convert.ToDateTime(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); remindmodel.m_title = "有新闻需要您审核<font color=red>(待审核)</font>"; remindmodel.m_touser = model.i_audituser; remindmodel.m_url = "N_News/N_News/N_NewSh.aspx?Id=" + relt; remindmodel.m_type = 4; remindmodel.m_typeid = relt; remindmodel.m_callTime = Convert.ToDateTime("1800-01-01"); Tunnel.BLL.Tunnel_Remind rd = new Tunnel.BLL.Tunnel_Remind(); rd.Add(remindmodel); if (relt > 0) { str += "成功!"; } else { str += "失败!"; } // UpImange(relt); MessageBox(str, url); }
protected void Button1_Click(object sender, EventArgs e) { Tunnel.Model.Tunnel_information model = new Tunnel.Model.Tunnel_information(); model.i_title = tb_Title.Text; model.i_content = FreeTextBox1.Value; if (RadioButton1.Checked) { TypeId = 1; } else { TypeId = 0; } model.i_sort = TypeId; // 0是新闻 1公告 model.i_user = ul.LoginID; model.i_time = DateTime.Now; model.i_Ip = Tunnel.Common.Common.GetIp(); model.i_id = Convert.ToInt32(i_id); HttpPostedFile hpf = file1.PostedFile; if (Convert.ToDouble(hpf.ContentLength) / 1024 / 1024 > 10) { Response.Write("<script>alert('附件大小不能大于10MB');</script>"); return; } else { CreateMdAndFilePaht(hpf); } if (filePaht.Equals("")) { model.i_files = Label3.Text; } else { model.i_files = filePaht; //infofiles } if (filenames.Equals("")) { model.i_files = Label3.Text.Replace("<br/>附件名:", ""); } else { model.i_files = filePaht; } int relt = -1; string str = titleName; relt = bll.Update(model); if (relt > 0) { str += "成功!"; } else { str += "失败!"; } // UpImange(relt); MessageBox(str, url); }