private static void Farm() { var target = SimpleTs.GetTarget(QC.Range, SimpleTs.DamageType.Magical); var allminions = MinionManager.GetMinions(Player.ServerPosition, Q.Range, MinionTypes.All, MinionTeam.Enemy, MinionOrderTypes.Health); if (Config.Item("UseQLane").GetValue <bool>()) { if (IsHuman) { R.Cast(); } foreach (var minion in allminions) { if (QC.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= QC.Range) { QC.Cast(minion); } if (WC.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= WC.Range) { WC.Cast(minion); } if (EC.IsReady() && minion.IsValidTarget() && Player.Distance(minion) <= EC.Range) { EC.Cast(minion); } } } }
private static float ComboDamage(Obj_AI_Base hero) { var dmg = 0d; if (ObjectManager.Player.GetSpellSlot("SummonerIgnite") != SpellSlot.Unknown) { dmg += Player.GetSummonerSpellDamage(hero, Damage.SummonerSpell.Ignite); } if (Items.HasItem(3153) && Items.CanUseItem(3153)) { dmg += Player.GetItemDamage(hero, Damage.DamageItems.Botrk); } if (Items.HasItem(3144) && Items.CanUseItem(3144)) { dmg += Player.GetItemDamage(hero, Damage.DamageItems.Bilgewater); } if (QC.IsReady()) { dmg += Player.GetSpellDamage(hero, SpellSlot.Q); } if (EC.IsReady()) { dmg += Player.GetSpellDamage(hero, SpellSlot.E); } if (WC.IsReady()) { dmg += Player.GetSpellDamage(hero, SpellSlot.W); } if (Q.IsReady() && !IsCougar) { dmg += Player.GetSpellDamage(hero, SpellSlot.Q); } return((float)dmg); }
private static void Farm() { foreach ( Obj_AI_Minion Minion in ObjectManager.Get<Obj_AI_Minion>() .Where( minion => minion.Team != Player.Team && !minion.IsDead && Vector2.Distance(minion.ServerPosition.To2D(), Player.ServerPosition.To2D()) < 600f) .OrderBy(minion => Vector2.Distance(minion.Position.To2D(), Player.Position.To2D()))) { if (IsCougar) { if (QC.IsReady() && Config.Item("UseQLane").GetValue<bool>() && Player.Distance(Minion) < QC.Range) QC.Cast(); else if (WC.IsReady() && Config.Item("UseWLane").GetValue<bool>() && Player.Distance(Minion) > 200f) WC.Cast(Minion); else if (EC.IsReady() && Config.Item("UseELane").GetValue<bool>() && Player.Distance(Minion) < EC.Range) EC.Cast(Minion); } else if (R.IsReady() && Config.Item("farm_R").GetValue<KeyBind>().Active) R.Cast(); else if (E.IsReady() && !Config.Item("farm_R").GetValue<KeyBind>().Active && Config.Item("farm_E1").GetValue<bool>() && (100*(Player.Mana/Player.MaxMana)) > Config.Item("Lane").GetValue<Slider>().Value) E.CastOnUnit(Player); return; } }
private void button1_Click(object sender, EventArgs e) { _am.Vars["时间"] = QC.Int(textBox2.Text); _am.Vars["路径"] = QC.Int(textBox3.Text); object r = _am.Compute(textBox1.Text); label4.Text = "结果 " + r.ToString( ); }
public ActionResult _Edit(QC qc) { if (ModelState.IsValid) { db.Entry(qc).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(_Details(qc.Id)); } else { return(PartialView(qc)); } }
public ActionResult _Create(QC qc) { if (ModelState.IsValid) { db.QCs.Add(qc); qc.Visible = true; db.SaveChanges(); return(_Details(qc.Id)); } else { return(PartialView(qc)); } }
public QC getQus(int pId, int paId, string yn) { QC QU = new QC(); string command = "SELECT * FROM [Y_Qu] WHERE Problem_ID ='" + pId + "' AND Parent_ID='" + paId + "' AND Y_N='" + yn + "'"; SqlCommand com = new SqlCommand(command, con); SqlDataReader reader; con.Open(); reader = com.ExecuteReader(); if (reader.Read()) { QU.id = reader.GetInt32(0); QU.paid = reader.GetInt32(1); QU.pid = reader.GetInt32(2); QU.qu = reader.GetString(3); QU.isy = reader.GetInt32(4); QU.isn = reader.GetInt32(5); QU.yn = reader.GetString(6); } reader.Close(); con.Close(); return(QU); }
/// <summary> /// 开始测试。 /// </summary> public override void Start() { #region 准备 Logger.Info("Core 是 库的重要部分, 提供了简化代码量的方法。"); #endregion #region QC Logger.Info("QC 提供了常用转换函数"); Logger.Write(QC.IP(QC.IP("127.158.0.0"))); #endregion #region RegExp Logger.Info("正则表达式"); Logger.Write(RegExp.Test("4", RegExp.Number)); #endregion #region Check Logger.Info("Check 容纳了检查字符串的方法"); Logger.Write(" Check.CheckRequestString(\"asdag\'g1=1\") -> {0}", Check.CheckRequestString("asdag'g1=1")); Logger.Write(" Check.IsIP(\"192.168.1.1\") -> {0}", Check.IsIP("192.168.1.1")); #endregion #region Str Logger.Info("字符串"); DateTime dt = DateTime.Now.Add(new TimeSpan(4, 0, 0, -1)); Logger.Write(Str.ToTimeString(dt)); #endregion #region ArrayString Logger.Info("ArrayString 数组字符串"); ArrayString s = new ArrayString("aaa,bbb,ccc", ','); Logger.Write(s[0]); s[1] = "bbbb"; Logger.Write(s); s.Add("sss"); Logger.Write(s); s.RemoveAt(1); Logger.Write(s); s.Clear(); Logger.Write(s == ""); s += "aaa,ddd,ccc"; Logger.Write(s); s.Sort(); Logger.Write(s); s -= "aaa"; Logger.Write(s); s -= s; Logger.Write(s); Logger.Write(ArrayString.ReplaceValue("aaa,aaaaa,wqe,aaa,sfd,aaa", "aaa", "gg", ",")); #endregion #region StringHelper Logger.Info("使用 StringHelper辅助字符串"); StringHelper sh = new StringHelper(); string input = @"用法 223, 三大殿,固定首发"; sh.Pattern = @"用法{$N}, 三大殿,{$F}"; sh.Match(input); foreach (string k in sh) { Logger.Write("{0} -> {1}", k, sh[k]); } #endregion }
private void Jungle() { foreach (var jungle in GameObjects.Jungle.Where(m => m.IsValidTarget(QH.Range)).ToList()) { if (!jungle.IsValidTarget() || !jungle.IsValidSpellTarget()) { return; } float manapercent = Menu["jungleclear"]["manaj"].As <MenuSlider>().Value; if (Player.ManaPercent() >= manapercent) { bool useQ = Menu["jungleclear"]["usejq"].Enabled; if (useQ) { switch (Menu["jungleclear"]["qo"].As <MenuList>().Value) { case 0: if (QH.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "JavelinToss" && jungle.IsValidTarget(QH.Range)) { QH.Cast(jungle); } else if (QC.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "Takedown" && jungle.IsValidTarget(QC.Range)) { QC.Cast(); } break; case 1: if (QH.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "JavelinToss" && jungle.IsValidTarget(QH.Range)) { QH.Cast(jungle); } break; case 2: if (QC.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "Takedown" && jungle.IsValidTarget(QC.Range)) { QC.Cast(); } break; } } bool useW = Menu["jungleclear"]["usejw"].Enabled; if (useW) { switch (Menu["jungleclear"]["wo"].As <MenuList>().Value) { case 0: if (WH.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Bushwhack" && jungle.IsValidTarget(WH.Range)) { WH.Cast(jungle); } else if (WC.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Pounce" && jungle.IsValidTarget(WC.Range)) { WC.Cast(jungle); } break; case 1: if (WH.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Bushwhack" && jungle.IsValidTarget(WH.Range)) { WH.Cast(jungle); } break; case 2: if (WC.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Pounce" && jungle.IsValidTarget(WC.Range)) { WC.Cast(jungle); } else if (WCL.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Pounce" && jungle.IsValidTarget(WCL.Range) && jungle.HasBuff("NidaleePassiveHunted")) { WCL.Cast(jungle); } break; } } bool useE = Menu["jungleclear"]["usejce"].Enabled; if (useE && Player.SpellBook.GetSpell(SpellSlot.E).Name == "Swipe" && EC.Ready && jungle.IsValidTarget(EC.Range)) { EC.Cast(jungle); } bool useR = Menu["jungleclear"]["usejr"].Enabled; if (useR) { switch (Menu["combo"]["ro"].As <MenuList>().Value) { case 0: if (R.Ready && !QH.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "JavelinToss" && jungle.IsValidTarget(QC.Range)) { R.Cast(); } else if (R.Ready && !QC.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "Takedown" && jungle.IsValidTarget(QH.Range)) { R.Cast(); } else if (R.Ready && !jungle.IsValidTarget(WCL.Range) && Player.SpellBook.GetSpell(SpellSlot.Q).Name != "JavelinToss" || jungle == null) { R.Cast(); } break; } } } } }
private void OnCombo() { bool useQ = Menu["combo"]["useq"].Enabled; if (useQ) { var QHuman = GetBestEnemyHeroTargetInRange(QH.Range); var QCougar = GetBestEnemyHeroTargetInRange(QC.Range); switch (Menu["combo"]["qo"].As <MenuList>().Value) { case 0: if (QH.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "JavelinToss" && QHuman.IsValidTarget(QH.Range)) { QH.Cast(QHuman); } else if (QC.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "Takedown" && QCougar.IsValidTarget(QC.Range)) { QC.Cast(); } break; case 1: if (QH.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "JavelinToss" && QHuman.IsValidTarget(QH.Range)) { QH.Cast(QHuman); } break; case 2: if (QC.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "Takedown" && QCougar.IsValidTarget(QC.Range)) { QC.Cast(); } break; } } bool useW = Menu["combo"]["usew"].Enabled; if (useW) { var WHuman = GetBestEnemyHeroTargetInRange(WH.Range); var WCougar = GetBestEnemyHeroTargetInRange(WC.Range); switch (Menu["combo"]["wo"].As <MenuList>().Value) { case 0: if (WH.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Bushwhack" && WHuman.IsValidTarget(WH.Range)) { WH.Cast(WHuman); } else if (WC.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Pounce" && WCougar.IsValidTarget(WC.Range)) { WC.Cast(WCougar); } break; case 1: if (WH.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Bushwhack" && WHuman.IsValidTarget(WH.Range)) { WH.Cast(WHuman); } break; case 2: if (WC.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Pounce" && WCougar.IsValidTarget(WC.Range)) { WC.Cast(WCougar); } else if (WCL.Ready && Player.SpellBook.GetSpell(SpellSlot.W).Name == "Pounce" && WCougar.IsValidTarget(WCL.Range) && WCougar.HasBuff("NidaleePassiveHunted")) { WCL.Cast(WCougar); } break; } } bool useE = Menu["combo"]["usee"].Enabled; float hpe = Menu["combo"]["useeh"].As <MenuSlider>().Value; float manae = Menu["combo"]["useehm"].As <MenuSlider>().Value; if (useE) { var ECougar = GetBestEnemyHeroTargetInRange(EC.Range); switch (Menu["combo"]["eo"].As <MenuList>().Value) { case 0: if (EH.Ready && Player.SpellBook.GetSpell(SpellSlot.E).Name == "PrimalSurge" && Player.ManaPercent() >= manae && Player.HealthPercent() <= hpe) { EH.Cast(Player); } else if (EC.Ready && Player.SpellBook.GetSpell(SpellSlot.E).Name == "Swipe" && ECougar.IsValidTarget(EC.Range)) { EC.Cast(ECougar); } break; case 1: if (EH.Ready && Player.SpellBook.GetSpell(SpellSlot.E).Name == "PrimalSurge" && Player.ManaPercent() >= manae && Player.HealthPercent() <= hpe) { EH.Cast(Player); } break; case 2: if (EC.Ready && Player.SpellBook.GetSpell(SpellSlot.E).Name == "Swipe" && ECougar.IsValidTarget(EC.Range)) { EC.Cast(ECougar); } break; } } bool useR = Menu["combo"]["user"].Enabled; float rangeR = Menu["combo"]["userr"].As <MenuSlider>().Value; if (useR) { var RTarget = GetBestEnemyHeroTargetInRange(rangeR); switch (Menu["combo"]["ro"].As <MenuList>().Value) { case 0: if (R.Ready && !QH.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "JavelinToss" && RTarget.IsValidTarget(WC.Range)) { R.Cast(); } else if (R.Ready && !QC.Ready && Player.SpellBook.GetSpell(SpellSlot.Q).Name == "Takedown" && RTarget.IsValidTarget(QH.Range)) { R.Cast(); } else if (R.Ready && !RTarget.IsValidTarget(WCL.Range) && Player.SpellBook.GetSpell(SpellSlot.Q).Name != "JavelinToss") { R.Cast(); } break; } } }
private static void Combo() { var target = TargetSelector.GetTarget(Q.Range, TargetSelector.DamageType.Magical); Orbwalker.SetAttack((!Q.IsReady() || W.IsReady())); var itemsDfg = Config.Item("UseItemsdfg").GetValue <bool>(); var itemsIgnite = Config.Item("UseItemsignite").GetValue <bool>(); if (target != null) { if (_dfg.IsReady() && target.HasBuff("nidaleepassivehunted", true) && Player.Distance(target as AttackableUnit) <= _dfg.Range && itemsDfg && target.Health <= ComboDamage(target)) { _dfg.Cast(target); } if (itemsIgnite && IgniteSlot != SpellSlot.Unknown && Player.Spellbook.CanUseSpell(IgniteSlot) == SpellState.Ready) { if (ComboDamage(target) > target.Health) { Player.Spellbook.CastSpell(IgniteSlot, target); } } if (Q.IsReady() && IsHuman && Player.Distance(target) <= Q.Range && Config.Item("UseQCombo").GetValue <bool>()) { var prediction = Q.GetPrediction(target); if (prediction.Hitchance >= QHitChanceCombo()) { Q.Cast(prediction.CastPosition); } } if (W.IsReady() && IsHuman && Player.Distance(target) <= W.Range && Config.Item("UseWCombo").GetValue <bool>()) { W.Cast(target); } if (R.IsReady() && IsHuman && Config.Item("UseRCombo").GetValue <bool>() && Player.Distance(target) <= 625) { if (IsHuman) { R.Cast(); } if (IsCougar) { if (WC.IsReady() && Config.Item("UseWComboCougar").GetValue <bool>() && Player.Distance(target) <= WC.Range) { WC.Cast(target); } if (EC.IsReady() && Config.Item("UseEComboCougar").GetValue <bool>() && Player.Distance(target) <= EC.Range) { EC.Cast(target); } if (QC.IsReady() && Config.Item("UseQComboCougar").GetValue <bool>() && Player.Distance(target) <= QC.Range) { Orbwalker.SetAttack(true); QC.Cast(); } } } if (IsCougar && Player.Distance(target) < 625) { if (IsHuman && R.IsReady()) { R.Cast(); } if (IsCougar) { if (WC.IsReady() && Config.Item("UseWComboCougar").GetValue <bool>() && Player.Distance(target) <= WC.Range) { WC.Cast(target); } if (EC.IsReady() && Config.Item("UseEComboCougar").GetValue <bool>() && Player.Distance(target) <= EC.Range) { EC.Cast(target); } if (QC.IsReady() && Config.Item("UseQComboCougar").GetValue <bool>() && Player.Distance(target) <= QC.Range) { Orbwalker.SetAttack(true); QC.Cast(); } } } if (R.IsReady() && IsCougar && Config.Item("UseRCombo").GetValue <bool>() && Player.Distance(target) > WC.Range) { R.Cast(); } if (R.IsReady() && IsCougar && Player.Distance(target) > EC.Range && Config.Item("UseRCombo").GetValue <bool>()) { R.Cast(); } } UseItemes(target); }
private static void Combo() { var target = SimpleTs.GetTarget(Q.Range, SimpleTs.DamageType.Magical); Orbwalker.SetAttack((!Q.IsReady() || W.IsReady())); if (target != null) { if (IsHuman && Player.Distance(target) <= Q.Range && Config.Item("UseQCombo").GetValue <bool>() && Q.IsReady()) { Q.Cast(target, false); } if (IsHuman && Player.Distance(target) <= W.Range && Config.Item("UseWCombo").GetValue <bool>() && W.IsReady()) { W.Cast(target); } if (IsHuman && Config.Item("UseRCombo").GetValue <bool>() && Player.Distance(target) <= 625 && R.IsReady()) { if (IsHuman) { R.Cast(); } if (IsCougar) { if (Config.Item("UseWComboCougar").GetValue <bool>() && Player.Distance(target) <= WC.Range) { WC.Cast(target); } if (Config.Item("UseEComboCougar").GetValue <bool>() && Player.Distance(target) <= EC.Range) { EC.Cast(target); } if (Config.Item("UseQComboCougar").GetValue <bool>() && Player.Distance(target) <= Q.Range) { Orbwalker.SetAttack(true); QC.Cast(target); } } } if (IsCougar && Player.Distance(target) < 625) { if (IsHuman) { R.Cast(); } if (IsCougar) { if (Config.Item("UseWComboCougar").GetValue <bool>() && Player.Distance(target) <= WC.Range) { WC.Cast(target); } if (Config.Item("UseEComboCougar").GetValue <bool>() && Player.Distance(target) <= EC.Range) { EC.Cast(target); } if (Config.Item("UseQComboCougar").GetValue <bool>() && Player.Distance(target) <= Q.Range) { Orbwalker.SetAttack(true); QC.Cast(target); } } } if (IsCougar && Config.Item("UseRCombo").GetValue <bool>() && Player.Distance(target) > WC.Range) { R.Cast(); } if (IsCougar && Player.Distance(target) > EC.Range && Config.Item("UseRCombo").GetValue <bool>()) { R.Cast(); } if (Config.Item("UseItems").GetValue <bool>()) { BKR.Cast(target); YOU.Cast(); BWC.Cast(target); DFG.Cast(target); SOD.Cast(); FQM.Cast(target); } } }
private List <UserEventApplicationItem> BuildFile(string file) { List <UserEventApplicationItem> usersFile = new List <UserEventApplicationItem>(); List <string> keys = new List <string>(); file = file.Substring(file.IndexOf(",", StringComparison.Ordinal) + 1); byte[] bytes = Convert.FromBase64String(file); using (MemoryStream stream = new MemoryStream(bytes)) { using (var xlPackage = new ExcelPackage(stream)) { var baseWorksheet = xlPackage.Workbook.Worksheets[0]; var currentLine = 2; while (baseWorksheet.Cells[currentLine, 3].Value != null && baseWorksheet.Cells[currentLine, 2].Value != null) { /* * Id * Nome * Email * Data_Realização * Case Grupo * Nota_QC * Nota_TG * Nota_FA * Média_Autoavaliação * Média_Nota_QC * Média_Nota_TG * Média_Nota_FA * Média_Grupo * Nota_Professor_Grupo * Média_Final_Case * Destaque_Justificativa */ var user = new UserEventApplicationItem(); user.UserId = baseWorksheet.Cells[currentLine, 1].Value != null ? ObjectId.Parse(baseWorksheet.Cells[currentLine, 1].Value?.ToString()) : ObjectId.Empty; user.Name = baseWorksheet.Cells[currentLine, 2].Value?.ToString(); user.Email = baseWorksheet.Cells[currentLine, 3].Value?.ToString(); var baseGrades = new List <BaseValue>(); var QcGrade = baseWorksheet.Cells[currentLine, 11].Value?.ToString(); var TgGrade = baseWorksheet.Cells[currentLine, 12].Value?.ToString(); var FaGrade = baseWorksheet.Cells[currentLine, 13].Value?.ToString(); var finalGrade = baseWorksheet.Cells[currentLine, 16].Value?.ToString(); var featuredStudent = baseWorksheet.Cells[currentLine, 17].Value?.ToString(); baseGrades.Add(new BaseValue() { Key = "QC", Value = QcGrade != null && decimal.TryParse(QcGrade, out decimal QC) ? QC.ToString() : "0" });
static void FunctionTest() { QC.Test(); return; Google(); return; // IntPtr handle = Win32API.FindWindow(null, "Microsoft Internet Explorer"); qidian(); return; // KeyboardOp.SendChars("shrinerain"); //TestLog myLog = new TestLog(); //myLog.TestlogTemplate = @"E:\program\cs\AutoTester\Document\log.template"; //myLog.LogFile = @"G:\testlog.html"; //myLog.ProjectName = "Google Test"; //myLog.TestStep = "this is a test step"; //myLog.TestResultInfo = "PASS!"; //myLog.WriteLog(); //myLog.Close(); return; HTMLTestBrowser myHost = new HTMLTestBrowser(); myHost.Start(); myHost.MaxSize(); string url = @"http://google.com";// @"https://www.google.com/accounts/Login?continue=http://www.google.cn/&hl=zh-CN";// @"http://passport.baidu.com/?login&tpl=mn&u=http%3A//www.baidu.com/";// @"D:\Program\CS\AutoTester2005\test.htm";//@"http://passport.baidu.com/?login&tpl=mn&u=http%3A//www.baidu.com/";// @"http://www.cnbeta.com";// @"www.google.com"; // @"http://www.google.com/advanced_search?hl=en";// @"http://127.0.0.1/AutoTester/";// myHost.Load(url); HTMLTestObjectPool pool = new HTMLTestObjectPool(myHost); //HTMLTestTable table = (HTMLTestTable)pool.GetObjectByType("table", "111", 0); //HTMLTestButton btn = (HTMLTestButton)table.GetObjectByCell(0, 0, HTMLTestObjectType.Button); //btn.Click(); //pool.GetObjectByType("textbox", "电子邮件:", 0); //aHelper.PerformAction("test"); HTMLTestTextBox obj1 = (HTMLTestTextBox)pool.GetObjectByRect(432, 285, 365, 22, "textbox", false); //pool.GetObjectByProperty("name", "q"); //pool.GetObjectByName("q"); obj1.Input("statestreet"); //HTMLTestCheckBox cb = (HTMLTestCheckBox)pool.GetObjectByType("checkbox", "在此计算机上保存我的信息。", 0); //// HTMLTestCheckBox cb = (HTMLTestCheckBox)pool.GetObjectByType("checkbox", "记住我的登录状态", 0); //cb.UnCheck(); //pool.GetObjectByType("button", "登陆", 0); //aHelper.PerformAction(); //HTMLTestTextBox userName = (HTMLTestTextBox)pool.GetObjectByType("textbox", "用户名:", 0); //userName.Hover(); // HTMLTestLink link = (HTMLTestLink)pool.GetObjectByType("link", "ooo", 0); // HTMLTestTable table = (HTMLTestTable)pool.GetObjectByType("table", "111", 0); //HTMLTestButton btn = (HTMLTestButton)table.GetObjectByCell(0, 0); //btn.Click(); // HTMLTestTextBox rbtn = (HTMLTestTextBox)pool.GetObjectByType("textbox", "1", 0); //rbtn.Hover(); //HTMLTestComboBox cbBox = (HTMLTestComboBox)pool.GetObjectByName("num"); // cbBox.Select("20 results"); //HTMLTestButton obj2 = (HTMLTestButton)pool.GetObjectByType("button", "Google Sear", 0); //obj2.Click(); // myHost.WaitForNextPage(); //HTMLTestLink linkObj =(HTMLTestLink)pool.GetObjectByID("link1"); // linkObj.Click(); //HTMLTestButton btn = (HTMLTestButton)pool.GetObjectByID("btn1"); //btn.Click(); //Thread.Sleep(1000); //myHost.WaitForPopWindow(); //btn = (HTMLTestButton)pool.GetObjectByID("btn2"); //btn.Click(); // HTMLTestListBox listBox = (HTMLTestListBox)pool.GetObjectByID("ListBox1"); // listBox.SelectByIndex(5); }
protected override void Execute(CodeActivityContext context) { // Open the config file and get the connection string Configuration config = WebConfigurationManager.OpenWebConfiguration("/RequestWeb"); ConnectionStringsSection css = (ConnectionStringsSection)config.GetSection("connectionStrings"); string connectionString = css.ConnectionStrings["Request"].ConnectionString; // Lookup the Queue RequestDataContext dc = new RequestDataContext(connectionString); Queue queue = dc.Queues.SingleOrDefault(x => x.QueueName == QueueName.Get(context)); if (queue == null) { throw new InvalidProgramException("The specified queue (" + QueueName.Get(context) + ") was not found"); } if (queue.AllowSelection) { IEnumerable <Request> q = dc.Requests .Where(x => x.Queue.QueueName == QueueName.Get(context) && x.QC == QC.Get(context) && (x.AssignedOperator == null || x.AssignedOperator == OperatorID.Get(context))) .OrderBy(x => x.AssignedDate); if (q.Count() > 0) { Request[] reqList = new Request[q.Count()]; int i = 0; foreach (Request r in q) { reqList[i++] = r; } RequestList.Set(context, reqList); } } else { IEnumerable <Request> q = dc.Requests .Where(x => x.Queue.QueueName == QueueName.Get(context) && x.QC == QC.Get(context) && (x.AssignedOperator == null || x.AssignedOperator == OperatorID.Get(context))) .OrderBy(x => x.AssignedDate) .Take(1); if (q.Count() > 0) { Request r = q.First <Request>(); r.AssignedOperator = OperatorID.Get(context); dc.SubmitChanges(); Request[] reqList = new Request[1]; reqList[0] = r; RequestList.Set(context, reqList); } } }
public List <QC> getQuestions(int pId) { List <QC> allQU = new List <QC>(); string command = "SELECT * FROM [Y_Qu] WHERE Problem_ID ='" + pId + "'"; SqlCommand com = new SqlCommand(command, con); SqlDataReader reader; con.Open(); reader = com.ExecuteReader(); while (reader.Read()) { QC QU = new QC(); QU.id = reader.GetInt32(0); QU.paid = reader.GetInt32(1); QU.pid = reader.GetInt32(2); QU.qu = reader.GetString(3); QU.isy = reader.GetInt32(4); QU.isn = reader.GetInt32(5); QU.yn = reader.GetString(6); allQU.Add(QU); } reader.Close(); con.Close(); List <int> sPaId = new List <int>(); command = "SELECT Parent_ID FROM [Solutions]"; com = new SqlCommand(command, con); con.Open(); reader = com.ExecuteReader(); while (reader.Read()) { sPaId.Add(reader.GetInt32(0)); } reader.Close(); con.Close(); int nextQuestionID = -1; foreach (QC temp in allQU) { bool haveNext = false; for (int i = 0; i < allQU.Count; i++) { if (temp.id == allQU[i].paid) { haveNext = true; break; } } if (!haveNext) { foreach (int t in sPaId) { if (temp.id == t) { haveNext = true; break; } } if (!haveNext) { nextQuestionID = temp.id; } } } int nextQuestionParentID = -1; foreach (QC temp in allQU) { if (temp.id == nextQuestionID) { nextQuestionParentID = temp.paid; break; } } List <QC> retVal = new List <QC>(); foreach (QC temp in allQU) { if (temp.paid == nextQuestionParentID) { retVal.Add(temp); } } return(retVal); }