Esempio n. 1
0
        public static void PopulateTasksIntoTaskTable(SatyamJobSubmissionsTableAccessEntry job)
        {
            List <SatyamTask> tasks = generate(job);

            if (tasks == null)
            {
                return;
            }

            SatyamTaskTableAccess dbAccess = new SatyamTaskTableAccess();

            foreach (SatyamTask task in tasks)
            {
                String   JobTemplateType = job.JobTemplateType;
                String   UserID          = job.UserID;
                String   JobGUID         = job.JobGUID;
                String   JsonString      = JSonUtils.ConvertObjectToJSon <SatyamTask>(task);
                DateTime SubmitTime      = job.JobSubmitTime;
                double   price           = task.jobEntry.amazonHITInformation.Price;
                dbAccess.AddEntry(JobTemplateType, UserID, JobGUID, JsonString, SubmitTime, price);
            }
            dbAccess.close();

            // add the total task number to job submission table
            SatyamJobSubmissionsTableAccess jobDB = new SatyamJobSubmissionsTableAccess();

            jobDB.UpdateEntryProgress(job.JobGUID, tasks.Count.ToString());
            jobDB.close();
        }