示例#1
0
 public Form1()
 {
     InitializeComponent();
     //Initialize a new controller
     ValkyrieController.Initialize(new SQLServerDBHandler());
     using (QuickData Query = new QuickData())
     {
         Query.delete("delete from WFInstances");
         Query.insert("DBCC CHECKIDENT (WFInstances, RESEED, 1)");
         Query.delete("delete from StepStatus");
         Query.delete("delete from PendingStatusUpdates");
         Query.insert("DBCC CHECKIDENT (PendingStatusUpdates, RESEED, 1)");
     }
     //create a new step handler
     ValkProcessorStepHandler StepHandler = new ValkProcessorStepHandler();
     //register step handler with a static processor
     ValkProcessor.AddStepHandler(StepHandler);
     //kickoff processor
     Thread Processor = new Thread(new ThreadStart(ValkProcessor.RunProcessor));
     Processor.Start();
 }
示例#2
0
 private void InsertOrders()
 {
     for (int i = 0; i < 100; i++)
     {
         insertIDAt++;
         using (QuickData Query = new QuickData())
         {
             QDInserter ins = new QDInserter("WFInstances");
             ins.insert("InstanceKey", "P" + insertIDAt.ToString(), Types.String);
             ins.insert("Status", "pending", Types.String);
             ins.insert("WFType", "P", Types.String);
             Query.insert(ins);
         }
     }
     Console.WriteLine("Orders Inserted");
 }
    void createFileSelects()
    {
        clearFileSelects();

        string           path       = Application.persistentDataPath + "/quickData.sav";
        bool             fileExists = false;
        List <QuickData> quickDatas = new List <QuickData>();

#if !UNITY_WEBPLAYER
        fileExists = File.Exists(path);
#endif

        if (fileExists)
        {
            byte[]     bArr    = File.ReadAllBytes(path);
            string     content = Utilities.bytesToString(bArr);
            Properties prop    = new Properties(content);
            for (int i = 0; i < NUM_SAVE_FILES; i++)
            {
                QuickData qd = new QuickData();
                qd.create(
                    prop.getString("fn" + i, "-1"),
                    ((Vars.Difficulty)prop.getInt("diff" + i, 0)),
                    prop.getFloat("t" + i, -1),
                    prop.getFloat("info" + i, -1),
                    prop.getFloat("phys" + i, -1));
                quickDatas.Add(qd);
            }
        }
        else
        {
            for (int i = 0; i < NUM_SAVE_FILES; i++)
            {
                quickDatas.Add(new QuickData());
            }
        }



        for (int i = 0; i < quickDatas.Count; i++)
        {
            QuickData  qd   = quickDatas[i];
            GameObject fsGO = GameObject.Instantiate(fileSelectGameObject);
            fsGO.transform.SetParent(transform, false);
            FileSelect fs = fsGO.GetComponent <FileSelect>();
            fs.index    = i;
            fs.selected = false;
            fs.startPosition.Set(centerPos.x, centerPos.y - verticalSpacing * fs.index - fadeDistance);
            fs.GetComponent <RectTransform>().localPosition = fs.startPosition;
            fs.endPosition.Set(centerPos.x, centerPos.y - verticalSpacing * fs.index);
            fs.timeOffset = timeDiff * fs.index;
            if (qd.created)
            {
                fs.newFile = false;
                fs.setFileName(fs.index);
                fs.setPlayTime(qd.time);
                fs.setDifficulty(difficultyProperties.getString(((int)qd.difficulty) + "name"));
                fs.setInfoComplete(qd.infoPercent);
                fs.setPhysComplete(qd.physPercent);
            }
            else
            {
                fs.newFile = true;
            }
            fileSelects.Add(fs);
        }
    }