当前位置: 首页>>代码示例>>C#>>正文


C# Callback.GetDataView方法代码示例

本文整理汇总了C#中Callback.GetDataView方法的典型用法代码示例。如果您正苦于以下问题:C# Callback.GetDataView方法的具体用法?C# Callback.GetDataView怎么用?C# Callback.GetDataView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Callback的用法示例。


在下文中一共展示了Callback.GetDataView方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getOAT_string

    private string getOAT_string()
    {
        string CallbackResult = string.Empty;

        if (Request.Files.Count == 0) // Data is sent via HTTP POST method only. (No file uploading is done in this case)
        {
            // Retreive all form post parameters. They can vary from page to page requirements.
            string reqMethod = Request["callback"].ToString();
            string reqParams = Request[Constants.RequestHeaderParamNames.Param1];

            Callback OCallback = new Callback(this.Page);

            switch (reqMethod)
            {

                case "dvSelector":
                    CallbackResult = OCallback.GetDataView(reqParams);
                    break;
                case "dvQDS":
                    CallbackResult = OCallback.GetDataViewDataNids(reqParams);
                    break;

                default:
                    break;
            }
        }
        else // CSV or XLS file is uploaded
        {
            if (Request.Files[0].FileName.EndsWith(".csv")) // CSV Format
            {
                CallbackResult = GenerateOAT_String(Request.Files[0].InputStream);
            }
            else if (Request.Files[0].FileName.EndsWith(".xls")) // XLS Format
            {
                #region XLS file handling
                string tempPath = Server.MapPath("../../stock");
                string xlsFilePath = tempPath + "\\temp.xls";
                string csvFilePath = tempPath + "\\temp.csv";
                if (SaveXlsFileToTempLocation(Request.Files[0].InputStream, xlsFilePath))// Save xls file
                {
                    if (convertXLSToCSV(xlsFilePath, csvFilePath)) // Convert xls to csv
                    {
                        StreamReader csvStream = new StreamReader(csvFilePath);
                        CallbackResult = GenerateOAT_String(csvStream.BaseStream);
                        csvStream.Close();
                        csvStream.Dispose();
                        // Delete files after done task once.
                        File.Delete(xlsFilePath);
                        File.Delete(csvFilePath);
                    }
                }
                #endregion
            }
        }

        return CallbackResult;
    }
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:57,代码来源:NormalizeData.aspx.cs

示例2: HandleCallBack

    private void HandleCallBack()
    {
        string RetVal;
        string RequestParam;
        string RequestParam2;
        string RequestParam3;
        string RequestParam4;
        string RequestParam5;
        string RequestParam6;
        string RequestParam7;
        CallbackType OCallbackType;
        Callback OCallback;

        RetVal = string.Empty;
        RequestParam = string.Empty;
        RequestParam2 = string.Empty;
        RequestParam3 = string.Empty;
        RequestParam4 = string.Empty;
        RequestParam5 = string.Empty;
        RequestParam6 = string.Empty;
        RequestParam7 = string.Empty;
        OCallback = null;
        OCallbackType = CallbackType.None;

        try
        {
            if (Request.Params.Count > 0)
            {
                OCallbackType = (CallbackType)int.Parse(Request[Constants.RequestHeaderParamNames.CallBack].ToString());
                RequestParam = Request[Constants.RequestHeaderParamNames.Param1];
                RequestParam2 = Request[Constants.RequestHeaderParamNames.Param2];
                RequestParam3 = Request[Constants.RequestHeaderParamNames.Param3];
                RequestParam4 = Request[Constants.RequestHeaderParamNames.Param4];
                RequestParam5 = Request[Constants.RequestHeaderParamNames.Param5];

                RequestParam6 = Request[Constants.RequestHeaderParamNames.Param6];
                RequestParam7 = Request[Constants.RequestHeaderParamNames.Param7];
                OCallback = new Callback(this.Page);

                //get browser type to handle internet explorer 8 issue of ajax 32 bit size [reurn Image url in this case]
                if (!string.IsNullOrEmpty(Request.QueryString["bType"]))
                {
                    OCallback.BrowserType = Convert.ToString(Request.QueryString["bType"]).Trim();
                }

                switch (OCallbackType)
                {
                    case CallbackType.GetQdsResultsForAdaptation:
                        RetVal = OCallback.GetQdsResultsForAdaptation(RequestParam);
                        break;
                    case CallbackType.GenerateCacheResults:
                        RetVal = OCallback.GenerateCacheResults(RequestParam);
                        break;
                    case CallbackType.GetDataViewDataNidsMulipleDbs:
                        RetVal = OCallback.GetDataViewDataNidsMulipleDbs(RequestParam);
                        break;
                    case CallbackType.GetLangDBcode:
                        RetVal = OCallback.GetLangDBcode(RequestParam);
                        break;
                    case CallbackType.GetOatStringFromFileUpload:
                        RetVal = OCallback.getOATfromFile(RequestParam);
                        break;
                    case CallbackType.GetIndWhereDataExists:
                        RetVal = OCallback.GetIndWhereDataExists(RequestParam);
                        break;
                    case CallbackType.GetAreaWhereDataExists:
                        RetVal = OCallback.GetAreaWhereDataExists(RequestParam);
                        break;
                    case CallbackType.GetDataView:
                        RetVal = OCallback.GetDataView(RequestParam);
                        break;
                    case CallbackType.GetQDSResults:
                        if (Session["IsMapServer"] != null)
                        {
                            Session.Remove("IsMapServer");
                        }
                        RetVal = OCallback.GetQDSResults(RequestParam);
                        break;
                    case CallbackType.GetDataViewDataNids:
                        RetVal = OCallback.GetDataViewDataNids(RequestParam);
                        break;
                    case CallbackType.GetGalleryThumbnails:
                        RetVal = OCallback.GetGalleryThumbnails(RequestParam);
                        break;
                    case CallbackType.GetAreas:
                        RetVal = OCallback.GetAreas(RequestParam);
                        break;
                    case CallbackType.GetSGs:
                        RetVal = OCallback.GetSGs(RequestParam);
                        break;
                    case CallbackType.GetSources:
                        RetVal = OCallback.GetSources(RequestParam);
                        break;
                    case CallbackType.GetTPs:
                        RetVal = OCallback.GetTPs(RequestParam);
                        break;
                    case CallbackType.GetASDatabases:
                        RetVal = OCallback.GetASDatabases(RequestParam);
                        break;
                    case CallbackType.GetASResults:
//.........这里部分代码省略.........
开发者ID:SDRC-India,项目名称:sdrcdevinfo,代码行数:101,代码来源:Callback.aspx.cs


注:本文中的Callback.GetDataView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。