Esempio n. 1
0
        private void PerformRequestData(IEnumerable retrievedData)
        {
            try
            {
                String pagerString = String.Empty;
                String rowData     = String.Empty;

                rowData = LoadStringData(retrievedData);

                pagerString  = "{";
                pagerString += "totalpages: '" + Totalpages + "', ";
                pagerString += "currentpage: '" + CurrentPage + "', ";
                pagerString += "pagerecords: '" + PageRecords + "',";
                pagerString += "rows: ";
                pagerString += rowData;
                LoadUserData();
                if (UserDataString.IsNotNullOrEmpty())
                {
                    pagerString += String.Format(",\"userdata\":");
                    pagerString += "{";
                    pagerString += String.Format("{0}", UserDataString);
                    pagerString += "}";
                }
                pagerString += "}";
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.ContentType = "text/javascript";
                HttpContext.Current.Response.Write(pagerString);
                HttpContext.Current.Response.Flush();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        private void PerformRequestData(IEnumerable retrievedData)
        {
            try
            {
                String pagerString = String.Empty;
                String rowData     = String.Empty;

                rowData = LoadStringData(retrievedData);

                pagerString  = "{";
                pagerString += "totalpages: '" + Totalpages + "', ";
                pagerString += "currentpage: '" + CurrentPage + "', ";
                pagerString += "pagerecords: '" + PageRecords + "',";
                pagerString += "rows: ";
                pagerString += rowData;
                LoadUserData();
                if (UserDataString.IsNotNullOrEmpty())
                {
                    pagerString += String.Format(",\"userdata\":");
                    pagerString += "{";
                    pagerString += String.Format("{0}", UserDataString);
                    pagerString += "}";
                }

                pagerString += "}";

                String vid_Ref         = HttpContext.Current.Request.QueryString["vid_Ref"];
                String NeedSetUncahage = HttpContext.Current.Request.QueryString["NeedSetUncahage"];
                if (NeedSetUncahage != "false")
                {
                    if (vid_Ref.IsNotNull())
                    {
                        foreach (BaseItem item in retrievedData)
                        {
                            item.SetUnchanged();
                        }
                    }
                }

                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.ContentType = "text/javascript";
                HttpContext.Current.Response.Write(pagerString);
                HttpContext.Current.Response.Flush();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 3
0
 private void LoadUserData()
 {
     try
     {
         var strColumn = AggregateColumn.Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).ToList();
         foreach (DataColumn dc in SourceTable.Columns)
         {
             if (dc.DataType != typeof(String) && dc.DataType != typeof(DateTime) && dc.DataType != typeof(Boolean))
             {
                 try
                 {
                     String strColumnWith_Agg_Type = strColumn.Find(item => item.Contains("[" + dc.ColumnName + "]:"));
                     if (strColumnWith_Agg_Type.IsNotNullOrEmpty())
                     {
                         String[] arrColumnWith_Agg_Type = strColumnWith_Agg_Type.Split(":".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                         if (arrColumnWith_Agg_Type[0].ToUpper() == "[" + dc.ColumnName.ToUpper() + "]")
                         {
                             Object val = SourceTable.Compute(arrColumnWith_Agg_Type[1] + "(" + dc.ColumnName + ")", String.Empty);
                             if (UserDataString.IsNotNullOrEmpty())
                             {
                                 UserDataString += String.Format(",\"{0}\":\"{1}\"", dc.ColumnName, val);
                             }
                             else
                             {
                                 UserDataString += String.Format("\"{0}\":\"{1}\"", dc.ColumnName, val);
                             }
                         }
                     }
                 }
                 catch
                 {
                 };
             }
         }
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }