示例#1
0
        public async Task <ActionResult> statuslog(string id, string dataSetId, string dataSetIndexId, string pageNo)
        {
            PageViewPost objPageViewPost = new PageViewPost();

            if (string.IsNullOrEmpty(pageNo))
            {
                objPageViewPost.pageNo = 1;
            }
            else
            {
                objPageViewPost.pageNo = Convert.ToInt32(pageNo);
            }
            ViewBag.Nextpage            = objPageViewPost.pageNo + 1;
            ViewBag.Preview             = objPageViewPost.pageNo - 1;
            objPageViewPost.noOfRecords = 50;

            ViewBag.dataSetId      = dataSetId;
            ViewBag.dataSetIndexId = dataSetIndexId;
            ViewBag.id             = id;

            ViewRunViewModel view = new ViewRunViewModel();
            await view.GenerateViewRunStatusLog(Session, id, dataSetId, objPageViewPost, "STATUS");

            return(View(view));
        }
示例#2
0
        public async Task GenerateViewRunStatusLog(HttpSessionStateBase currentsession, string id,
                                                   string DatasetId, PageViewPost objPageViewPost, string pageName)
        {
            DataSetIndexRunDetailView = new DataSetIndexRunDetailView();

            string        accessToken   = UserSession.accessToken(currentsession);
            HttpGetObject objHttpObject = new HttpGetObject();

            objHttpObject.accessToken = accessToken;
            objHttpObject.endPoint    = endpointrundetail;
            objHttpObject.id          = id;
            APIClient apiclient = new APIClient();
            //HttpResponseMessage dsResp = await apiclient.getAsync(objHttpObject);
            HttpResponseMessage dsResp = await apiclient.postAsync(objHttpObject, apiclient.convertToContent(objPageViewPost));

            if (!dsResp.IsSuccessStatusCode)
            {
                errorOccurred = true;
            }

            string val = await dsResp.Content.ReadAsStringAsync();

            DataSetIndexRunDetailView = JsonConvert.DeserializeObject <DataSetIndexRunDetailView>(val);

            IsNext = false;
            IsPrev = false;
            if (objPageViewPost.pageNo != 1)
            {
                IsPrev = true;
            }

            objPageViewPost.pageNo = objPageViewPost.pageNo + 1;

            dsResp = await apiclient.postAsync(objHttpObject, apiclient.convertToContent(objPageViewPost));

            val = await dsResp.Content.ReadAsStringAsync();

            DataSetIndexRunDetailView RunLogDetailSvcNext = JsonConvert.DeserializeObject <DataSetIndexRunDetailView>(val);

            if (RunLogDetailSvcNext.status.Count > 0 && pageName == "STATUS")
            {
                IsNext = true;
            }
            else if (RunLogDetailSvcNext.indexLog.Count > 0 && pageName == "DETAIL")
            {
                IsNext = true;
            }


            DataSetIndexViewModel objDataSetIndexViewModel = new DataSetIndexViewModel();
            await objDataSetIndexViewModel.dataSetName(currentsession, DatasetId);

            DataSetName = objDataSetIndexViewModel.DataSetName;
        }