Exemplo n.º 1
0
    //批量删除操作
    protected void btnDel_Click(object sender, EventArgs e)
    {
        System.Web.UI.HtmlControls.HtmlInputCheckBox CBoxDelete;

        foreach (RepeaterItem rtitem in this.Repeater1.Items)
        {
            CBoxDelete = (System.Web.UI.HtmlControls.HtmlInputCheckBox)rtitem.FindControl("cb1");
            LinkButton lik = (LinkButton)rtitem.FindControl("LinkButton1");
            if (CBoxDelete.Checked && lik.Enabled)
            {
                string       id    = ((HtmlInputHidden)rtitem.FindControl("SelectCode")).Value;
                Tunnel_index model = mbll.GetModel(Convert.ToInt64(id));
                //DelPricAndRider(Convert.ToInt32(model.Id));
                mbll.Delete(Convert.ToInt32(model.Id));
                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() + "',2)";
                Tunnel.Data.DbHelperSQL.ExecuteSql(strsql);
            }
        }
        PageBind2();
    }
Exemplo n.º 2
0
    /// <summary>
    /// 删除记录
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void LinkButton1_Command(object sender, CommandEventArgs e)
    {
        int Id   = Convert.ToInt32(e.CommandName);
        int relt = -1;

        cuttentPage = MTCPager1.PageIndex;
        Tunnel_index model = mbll.GetModel((long)Id);

        //DelPricAndRider(Id);
        relt = mbll.Delete(Id);
        if (relt == 0)
        {
            Tunnel.Common.Message.Show("删除成功");
            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() + "',2)";
            Tunnel.Data.DbHelperSQL.ExecuteSql(strsql);
        }
        else
        {
            Tunnel.Common.Message.Show("删除失败");
        }
        PageBind2();
    }
Exemplo n.º 3
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);
    }
Exemplo n.º 4
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;";
        //}
    }