public static string getJobStatus(string request)
        {
            SatyamJobSubmissionsTableAccess             dbaccess = new SatyamJobSubmissionsTableAccess();
            List <SatyamJobSubmissionsTableAccessEntry> entries  = dbaccess.getAllEntriesByUserID(request);
            string JsonString = JSonUtils.ConvertObjectToJSon(entries);

            dbaccess.close();
            return(JsonString);
        }
Ejemplo n.º 2
0
        private void populateRows()
        {
            SatyamJobSubmissionsTableAccess             dbaccess = new SatyamJobSubmissionsTableAccess();
            List <SatyamJobSubmissionsTableAccessEntry> entries  = dbaccess.getAllEntriesByUserID(UserId);

            dbaccess.close();
            List <TableRow> rows    = new List <TableRow>();
            int             maxShow = 10;

            for (int i = entries.Count - 1; i >= Math.Max(0, entries.Count - 1 - maxShow); i--)
            {
                TableRow row = new TableRow();
                row.JobGUID         = entries[i].JobGUID;
                row.JobTemplateType = entries[i].JobTemplateType;
                row.JobSubmitTime   = entries[i].JobSubmitTime.ToLocalTime().ToString();
                row.JobStatus       = entries[i].JobStatus;
                SatyamTaskTableAccess taskDB = new SatyamTaskTableAccess();
                int remainingTasks           = taskDB.getTasksCountByGUID(row.JobGUID);
                taskDB.close();

                row.TaskPending = remainingTasks.ToString();
                if (entries[i].JobProgress == "")
                {
                    row.JobProgress = "1";
                }
                else
                {
                    row.JobProgress = (1 - (double)remainingTasks / Convert.ToDouble(entries[i].JobProgress)).ToString("0.000");
                }


                int totalResults, totalAggregated;
                row.ApprovalRate    = SatyamResultsAnalysis.getPaymentRateByGUID(row.JobGUID, out totalResults, out totalAggregated).ToString("0.000");
                row.TotalResults    = totalResults.ToString();
                row.TotalAggregated = totalAggregated.ToString();

                rows.Add(row);
            }

            rpt.DataSource = rows;
            rpt.DataBind();
        }