⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searchlandinfo.ascx.cs

📁 一个土地管理系统
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class UserControl_SearchLandInfo : System.Web.UI.UserControl
{
    private string fieldName = "landSerial";
    private string mode = "search";
    private string readOnly = "true";
 
    public string FieldName
    {
        get { return fieldName; }
        set { fieldName = value; }
    }
    public string Mode
    {
        get { return mode; }
        set { mode = value; }
    }
    public string ReadOnly 
    {
        get { return readOnly; }
        set { readOnly = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            switch(mode)
            {
                case "list":
                    listModeInitial();
                    break;
                default:
                    break;
            }
        }
    }
    protected void GridResult_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        //try
        //{
            GridResult.PageIndex = e.NewPageIndex;
            BindSearch();
        //}
        //catch 
        //{
           
        //}
    }
    protected void GridResulat_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        
        switch (e.CommandName)
        { 
            case "DeleteLand":
                int index = Convert.ToInt32(e.CommandArgument);
                string serial = GridResult.Rows[index].Cells[1].Text;
                LandData.deleteLandInfo(serial);
                BindSearch();
                break;
            default:
                break;
        }
    }
    protected void SearchAction_Click(object sender, EventArgs e)
    {
        BindSearch();
    }
    void BindSearch()
    {
        GridResult.DataSource = LandData.SearchLandInfo(fieldName, SearchKey.Text);
        GridResult.DataBind();
    }
    /// <summary>
    /// 列表情况下的初始化
    /// </summary>
    void listModeInitial()
    {
        SearchAction.Visible = false;
        SearchKey.Visible = false;
        BindSearch();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -