Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["id"]))
     {
         id = Request.QueryString["id"].ToString();
     }
     if (!string.IsNullOrEmpty(Request.QueryString["type"]))
     {
         type = Convert.ToInt32(Request.QueryString["type"]);
     }
     if (!IsPostBack)
     {
         if (!id.Equals("") && !id.Equals("0"))
         {
             tii = ti.GetModel(Convert.ToInt32(id));
         }
     }
 }
Exemple #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);

        Tunnel.BLL.Tunnel_Img   ti  = new Tunnel.BLL.Tunnel_Img();
        Tunnel.Model.Tunnel_Img tii = new Tunnel.Model.Tunnel_Img();
        tii = ti.GetModel(Convert.ToInt32(Id));
        try
        {
            File.Delete(Server.MapPath("image\\") + tii.i_uri);
            File.Delete(Server.MapPath("image\\_") + tii.i_uri);
        }
        catch (Exception ex)
        {
            Tunnel.Common.Message.Show(ex.Message);
        }
        ti.Delete(Convert.ToInt32(Id));
        Tunnel.Common.Message.Show("删除成功!");
        PageBind();
    }
Exemple #3
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);

        Tunnel.BLL.Tunnel_Img   ti  = new Tunnel.BLL.Tunnel_Img();
        Tunnel.Model.Tunnel_Img tii = new Tunnel.Model.Tunnel_Img();
        tii = ti.GetModel(Convert.ToInt32(Id));
        try
        {
            File.Delete(Server.MapPath("image\\") + tii.i_uri);
            File.Delete(Server.MapPath("image\\_") + tii.i_uri);
        }
        catch (Exception ex)
        {
            Tunnel.Common.Message.Show(ex.Message);
        }
        ti.Delete(Convert.ToInt32(Id));
        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 + "','信息发布>>图片管理>>删除图片。标题:" + tii.i_name + "','" + Tunnel.Common.Common.GetIp() + "',2)";
        Tunnel.Data.DbHelperSQL.ExecuteSql(strsql);
        PageBind();
    }