Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ReferenceId = Convert.ToInt32(Request.QueryString["ReferenceId"]);
            CountryId = Convert.ToInt32(Request.QueryString["CountryId"]);
            CountyId = Convert.ToInt32(Request.QueryString["CountyId"]);
            if (!IsPostBack)
            {
                try
                {
                    ViewState["Column"] = "DEDTownlandsId";
                    ViewState["Sortorder"] = "desc";
                    DAL.general objGen = new DAL.general();
                   

                    DataSet ds = objGen.getdatatownland(ReferenceId, CountyId, CountryId);
                    DataSet ds1 = objGen.getdataset("select County from dbo.County where CountyId=" + CountyId + "");
                    CountyName = Convert.ToString(ds1.Tables[0].Rows[0][0]);
                    Repeater1.DataSource = ds;
                    Repeater1.DataBind();
                }
                catch (Exception ex)
                {


                }
               
            }
        }
Esempio n. 2
0
 protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == ViewState["Column"].ToString())
     {
         if (ViewState["Sortorder"].ToString() == "ASC")
             ViewState["Sortorder"] = "DESC";
         else
             ViewState["Sortorder"] = "ASC";
     }
     else
     {
         ViewState["Column"] = e.CommandName;
         ViewState["Sortorder"] = "ASC";
     }
     DAL.general objGen = new DAL.general();
     DataSet ds = objGen.getdatatownland(ReferenceId, CountyId, CountryId);
     DataView dvData = new DataView(ds.Tables[0]);
     dvData.Sort = ViewState["Column"] + " " + ViewState["Sortorder"];
     Repeater1.DataSource = dvData;
     Repeater1.DataBind();
 }