Esempio n. 1
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.Model.Tunnel_index model = mbll.GetModel(Id);
        //if (ul.JiaoSe(ul.LoginID) != "系统管理员" && ul.LoginID != model.UserId)
        //{
        //    Tunnel.Common.Message.Show("你不可以删除他人信息");
        //    return;
        //}
        //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();
    }
Esempio n. 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        RadioButton1.Enabled = true;
        RadioButton2.Enabled = true;
        if (!string.IsNullOrEmpty(Request.QueryString["id"]))
        {
            i_id = Request.QueryString["id"].ToString();
        }
        if (!IsPostBack)
        {
            Button1.Text = titleName;
            if (TypeId == 1)
            {
                RadioButton1.Checked = true;
            }
            else
            {
                RadioButton2.Checked = true;
            }

            Tunnel.Model.Tunnel_information information = new Tunnel.Model.Tunnel_information();
            information        = bll.GetModel(i_id);
            tb_Title.Text      = information.i_title;
            FreeTextBox1.Value = information.i_content;
            if (!information.i_files.Equals(""))
            {
                Label3.Visible = false;
                Label2.Visible = true;
                Label4.Visible = true;
                if (information.i_files.Equals(""))
                {
                    Label2.Text = "<br/>附件名:" + information.i_files.Substring(information.i_files.LastIndexOf("\\") + 1);
                }
                else
                {
                    Label2.Text = "<br/>附件名:" + information.i_files.Substring(information.i_files.LastIndexOf("\\") + 1);
                }
                Label3.Text = information.i_files;
            }
            else
            {
                Label3.Visible = false;
                Label2.Visible = false;
                Label4.Visible = false;
            }
            information        = bll.GetModel(i_id);
            tb_Title.Text      = information.i_title;
            FreeTextBox1.Value = information.i_content;
            if (ul.LoginID != 1 && ul.JiaoSe(ul.LoginID) != "系统管理员")
            {
                RadioButton1.Enabled = false;
                RadioButton2.Enabled = false;
            }
        }
    }
Esempio n. 3
0
    /// <summary>
    /// 对功能按钮的功能控制
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        LinkButton lb  = (LinkButton)e.Item.FindControl("LinkButton1");
        LinkButton lb2 = (LinkButton)e.Item.FindControl("LinkButton2");
        LinkButton lb3 = (LinkButton)e.Item.FindControl("LinkButton3");

        Tunnel.Model.Tunnel_information model = new Tunnel_information();
        model = mbll.GetModel(lb3.CommandName);
        //删除
        if (Convert.ToInt32(lb.CommandArgument.ToString()) == ul.LoginID || ul.LoginID == 1 || !ul.JiaoSe(ul.LoginID).Equals("系统管理员"))
        {
            lb.Enabled = true;
            lb.ToolTip = "";
        }
        else
        {
            lb.Enabled = false;
            lb.ToolTip = "不允许删除他人发布的信息";
        }
        //修改
        if (Convert.ToInt32(lb.CommandArgument) == ul.LoginID || model.i_audituser == ul.LoginID || ul.LoginID == 1 || ul.JiaoSe(ul.LoginID).Equals("系统管理员"))
        {
            lb2.Enabled = true;
            lb2.ToolTip = "";
        }
        else
        {
            lb2.Enabled = false;
            lb2.ToolTip = "不允许修改他人发布的信息";
        }
        //审核
        if (Tunnel.BLL.Permission.IfHasPrimision(ul.LoginID.ToString(), "新闻审核", "新闻管理", false) && ul.LoginID == model.i_audituser)
        {
            lb3.Visible = true;
            lb3.ToolTip = "";
        }
        else
        {
            if (ul.LoginID == 1 || ul.JiaoSe(ul.LoginID).Equals("系统管理员"))
            {
                lb3.Visible = true;
                lb3.ToolTip = "";
            }
            else
            {
                lb3.Visible = false;
                lb3.ToolTip = "您无法审核该信息";
            }
        }
        if (lb3.CommandArgument.Equals("1"))
        {
            lb3.Enabled = false;
            lb3.ToolTip = "审核已通过";
        }
    }
Esempio n. 4
0
    /// <summary>
    /// 页面数据绑定
    /// </summary>
    public void PageBind()
    {
        if (Id == 0)
        {
            return;
        }
        Tunnel.Model.Tunnel_information        model     = new Tunnel.Model.Tunnel_information();
        List <Tunnel.Model.Tunnel_information> modelList = new List <Tunnel.Model.Tunnel_information>();

        model = tbll.GetModel(Id, ul.LoginID, Tunnel.Common.Common.GetIp());
        modelList.Add(model);
        Repeater1.DataSource = modelList;
        Repeater1.DataBind();
    }
Esempio n. 5
0
 /// <summary>
 /// 页面数据绑定
 /// </summary>
 public void PageBind()
 {
     Tunnel.Model.Tunnel_index model = new Tunnel.Model.Tunnel_index();
     model      = tbll.GetModel(Convert.ToInt64(Id));
     title      = model.Title;
     content    = model.Content;
     setDate    = model.SetDate;
     htmlSource = model.HtmlSource;
     userId     = model.UserId;
     if (!string.IsNullOrEmpty(model.Files))
     {
         fujian = "<a href='../" + model.Files + "' style='color: blue' >点击下载附件</a>";
     }
 }
Esempio n. 6
0
    /// <summary>
    /// 页面数据绑定
    /// </summary>
    public void PageBind()
    {
        if (Id == 0)
        {
            return;
        }
        Tunnel.Model.Tunnel_information model = new Tunnel.Model.Tunnel_information();
        model     = tbll.GetModel(Id, ul.LoginID, Tunnel.Common.Common.GetIp());
        i_title   = model.i_title;
        i_user    = ShowUserName(model.i_user.ToString());
        i_time    = model.i_time.ToString();
        i_content = model.i_content;
        if (!string.IsNullOrEmpty(model.i_files))
        {
            fujian = "<a href='../" + model.i_files + "' style='color: blue' >点击下载附件</a>";
        }
        //if (model.i_files != null && model.i_files != "")
        //{
        //    i_content+="<img src='/"+model.i_files+"'>";
        //}
        imageName = Id + ".jpg";
        string temp = Request.PhysicalApplicationPath + "upload/UpGongGaoImage/" + Id + ".jpg";

        if (System.IO.File.Exists(temp) == false)
        {
            imageName = Id + ".gif";
            temp      = Request.PhysicalApplicationPath + "upload/UpGongGaoImage/" + Id + ".gif";
            if (System.IO.File.Exists(temp) == false)
            {
                str = "none";
            }
            else
            {
                str = "";
            }
        }
        else
        {
            str = "";
        }
    }