public string iffile(object o) { Tunnel.BLL.Tunnel_InfoXJB ti = new Tunnel.BLL.Tunnel_InfoXJB(); Tunnel.Model.Tunnel_InfoXJB tii = new Tunnel_InfoXJB(); tii = ti.GetModel(Convert.ToInt32(o.ToString())); if (!string.IsNullOrEmpty(tii.Files)) { return("<font color=red>有</font>"); } else { return("无"); } }
private void PageBind(int indexId) { Tunnel.Model.Tunnel_InfoXJB model = new Tunnel.Model.Tunnel_InfoXJB(); Tunnel.BLL.Tunnel_InfoXJB index = new Tunnel.BLL.Tunnel_InfoXJB(); model = index.GetModel(indexId); tb_Title.Text = model.Title; DropDownList1.SelectedValue = model.TypeId.ToString(); Binddroplist(model.TypeId); DropDownList2.SelectedValue = model.Sectype.ToString(); FCKeditor.Value = model.Content; if (!model.Files.Equals("")) { Label3.Visible = false; Label2.Visible = true; Label4.Visible = true; Label2.Text = "<br/>附件名:" + model.Files.Substring(model.Files.LastIndexOf("\\") + 1); Label3.Text = model.Files; } else { Label3.Visible = false; Label2.Visible = false; Label4.Visible = false; } }
public string iffile(object o) { Tunnel.BLL.Tunnel_InfoXJB ti = new Tunnel.BLL.Tunnel_InfoXJB(); Tunnel.Model.Tunnel_InfoXJB tii = new Tunnel_InfoXJB(); tii = ti.GetModel(Convert.ToInt32(o.ToString())); if (!string.IsNullOrEmpty(tii.Files)) { return("<font color=red>有</font>"); } else { return("无"); } //string filelist = tii.Files; //int i = 0; //string filecontent = ""; //if (filelist != "") //{ // string[] filearr = filelist.Split(','); // foreach (string file in filearr) // { // if (file != "") // { // i++; // filecontent += Tunnel.Common.GetValue.getfu(file, "", i); // } // } // return filecontent; //} //else //{ // return " "; //} }
//添加至信息表 protected void Button1_Click(object sender, EventArgs e) { if (titleId == 1) { if (!"0".Equals(Request.Form["DropDownList1"])) { string title = this.tb_Title.Text.Trim(); int typeid = Convert.ToInt32(this.DropDownList1.SelectedValue); int sectype = Convert.ToInt32(DropDownList2.SelectedValue); string htmlsourcce = this.FCKeditor.Value; // Request.Form["content1"]; //this.FCKeditor.Value; string imagepaht = stringFormat(From_Content(htmlsourcce)).Trim(); string content = FCKeditor.Value; //Request.Form["content1"]; //FreeTextBox1.HtmlStrippedText; int userid = ul.LoginID; if (!string.IsNullOrEmpty(imagepaht)) { if (imagepaht.Substring(0, 1) == "/") { imagepaht = imagepaht.Substring(1, imagepaht.Length - 1); } imagepaht = imagepaht.Replace("src=/sdoa/", ""); } Tunnel.Model.Tunnel_InfoXJB model = new Tunnel.Model.Tunnel_InfoXJB(); model.Id = indexId; model.Title = title; model.TypeId = typeid; model.HtmlSource = htmlsourcce; model.ImagePaht = imagepaht; model.Content = content; model.UserId = userid; model.Sectype = sectype; 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.Files = Label3.Text; } else { model.Files = filePaht; //infofiles } //string str = titleName; Tunnel.BLL.Tunnel_InfoXJB index = new Tunnel.BLL.Tunnel_InfoXJB(); int relt = -1; relt = index.Update(model); if (relt > 0) { Tunnel.Common.Message.Show("修改成功!", "N_XJBManage.aspx"); string strsql = ""; strsql = "insert into tunnel_log(l_user,l_time,l_content,l_ip,l_sort) values(" + ul.LoginID + ",'" + DateTime.Now + "','公司事务>>项经部信息>>修改项经部信息。标题:" + model.Title + "','" + Tunnel.Common.Common.GetIp() + "',1)"; Tunnel.Data.DbHelperSQL.ExecuteSql(strsql); } else { Tunnel.Common.Message.Show("修改失败!", "N_XJBManage.aspx"); } // MessageBox(str, url); } else { Tunnel.Common.Message.Show("请选择子栏目!"); } } else { if (!"0".Equals(Request.Form["DropDownList1"])) { string title = this.tb_Title.Text.Trim(); int typeid = Convert.ToInt32(this.DropDownList1.SelectedValue); int sectype = Convert.ToInt32(DropDownList2.SelectedValue); string htmlsourcce = this.FCKeditor.Value; // Request.Form["content1"]; //this.FCKeditor.Value; string imagepaht = stringFormat(From_Content(htmlsourcce)).Trim(); string content = FCKeditor.Value; //Request.Form["content1"]; //FreeTextBox1.HtmlStrippedText; int userid = ul.LoginID; if (!string.IsNullOrEmpty(imagepaht)) { if (imagepaht.Substring(0, 1) == "/") { imagepaht = imagepaht.Substring(1, imagepaht.Length - 1); } imagepaht = imagepaht.Replace("src=/sdoa/", ""); } Tunnel.Model.Tunnel_InfoXJB model = new Tunnel.Model.Tunnel_InfoXJB(); model.Title = title; model.TypeId = typeid; model.HtmlSource = htmlsourcce; model.ImagePaht = imagepaht; model.Content = content; model.UserId = userid; model.Bum_bz = ul.getUserModel(ul.LoginID).m_bum; model.Sectype = sectype; HttpPostedFile hpf = file1.PostedFile; if (Convert.ToDouble(hpf.ContentLength) / 1024 / 1024 > 10) { Response.Write("<script>alert('附件大小不能大于10MB');</script>"); return; } else { CreateMdAndFilePaht(hpf); } model.Files = filePaht; //infofiles //string str = titleName; Tunnel.BLL.Tunnel_InfoXJB bllf = new Tunnel.BLL.Tunnel_InfoXJB(); int relt = -1; relt = bllf.Add(model); if (relt > 0) { Tunnel.Common.Message.Show("增加成功!", "N_XJBManage.aspx"); string strsql = ""; strsql = "insert into tunnel_log(l_user,l_time,l_content,l_ip,l_sort) values(" + ul.LoginID + ",'" + DateTime.Now + "','公司事务>>项经部信息>>发布项经部信息。标题:" + model.Title + "','" + Tunnel.Common.Common.GetIp() + "',1)"; Tunnel.Data.DbHelperSQL.ExecuteSql(strsql); } else { Tunnel.Common.Message.Show("增加失败!", "N_XJBManage.aspx"); } // MessageBox(str, url); } else { Tunnel.Common.Message.Show("请选择子栏目!"); } } }
public void ListBind() { if (ul.LoginID == 1 || ul.JiaoSe(ul.LoginID).Equals("系统管理员")) { where = ""; PageBind2(); } else { Tunnel.BLL.Tunnel_bum tb = new Tunnel.BLL.Tunnel_bum(); Tunnel_bum tbb = new Tunnel_bum(); tmm = tm.GetModel(Convert.ToInt64(ul.LoginID.ToString())); if (tmm != null) { if (!string.IsNullOrEmpty(tmm.m_bum.ToString())) { tbb = tb.GetModel(Convert.ToInt64(tmm.m_bum.ToString())); if (tbb != null) { List <Tunnel.Model.Tunnel_InfoXJB> tsList = new List <Tunnel_InfoXJB>(); Tunnel.BLL.Tunnel_InfoXJB tst = new Tunnel.BLL.Tunnel_InfoXJB(); tsList = tst.GetModelList(""); // bumname='" + tbb.b_name + "' if (tsList.Count > 0) { for (int i = 0; i < tsList.Count; i++) { bhtype += tsList[i].TypeId.ToString() + "|"; } if (bhtype.Length > 0) { bhtype = bhtype.Substring(0, bhtype.Length - 1); } } where = ""; //for (int i = 0; i < bhtype.Split('|').Length; i++) //{ // if (where.Length > 0) // { // if (i == bhtype.Split('|').Length - 1) // { // where += " or typeid=" + bhtype.Split('|')[i] + ")"; // } // else // { // where += " or typeid=" + bhtype.Split('|')[i] + ""; // } // } // else // { // where += " (typeid=" + bhtype.Split('|')[i] + ""; // } //} PageBind2(); } else { MTCPager1.RecordCount = 0; } } } } }