Ejemplo n.º 1
0
        protected void grdLibAttributes_Sorting(object sender, GridViewSortEventArgs e)
        {
            AttributeSettingsClient oClient = new AttributeSettingsClient(ServiceConfig.AttributeSettingsDataEndPoint(), ServiceConfig.AttributeSettingsDataUri());
            List <AttributeService.AttributeSettingsData> oList = new List <AttributeSettingsData>();

            oList = oClient.GetAttributeByLibrary(ViewState["LibraryId"].ToString().ToInt(), false);
            DataTable dtSortTable = new DataTable();

            dtSortTable = Common.ToDataTable(oList);
            if (dtSortTable != null)
            {
                DataView dvSortedView = new DataView(dtSortTable);
                dvSortedView.Sort           = e.SortExpression + " " + ViewState["SortDirection"].ToString();
                grdLibAttributes.DataSource = dvSortedView;
                grdLibAttributes.DataBind();

                if (ViewState["SortDirection"] != null)
                {
                    if (ViewState["SortDirection"].ToString() == "DESC")
                    {
                        ViewState["SortDirection"] = "ASC";
                    }
                    else
                    {
                        ViewState["SortDirection"] = "DESC";
                    }
                }
            }
        }
Ejemplo n.º 2
0
 private void FillLibraryAttributes()
 {
     if (ViewState["LibraryId"] != null)
     {
         if (ViewState["LibraryId"].ToString().ToInt() != 0)
         {
             AttributeSettingsClient oClient = new AttributeSettingsClient(ServiceConfig.AttributeSettingsDataEndPoint(), ServiceConfig.AttributeSettingsDataUri());
             grdLibAttributes.DataSource = oClient.GetAttributeByLibrary(ViewState["LibraryId"].ToString().ToInt(), false);
             grdLibAttributes.DataBind();
         }
     }
 }