protected void btnSave_Click(object sender, EventArgs e) { if (stiforcrew != null) { CY.CSTS.Core.Business.Check check = new Check(); check.ApplicationID = stiforcrew.Id; check.AuditDes = tbDes.Value; check.AuditTime = System.DateTime.Now; // check.AuditPerson = u.Id; if (stiforcrew.State == 5) { check.AuditType = 2; stiforcrew.State = 7; } if (stiforcrew.State == 4 || stiforcrew.State == 6) { stiforcrew.State = 17; check.AuditType = 2; } check.Save(); stiforcrew.Save(); BindPage(); } }
public void AddCheck(Int32 checkNumber, Decimal amount) { Check checkToAdd = new Check { CheckNumber = checkNumber, Amount = amount }; _healthEntities.Checks.AddObject(checkToAdd); _healthEntities.SaveChanges(); }
public static bool ButtonRelease(Physics P, Check C) { if (C.time < 4) { C.time++; return false; } if ((P.w.GetMeta(C.x, C.y, C.z) & 0x8) != 0) P.AddUpdate(C.x, C.y, C.z, (byte)Blocks.ButtonStone, (byte)(P.w.GetMeta(C.x, C.y, C.z) ^ 0x8)); return true; }
public RegularFrequency(Check check, object[] input) { Check = check; Input = input; var minutes = (int)input[0]; SetUpTimer(minutes); }
static void Main() { Check c = new Check(); MyValues defValue = c.Value; // get default value Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
public RegularFrequency(Check check, XmlNode frequencyNode) { Check = check; var value = frequencyNode.ChildNodes.Cast<XmlNode>().First(childNode => String.Equals(childNode.Name, "Frequency", StringComparison.InvariantCultureIgnoreCase)).FirstChild.Value; var minutes = int.Parse(value); SetUpTimer(minutes); }
static Piece getWinner(Piece[,] board, int fixedIndex, Check check) { Piece color = getIthColor(board, fixedIndex, 0, check); if (color == Piece.Empty) return color; for (int var = 1; var < board.GetLength(0); var++) if (color != getIthColor(board, fixedIndex, var, check)) return Piece.Empty; return color; }
static Piece getIthColor(Piece[,] board, int index, int var, Check check) { if (check == Check.Row) return board[index, var]; else if (check == Check.Col) return board[var, index]; else if (check == Check.Diag) return board[var, var]; else if (check == Check.RevDiag) return board[board.GetLength(0) - 1 - var, var]; else return Piece.Empty; }
/// <summary> /// Starts checking for server crashes /// </summary> public void Start() { if(running) return; running = true; checkers = new List<Check>(); foreach(KeyValuePair<int, IPEndPoint> entry in servers) { Check cc = new Check(entry.Value, interval, entry.Key); cc.Crash += CrashDetected; cc.Reboot += RebootDetected; checkers.Add(cc); Thread t = new Thread(cc.Start); t.Start(); } }
public void ReportError(Check check) { var tab = check.GetTab(); var location = check.GetLocation(); MarkCheckErrored(check); if (!AllChecksInError(tab, location)) return; var message = String.Format("ALERT - A SERVER MAY BE DOWN - All checks are errored for: {{ tab: '{0}', location: '{1}' }}.", tab, location); Log.Warning(message); _emailService.SendErrorEmail(_target, message, tab); ClearErrors(tab, location); }
public ActionResult Index(string name, string phone, string selDate, int selTime) { DateTime selectedDate = Convert.ToDateTime(selDate); Check check = new Check(); check.datee = selectedDate; check.name = name; check.phone = phone; check.timee = selTime; if (db.Checks.Where(s=>s.datee==check.datee&&s.timee==check.timee).FirstOrDefault()==null) { db.Checks.Add(check); db.SaveChanges(); return PartialView("Sucess",name); } return RedirectToAction("Index","Check"); }
internal string getAccCheque(Check c,String status) { if(status.Equals("صادر شده")) { AccAccount acc = (from a in db.AccAccounts where a.ID.ToString().StartsWith("302001") & a.Name.ToString().Contains(c.bank) select a).First(); return acc.ID.ToString(); } else { AccAccount acc = (from a in db.AccAccounts where a.ID.ToString().StartsWith("103001") & a.Name.ToString().Contains(c.bank) select a).First(); return acc.ID.ToString(); } }
public List<TaxItem> AddPartyTaxItems(Check Check) { foreach (var Id in Check.items.Select(x => x.PartyId).Distinct()) { double itemTotal = 0; TaxItem taxItem = new TaxItem(); foreach (var row in Check.items.Where(y => y.PartyId == Id)) { itemTotal += row.Price; } taxItem.PartyId = Id; taxItem.DinerId = 0; taxItem.ItemTotal = itemTotal; taxItem.TaxAmount = Math.Round((itemTotal * Check.CheckTaxPercentage), 2); taxItem.TaxPercent = Check.CheckTaxPercentage; taxItem.Diviser = 1; partyTaxItems.Add(taxItem); } return partyTaxItems; }
public SemiRegularFrequency(Check check, XmlNode input) { Check = check; var activationTimes = new List<DateTime>(); foreach (var childNode in input.FirstChild.ChildNodes.OfType<XmlNode>().Where(childNode => childNode.Name.ToUpper() == "TIME")) { var myTime = new DateTime(); foreach (XmlNode timeDetails in childNode.ChildNodes) { switch (timeDetails.Name.ToUpper()) { case "DAY": var myDay = (DayOfWeek)Enum.Parse(typeof(DayOfWeek), timeDetails.FirstChild.Value.ToUpper()); while (myTime.DayOfWeek != myDay) { myTime = myTime.AddDays(1.0); } break; case "HOUR": myTime = myTime.AddHours(double.Parse(timeDetails.FirstChild.Value)); break; } } myTime = myTime.AddYears(DateTime.Now.Year - 1); activationTimes.Add(myTime); } _activationTimes = activationTimes.ToArray(); var leastTimeToGo = GetLeastTimeToGo(_activationTimes); SetUpTimer(leastTimeToGo); }
public void PrepareList(Check[] checks) { lock (_syncLock) _checks = checks; }
/// <summary> /// Gets the check information. /// </summary> /// <param name="paymentInfo">The payment information.</param> /// <returns></returns> private Check GetCheck( ACHPaymentInfo ach ) { var check = new Check(); check.accountNumber = ach.BankAccountNumber.AsNumeric(); check.accountType = ach.AccountType == BankAccountType.Checking ? "C" : "S"; check.bankTransitNumber = ach.BankRoutingNumber.AsNumeric(); check.secCode = "WEB"; return check; }
protected void btnSave_Click(object sender, EventArgs e) { CY.CSTS.Core.Business.Check check = new Check(); check.ApplicationID = stiforcrew.Id; check.AuditDes = tbDes.Value; check.AuditTime = System.DateTime.Now; // check.AuditPerson = u.Id; if (stiforcrew.State == 9) { check.AuditType = 3; stiforcrew.State = 11; check.Save(); stiforcrew.Save(); } else if (stiforcrew.State == 8 || stiforcrew.State == 10) { stiforcrew.State = 17; check.AuditType = 3; check.Save(); stiforcrew.Save(); } if (stiforcrew.State == 15) { check.AuditType = 4; stiforcrew.State = 16; check.Save(); stiforcrew.Save(); } bindCtr(); }
/// <summary> /// turn the loaded category and subcategory nodes into useable data /// </summary> private void processFilterDefinitions() { ConfigNode[] nodes = GameDatabase.Instance.GetConfigNodes("CATEGORY"); for (int i = 0; i < nodes.Length; i++) { ConfigNode node = nodes[i]; customCategory C = new customCategory(node); if (C.subCategories == null) continue; if (!Categories.Any(n => n.categoryName == C.categoryName)) Categories.Add(C); } //load all subCategory configs nodes = GameDatabase.Instance.GetConfigNodes("SUBCATEGORY"); for (int i = 0; i < nodes.Length; i++) { ConfigNode node = nodes[i]; customSubCategory sC = new customSubCategory(node); if (!sC.hasFilters || string.IsNullOrEmpty(sC.subCategoryTitle)) continue; customSubCategory subcategory; if (subCategoriesDict.TryGetValue(sC.subCategoryTitle, out subcategory)) // if something does have the same title subcategory.filters.AddRange(sC.filters); else // if nothing else has the same title subCategoriesDict.Add(sC.subCategoryTitle, sC); } customCategory Cat = Categories.Find(C => C.categoryName == "Filter by Resource"); if (Cat != null) { for (int i = 0; i < resources.Count; i++) { string s = resources[i]; // add spaces before each capital letter string name = System.Text.RegularExpressions.Regex.Replace(s, @"\B([A-Z])", " $1"); customSubCategory subcategory; if (subCategoriesDict.TryGetValue(name, out subcategory)) { // if the collision is already looking for the specified resource if (customSubCategory.checkForCheckMatch(subcategory, CheckType.resource, s)) continue; name = "res_" + name; } if (!string.IsNullOrEmpty(name) && !subCategoriesDict.ContainsKey(name)) { customSubCategory sC = new customSubCategory(name, name); Check c = new Check("resource", s); Filter f = new Filter(false); f.checks.Add(c); sC.filters.Add(f); subCategoriesDict.Add(name, sC); } if (!string.IsNullOrEmpty(name)) Cat.subCategories.AddUnique(new subCategoryItem(name)); } } for (int i = 0; i < Categories.Count; i++) { customCategory C = Categories[i]; if (C == null || !C.all) continue; List<Filter> filterList = new List<Filter>(); if (C.subCategories != null) { for (int j = 0; j < C.subCategories.Count; j++) { subCategoryItem s = C.subCategories[j]; if (s == null) continue; customSubCategory subcategory; if (subCategoriesDict.TryGetValue(s.subcategoryName, out subcategory)) filterList.AddUniqueRange(subcategory.filters); } } customSubCategory newSub = new customSubCategory("All parts in " + C.categoryName, C.iconName); newSub.filters = filterList; subCategoriesDict.Add(newSub.subCategoryTitle, newSub); C.subCategories.Insert(0, new subCategoryItem(newSub.subCategoryTitle)); } }
protected Check Create(Type objectType, JObject jsonObject) { var key = jsonObject.Children().First(); var check = new Check { Name = key.Path }; return check; }
public static bool LavaFlow(Physics P, Check C) { if (C.time < 6) { C.time++; return false; } byte meta = P.w.GetMeta(C.x, C.y, C.z); if (!P.HigherLiquidCheck(C.x, C.y, C.z, 10, meta) && !P.HigherLiquidCheck(C.x, C.y, C.z, 11, meta)) { if ((meta & 0x7) >= 0x6) P.AddUpdate(C.x, C.y, C.z, 0, 0); else { P.AddUpdate(C.x, C.y, C.z, 10, (byte)Math.Min(meta + 2, 0x6)); if (!P.AdjacentLiquidCheck(C.x, C.y, C.z, 10) && !P.AdjacentLiquidCheck(C.x, C.y, C.z, 11)) { C.time = 0; return false; } } } else if ((meta & 0x8) != 0) { if (!P.LavaFlowCheck(C.x, C.y - 1, C.z)) { meta = 0; goto flowOut; } P.LavaFlow(C.x, C.y - 1, C.z, 0x8); } else if ((meta & 0x7) < 0x6) { goto flowOut; } else { P.LavaFlow(C.x, C.y - 1, C.z, 0x8); } return true; flowOut: if (P.LavaFlowCheck(C.x, C.y - 1, C.z)) { P.LavaFlow(C.x, C.y - 1, C.z, 0x8); if (!P.AdjacentLiquidCheck(C.x, C.y, C.z, 10) && !P.AdjacentLiquidCheck(C.x, C.y, C.z, 11)) { P.LavaFlow(C.x + 1, C.y, C.z, 0x6); P.LavaFlow(C.x - 1, C.y, C.z, 0x6); P.LavaFlow(C.x, C.y, C.z + 1, 0x6); P.LavaFlow(C.x, C.y, C.z - 1, 0x6); } } else { if (P.AdjacentLiquidCheck(C.x, C.y, C.z, 8) || P.AdjacentLiquidCheck(C.x, C.y, C.z, 9)) { if ((meta & 0x7) == 0) P.AddUpdate(C.x, C.y, C.z, 49, 0); else P.AddUpdate(C.x, C.y, C.z, 4, 0); Player.GlobalSoundEffect(C.x, (byte)C.y, C.z, 1004, P.w); //Player.GlobalSoundEffect(C.x, (byte)C.y, C.z, 2000, 4, w); } else { meta += 2; P.LavaFlow(C.x + 1, C.y, C.z, meta); P.LavaFlow(C.x - 1, C.y, C.z, meta); P.LavaFlow(C.x, C.y, C.z + 1, meta); P.LavaFlow(C.x, C.y, C.z - 1, meta); if (P.w.GetBlock(C.x, C.y - 1, C.z) == 8 || P.w.GetBlock(C.x, C.y - 1, C.z) == 9) { P.AddUpdate(C.x, C.y - 1, C.z, 4, 0); Player.GlobalSoundEffect(C.x, (byte)C.y, C.z, 1004, P.w); } } } return true; }
public static bool SpongeSoak(Physics P, Check C) { P.SpongePlaced(C.x, C.y, C.z); return true; }
internal void insertOnSubmit(Check ac) { db.Checks.InsertOnSubmit(ac); }
//Check Button: create Move check and set it for the player private void buttonCheck_Click(object sender, EventArgs e) { Move moveChoice = new Check(); Player activePlayer = game.getCurrentRound().getActivePlayer(); if(activePlayer != null) { activePlayer.setMoveChoice(moveChoice); } else { throw new Exception("activePlayer was null while attempting to check in GameForm."); } }
public void ReportSuccess(Check check) { lock (_syncLock) _errorCounts[check] = 0; }
/// <summary> /// 保存备注评语 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSave_Click(object sender, EventArgs e) { CY.CSTS.Core.Business.Check check = new Check(); check.ApplicationID = stiforsub_coop.Id; check.AuditDes = tbDes.Value; check.AuditTime = System.DateTime.Now; // check.AuditPerson = u.Id; if (stiforsub_coop.State == 5) { check.AuditType = 2; stiforsub_coop.State = 7; check.Save(); stiforsub_coop.Save(); } if (stiforsub_coop.State == 6 || stiforsub_coop.State == 4) { check.AuditType = 2; stiforsub_coop.State = 13; check.Save(); stiforsub_coop.Save(); } if (stiforsub_coop.State == 11) { check.AuditType = 4; stiforsub_coop.State = 14; check.Save(); stiforsub_coop.Save(); } bindCtr(); BindPage(); }
/// <summary> /// create the subcategories for filter by manufacturer by discovered GameData folder /// </summary> /// <param name="modNames"></param> private void processFilterByManufacturer(List<string> modNames) { // define the mod subcategories List<string> subCatNames = new List<string>(); for (int i = 0; i < modNames.Count; i++) { string name = modNames[i]; if (subCategoriesDict.ContainsKey(modNames[i])) name = "mod_" + name; string icon = name; SetNameAndIcon(ref name, ref icon); if (!subCategoriesDict.ContainsKey(name)) { subCatNames.Add(name); Check ch = new Check("folder", modNames[i]); Filter f = new Filter(false); customSubCategory sC = new customSubCategory(name, icon); f.checks.Add(ch); sC.filters.Add(f); subCategoriesDict.Add(name, sC); } } customCategory fbm = Categories.FirstOrDefault(C => C.categoryName == "Filter by Manufacturer"); if (fbm == null) { ConfigNode manufacturerSubs = new ConfigNode("SUBCATEGORIES"); for (int i = 0; i < subCatNames.Count; i++) manufacturerSubs.AddValue("list", i.ToString() + "," + subCatNames[i]); ConfigNode filterByManufacturer = new ConfigNode("CATEGORY"); filterByManufacturer.AddValue("name", "Filter by Manufacturer"); filterByManufacturer.AddValue("type", "stock"); filterByManufacturer.AddValue("value", "replace"); filterByManufacturer.AddNode(manufacturerSubs); Categories.Add(new customCategory(filterByManufacturer)); } else { for (int i = 0; i < modNames.Count; i++) fbm.subCategories.AddUnique(new subCategoryItem(modNames[i])); // append the mod names } }
public static bool WaterFlow(Physics P, Check C) { //if (C.time < 5) { C.time++; return false; } byte meta = P.w.GetMeta(C.x, C.y, C.z); if (!P.HigherLiquidCheck(C.x, C.y, C.z, 8, meta) && !P.HigherLiquidCheck(C.x, C.y, C.z, 9, meta)) { if ((meta & 0x7) >= 0x7) P.AddUpdate(C.x, C.y, C.z, 0, 0); else { P.AddUpdate(C.x, C.y, C.z, 8, (byte)Math.Min(meta + 2, 0x7)); if (!P.AdjacentLiquidCheck(C.x, C.y, C.z, 8) && !P.AdjacentLiquidCheck(C.x, C.y, C.z, 9)) { C.time = 0; return false; } } } else if ((meta & 0x8) != 0) { if (!P.WaterFlowCheck(C.x, C.y - 1, C.z)) { meta = 0; goto flowOut; } P.WaterFlow(C.x, C.y - 1, C.z, 0x8); } else if ((meta & 0x7) < 0x7) { goto flowOut; } else { P.WaterFlow(C.x, C.y - 1, C.z, 0x8); } return true; flowOut: if (P.WaterFlowCheck(C.x, C.y - 1, C.z)) { P.WaterFlow(C.x, C.y - 1, C.z, 0x8); if (!P.AdjacentLiquidCheck(C.x, C.y, C.z, 8) && !P.AdjacentLiquidCheck(C.x, C.y, C.z, 9)) { P.WaterFlow(C.x + 1, C.y, C.z, 0x7); P.WaterFlow(C.x - 1, C.y, C.z, 0x7); P.WaterFlow(C.x, C.y, C.z + 1, 0x7); P.WaterFlow(C.x, C.y, C.z - 1, 0x7); } } else { meta++; P.WaterFlow(C.x + 1, C.y, C.z, meta); P.WaterFlow(C.x - 1, C.y, C.z, meta); P.WaterFlow(C.x, C.y, C.z + 1, meta); P.WaterFlow(C.x, C.y, C.z - 1, meta); } return true; }
protected void btnSave_Click(object sender, EventArgs e) { CY.CSTS.Core.Business.Check check = new Check(); check.ApplicationID = appforcenter.Id; check.AuditDes = tbDes.Value; check.AuditTime = System.DateTime.Now; check.AuditType = 1; //check.AuditPerson = U.Id;评审人 check.Save(); appforcenter.State = 6; appforcenter.Save(); bindCtr(); }
/// <summary> /// Verifica e corregge dove possibile /// </summary> /// <returns></returns> public void Validate() { Check[] ops; // Array di delegate bValid = true; CalcolaDimCar(); if(bAmbiente) // Liste con i controlli se ambiente o corpo ottico finito ops = new Check[] {CheckRifrazione}; else ops = new Check[] {CheckRifrazione, CheckNumTratti, CheckValidi, CheckConnesso, CheckDimCar}; // Mancano controlli di: // punto interno // contorno che interseca se stesso foreach( Check op in ops) // Chiama la funzione { if(!op()) // Se errore... { bValid = false; // ...azzera il flag break; } } }
private static void CheckContentListItem2(string encodedPath, Check check) { var node = LoadNode(encodedPath); var content = Content.Create(node); var fields = content.Fields; Assert.IsNotNull(node.ContentListType, "ContentListItem ContentListType == null"); Assert.IsTrue(node.ContentListId > 0, "ContentListItem ContentListId == 0"); Assert.IsNotNull(content.Fields["#ContentList2Field1"], "This content should contain #ContentList2Field1 field."); Assert.IsNotNull(content.Fields["#ContentList2Field2"], "This content should contain #ContentList2Field2 field."); Assert.IsFalse(content.Fields.ContainsKey("#ContentList1Field1"), "This content shouldn't contain #ContentList1Field1 field."); Assert.IsFalse(content.Fields.ContainsKey("#ContentList1Field2"), "This content shouldn't contain #ContentList1Field2 field."); Assert.IsFalse(content.Fields.ContainsKey("#ContentList1Field3"), "This content shouldn't contain #ContentList1Field3 field."); if (fields["#ContentList2Field2"] != null) { var field = fields["#ContentList2Field2"]; switch (check) { case Check.Signature: break; case Check.FieldValuesKept: Assert.IsTrue(field.HasValue() && ((decimal)field.OriginalValue == testFieldValueForT2), "#ContentList2Field2 doesn't contain the proper value."); break; case Check.FieldValuesNotKept: //Assert.IsTrue(field.HasValue() == false, "#ContentList2Field2 shouldn't contain any value."); Assert.IsTrue((decimal)field.OriginalValue == 0, "#ContentList2Field2 shouldn't contain any value."); break; default: throw new ArgumentException("You have to assign a valid value to the check parameter!"); } } }