Пример #1
0
 private void PageBind(int indexId)
 {
     Tunnel.Model.Tunnel_index model = new Tunnel.Model.Tunnel_index();
     Tunnel.BLL.Tunnel_Index   index = new Tunnel.BLL.Tunnel_Index();
     model         = index.GetModel(indexId);
     tb_Title.Text = model.Title;
     DropDownList1.SelectedValue = model.TypeId.ToString();
     FCKeditor.Value             = model.Content;
 }
Пример #2
0
 private void PageBind(int indexId)
 {
     Tunnel.Model.Tunnel_index model = new Tunnel.Model.Tunnel_index();
     Tunnel.BLL.Tunnel_Index   index = new Tunnel.BLL.Tunnel_Index();
     model         = index.GetModel(indexId);
     tb_Title.Text = model.Title;
     DropDownList1.SelectedValue = model.TypeId.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;
     }
     if (model.ReadUser.Trim() != "")
     {
         lblUserID.Text = model.ReadUser.Trim();
         string[] strUser = lblUserID.Text.Trim().Split(new Char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
         lblUser.Text = "浏览人:";
         for (int i = 0; i < strUser.Length; i++)
         {
             lblUser.Text += ShowUserName(strUser[i]) + ",";
         }
         lblUser.Text       = lblUser.Text.Trim().Substring(0, lblUser.Text.Trim().Length - 1);
         lblUser.Visible    = true;
         lblUserMes.Visible = true;
     }
     else
     {
         lblUser.Visible    = false;
         lblUserMes.Visible = false;
     }
     //tb_toname.Text = model.ReadUser.Trim();
 }
Пример #3
0
    /// <summary>
    /// 一周安排new两天
    /// </summary>
    public string PageBind()
    {
        string htmlSource = string.Empty;

        Tunnel.BLL.Tunnel_Index          tbll   = new Tunnel.BLL.Tunnel_Index();
        Tunnel.Model.Tunnel_index        model  = new Tunnel.Model.Tunnel_index();
        List <Tunnel.Model.Tunnel_index> txList = tbll.GetModelList("id=(select max(id) from tunnel_index where typeid=30 and del=0)");

        if (txList.Count > 0)
        {
            model = txList[0];
            if (Math.Abs(Convert.ToDateTime(model.SetDate).Subtract(DateTime.Now).Days) < 2)
            {
                htmlSource = "<font color='red'>new !</font>";
            }
        }
        else
        {
            htmlSource = "";
        }
        return(htmlSource);
    }
Пример #4
0
    public string TitleHerfUrl(int id, string title)
    {
        string type = DropDownList1.SelectedItem.Text.Trim();
        string url  = "";

        switch (type)
        {
        case "新闻":
            url = "<a href='../N_News/N_News/N_NewView.aspx?Id=" + id + "&TypeId=0'>" + title + "</a>";
            break;

        case "公告":
            url = "<a href='../N_News/N_Bulletin/N_GonggaoView.aspx?Id=" + id + "&TypeId=1'>" + title + "</a>";
            break;

        case "科室信息":
            Tunnel.BLL.Tunnel_Index ix    = new Tunnel.BLL.Tunnel_Index();
            Tunnel_index            model = new Tunnel_index();
            model = ix.GetModel(id);
            url   = "<a href='ViewIndex.aspx?Id=" + id + "&TypeId=" + model.TypeId + "&lanmuId=1'>" + title + "</a>";
            break;

        case "公文":
            url = "<a href='../N_WorkFlow/ODocument/Document_View.aspx?lid=" + Tunnel.Data.DESEncrypt.Encrypt(id.ToString()) + "'>" + title + "</a>";
            break;

        case "档案":
            url = title;
            break;

        case "图片":
            url = "<a href='../N_WorkFlow/ODocument/Document_View.aspx?lid=" + Tunnel.Data.DESEncrypt.Encrypt(id.ToString()) + "'>" + title + "</a>";
            break;
        }
        return(url);
    }
Пример #5
0
    public string iffile(object o)
    {
        Tunnel.BLL.Tunnel_Index   ti  = new Tunnel.BLL.Tunnel_Index();
        Tunnel.Model.Tunnel_index tii = new Tunnel_index();
        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 "&nbsp;";
        //}
    }
Пример #6
0
    //添加至信息表
    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);
                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_index model = new Tunnel.Model.Tunnel_index();
                model.Id         = indexId;
                model.Title      = title;
                model.TypeId     = typeid;
                model.HtmlSource = htmlsourcce;
                model.ImagePaht  = imagepaht;
                model.Content    = content;
                model.UserId     = userid;
                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_information bllf  = new Tunnel.BLL.Tunnel_information();
                Tunnel.BLL.Tunnel_Index       index = new Tunnel.BLL.Tunnel_Index();
                int relt = -1;
                relt = index.Update(model);
                if (relt > 0)
                {
                    Tunnel.Common.Message.Show("修改成功!", "N_InformationManage.aspx?type=" + Request.QueryString["type"]);
                }
                else
                {
                    Tunnel.Common.Message.Show("修改失败!", "N_InformationManage.aspx?type=" + Request.QueryString["type"]);
                }

                // 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);
                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_index model = new Tunnel.Model.Tunnel_index();
                model.Title      = title;
                model.TypeId     = typeid;
                model.HtmlSource = htmlsourcce;
                model.ImagePaht  = imagepaht;
                model.Content    = content;
                model.UserId     = userid;
                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_information bllf = new Tunnel.BLL.Tunnel_information();
                int relt = -1;
                relt = bllf.Add(model);
                if (relt > 0)
                {
                    Tunnel.Common.Message.Show("增加成功!", "N_InformationManage.aspx?type=" + Request.QueryString["type"]);
                    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_InformationManage.aspx?type=" + Request.QueryString["type"]);
                }

                // MessageBox(str, url);
            }
            else
            {
                Tunnel.Common.Message.Show("请选择子栏目!");
            }
        }
    }