public async Task <IActionResult> Edit(int id, [Bind("Id,Date,type,amount,BeneficiarID")] Aid aid) { if (id != aid.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(aid); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AidExists(aid.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["BeneficiarID"] = new SelectList(_context.Beneficiars, "Id", "FullName", aid.BeneficiarID); return(View(aid)); }
private static void ClearAidState(Aid aidTogglingOn) { if (aidTogglingOn == Aid.LeftAid1) { //b4 = true; //outA3.Write(true); } if (aidTogglingOn == Aid.LeftAid2) { //b5 = true; //outA4.Write(true); } if (aidTogglingOn == Aid.RightAid1) { //b6 = true; //outA5.Write(true); } if (aidTogglingOn == Aid.RightAid2) { //b7 = true; //outD0.Write(true); } }
public static byte[] UploadSalt(this IOMSConnection conn) { byte[] data = null; Rid rid = new Rid(37U); Aid aid = new Aid(2449U); Value obj = null; int requestID = -1; Error error = conn.ClientSession.GetVariableRemote(rid, aid, ref obj, ref requestID); if (error.Failed) { return(null); } using (obj) { Blob blob = null; error = obj.GetValue(ref blob); if (error.Succeeded) { if (blob != null) { error = blob.GetData(ref data); blob.Dispose(); } } } if (!error.Failed) { return(data); } return(null); }
public static void TestStop(this ClientSession clientSession) { Rid rid = new Rid(52U); Value obj = new Value(1); Aid aid = new Aid(2167U); int requestID = 0; Error error = clientSession.SetVariableRemote(rid, aid, obj, 1, ref requestID); }
public ActiveBuff(ActiveTick tick, Aid aid) { stats = new Stats(); percentStats = new Stats(); attributes = new Attributes(); activeTick = tick; base.aid = aid; }
public void ApplyHealing(Stats playerStats, Aid healingToApply) { health += healingToApply[VitalsEnum.health]; stamina += healingToApply[VitalsEnum.stamina]; mana += healingToApply[VitalsEnum.mana]; Clamp(playerStats); }
private void statsbtn_Click(object sender, EventArgs e) { DataRowView rv = this.problemsBS.Current as DataRowView; GADataSet.ProblemsRow p = rv.Row as GADataSet.ProblemsRow; Aid.DoStatistics <GADataSet.ProblemsRow>(p); Application.DoEvents(); taControl1.UpdateAll(sender, e); }
static Aid _Multiply(float multiplier, Aid aid) { Aid result = new Aid(); foreach (VitalsEnum ae in System.Enum.GetValues(typeof(VitalsEnum))) { result[ae] = multiplier * aid[ae]; } return(result); }
public async Task <IActionResult> Create([Bind("Date,type,amount,BeneficiarID")] Aid aid) { if (ModelState.IsValid) { _context.Add(aid); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BeneficiarID"] = new SelectList(_context.Beneficiars, "Id", "FullName", aid.BeneficiarID); return(View(aid)); }
public override void update() { Pow.update(); Skl.update(); Spd.update(); Lck.update(); Def.update(); Res.update(); Mov.update(); Con.update(); Aid.update(); }
public string InvokeRequest(string postStr) { Model.Rsp34 rsp = new Model.Rsp34(); try { Helper.LogWrite("SI34 Request:" + postStr); this.req = Helper.Deserialize <Model.Req34>(postStr); if (req.data.leasenum != "") { DataTable dt = this.GetPendingPay(req.data.leasenum); if (dt.Rows.Count > 0) { Aid.AttachRowId(dt); rsp.data.result = "100"; rsp.data.message = "获取成功!"; rsp.data.customername = Helper.DbNull2Str(dt.Rows[0]["customername"]); rsp.data.payinfonum = Helper.DbNull2Int(dt.Rows.Count); rsp.data.premisename = Helper.DbNull2Str(dt.Rows[0]["premisename"]); rsp.data.shoparea = Helper.DbNull2Str(dt.Rows[0]["shoparea"]); rsp.data.shopname = Helper.DbNull2Str(dt.Rows[0]["shopname"]); rsp.data.totalamount = Helper.DbNull2Dec(dt.Compute("sum(outstanding)", "")); rsp.data.payinfo = Aid.DT2List <Model.Rsp34dataDtl>(dt) as List <Model.Rsp34dataDtl>; } else { rsp.data.result = "200"; rsp.data.message = "没有找到数据"; } } else { rsp.code = "100"; rsp.status = "true"; rsp.msg = "请求成功!"; rsp.time = Helper.Today; rsp.data.result = "200"; rsp.data.message = "租约号为空,无法查询"; } } catch (Exception err) { rsp.code = "200"; rsp.status = "false"; rsp.msg = "系统错误:" + err.Message; rsp.time = Helper.Today; } rsp.raw = Common.Helper.JsonSerialize(rsp); return(Common.Helper.JsonSerialize(rsp)); }
public Aid CalculateHealing() { Aid healing = new Aid(); ApplyBuff_TickAid(ref healing, characterBuffs); ApplyBuff_TickAid(ref healing, gearBuffs); ApplyBuff_TickAid(ref healing, activeBuffs); ApplyBuff_InstantAid(ref healing); ApplyBuff_TickAid(ref healing, toggleBuffs); return(healing); }
void ApplyBuff_InstantAid(ref Aid healing) { for (int i = instantBuffs.Count - 1; i >= 0; i--) { InstantBuff ib = instantBuffs[i]; foreach (VitalsEnum ae in System.Enum.GetValues(typeof(VitalsEnum))) { healing[ae] += ib.AidValue(ae); } instantBuffs.RemoveAt(i); } }
public static uint GetProtectionLevelOnline(this ClientSession session) { uint m_OnlineProtectionLevel = 0; Rid rid = new Rid(50U); Aid aid = new Aid(3451U); Value obj = new Value(); int requestID = -1; if (session.GetVariableRemote(rid, aid, ref obj, ref requestID).Succeeded) { obj.GetValue(ref m_OnlineProtectionLevel); } return(m_OnlineProtectionLevel); }
public override void draw(SpriteBatch sprite_batch, Vector2 draw_offset = default(Vector2)) { Vector2 loc = this.loc + draw_vector(); sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, Scissor_State); Pow.draw(sprite_batch, draw_offset - loc); Skl.draw(sprite_batch, draw_offset - loc); Spd.draw(sprite_batch, draw_offset - loc); Lck.draw(sprite_batch, draw_offset - loc); Def.draw(sprite_batch, draw_offset - loc); Res.draw(sprite_batch, draw_offset - loc); Mov.draw(sprite_batch, draw_offset - loc); Con.draw(sprite_batch, draw_offset - loc); Aid.draw(sprite_batch, draw_offset - loc); sprite_batch.End(); }
public string InvokeRequest(string postStr) { Model.Rsp33 rsp = new Model.Rsp33(); try { Helper.LogWrite("SI33 Request:" + postStr); this.req = Helper.Deserialize <Model.Req33>(postStr); Model.M_Sys_Login_Account ety = Aid.GetLoginAcc(this.req.data.userid); if (ety.LoginName != "") { if (ety.Password == this.req.data.oldpsw) { ety.Password = this.req.data.newpsw; int cnt = this.UpdateLoginAcc(ety); if (cnt > 0) { rsp.data.result = "100"; rsp.data.message = "成功"; } else { rsp.data.result = "200"; rsp.data.message = "失败"; } } else { rsp.data.result = "200"; rsp.data.message = "旧密码不匹配"; } } else { rsp.data.result = "100"; rsp.data.message = "用户不存在"; } } catch (Exception err) { rsp.code = "100"; rsp.msg = "系统错误:" + err.Message; } rsp.raw = Common.Helper.JsonSerialize(rsp); return(Common.Helper.JsonSerialize(rsp)); }
public TodaysAidData(Aid aidEntity, string fileName) { AidId = aidEntity.Id; SendingNationId = aidEntity.SendingNationId; SendingAllianceId = aidEntity.SendingAllianceId; SendingTeam = (int)aidEntity.SendingTeam; ReceivingNationId = aidEntity.ReceivingNationId; ReceivingAllianceId = aidEntity.ReceivingAllianceId; ReceivingTeam = (int)aidEntity.ReceivingTeam; Status = (int)aidEntity.Status; Money = aidEntity.Money; Technology = aidEntity.Technology; Soldiers = aidEntity.Soldiers; Date = aidEntity.Date; Reason = aidEntity.Reason; FileName = fileName; }
void ApplyBuff_TickAid <T>(ref Aid healing, List <T> aidList) where T : IAidTick { for (int i = aidList.Count - 1; i >= 0; i--) { IAidTick idt = aidList[i]; Aid aid = idt.AidTick(); if (aid != null) { foreach (VitalsEnum ae in System.Enum.GetValues(typeof(VitalsEnum))) { healing[ae] += aid[ae]; } } else { aidList.RemoveAt(i); } } }
public static string Image_Tag(Image_TagRequest request) { var uri = "https://api.ai.qq.com/fcgi-bin/image/image_tag"; return(Aid.Request(request, uri)); }
public static string Image_Food(Image_FoodRequest request) { var uri = "https://api.ai.qq.com/fcgi-bin/image/image_food"; return(Aid.Request(request, uri)); }
public static string Aai_Asrs(Aai_AsrsRequest request) { var uri = "https://api.ai.qq.com/fcgi-bin/aai/aai_asrs"; return(Aid.Request(request, uri)); }
public static string Aai_EvilAudio(Aai_EvilAudioRequest request) { var uri = "https://api.ai.qq.com/fcgi-bin/aai/aai_evilaudio"; return(Aid.Request(request, uri, "GET")); }
/// <summary> /// Get Aid from Garp and build Aid definition with all parts /// </summary> /// <param name="ordernr">order number</param> /// <returns>Array of New Aid Definitions</returns> private Aid[] getAids(string ordernr, string aidid) { HelpClasses.Table oProdStat = new HelpClasses.Table("1R"); Aid[] aup = new Aid[1]; ArrayList sAidList = new ArrayList(); ArrayList parts = new ArrayList(); Ortoped.GarpFunctions.OrderRowFunc orf = new Ortoped.GarpFunctions.OrderRowFunc(); OrderRowDefinitions.OrderRow[] or; or = orf.getAid(ordernr, aidid, false).OrderRows.ToArray(); if (or.Length > 0) { //första orderrad till sista orderrad foreach (OrderRowDefinitions.OrderRow mor in or) { if (mor.ViewInList) // AID { // aup.externalaidid = mOGR.Fields.Item("ANR").Value; string externalaidid = mor.AidDate + mor.OrderNo.PadRight(6) + mor.AidNr + mor.Rad.PadLeft(3); aup[0].name = mor.ProductName; //garpaidid bör inte ligga i description, var skall det ligga? aup[0].description = externalaidid; if (mAGA.Find(mor.Artikel)) { //hämta aidtypeoid! aup[0].aidtypeoidSpecified = true; aup[0].aidtypeoid = mAGA_SES.Value == null ? 0 : Int32.Parse(mAGA_SES.Value); aup[0].aidoid = mor.AidOid; aup[0].CreatedInThord = mor.CreatedInThord; aup[0].orderno = mor.OrderNo; aup[0].row = mor.Rad; aup[0].isonumber = mAGA_STA.Value == null ? "" : mAGA_STA.Value; aup[0].externalaidid = externalaidid; aup[0].ProdStat = oProdStat.getIdByTX1(mor.Prodstatus); aup[0].needstepSpecified = true; aup[0].FirstTimePatient = mor.FirstTimePatient; if (!mor.Thord_NeedStep.Equals("")) aup[0].needstep = int.Parse(mor.Thord_NeedStep); else MessageBox.Show("Behovstrappa är inte angiven på detta hjälpmedel", "Behovstrappa"); } } Part p = new Part(); p.CreatedInThord = mor.CreatedInThord; p.orderno = mor.OrderNo; p.row = mor.Rad; p.partoid = mor.PartOid; p.countSpecified = true; p.count = Convert.ToDecimal(mor.Antal.Replace(".", ",")); if (mAGT.Find(mor.Artikel)) { p.positionid = mor.Artikel; //mAGT_TX15.Value == null ? "" : mAGT_TX15.Value; if (mAGA.Find(mor.Artikel)) { if (ECS.noNULL(mAGA_KD6.Value).Equals("N")) // If KD6 = "N" then the part have no price in Garp { p.priceSpecified = true; p.price = Convert.ToDecimal(mor.APris.Replace(".", ",")); } else { p.priceSpecified = false; p.price = 0; } } parts.Add(p); } } } else { MessageBox.Show(null, "Order: " + ordernr + " saknas", "Finns ej", MessageBoxButtons.OK, MessageBoxIcon.Information); } aup[0].parts = (Part[])parts.ToArray(typeof(Part)); return aup; }
public static string Aai_DetectKeyWord(Aai_DetectKeyWordRequest request) { var uri = "https://api.ai.qq.com/fcgi-bin/aai/aai_detectkeyword"; return(Aid.Request(request, uri)); }
public void Action() { var CV = UpCall.TD.Villages[VillageID]; int GID; var Q = this; string mat_str, id, c; Match m; string result; switch (ResearchType) { case TResearchType.Research: if (!CV.Upgrades[Aid].CanResearch) { MarkDeleted = true; UpCall.Dirty = true; UpCall.CallStatusUpdate(this, new Travian.StatusChanged() { ChangedData = Travian.ChangedType.Queue, VillageID = VillageID }); return; } GID = 22; result = UpCall.PageQuery(VillageID, "build.php?gid=" + GID.ToString()); if (result == null) { return; } mat_str = "'build.php\\?id=(\\d+)&a=" + Aid.ToString() + "&c=([^']*?)'"; m = Regex.Match(result, mat_str); if (!m.Success) { return; } id = m.Groups[1].Value; c = m.Groups[2].Value; result = UpCall.PageQuery(VillageID, "build.php?id=" + id + "&a=" + Aid.ToString() + "&c=" + c); break; case TResearchType.UpTroopLevel: if (TargetLevel != 0 && CV.Upgrades[Aid].troop_lvl >= TargetLevel || CV.Upgrades[Aid].troop_lvl >= CV.SmithyLevel) { MarkDeleted = true; UpCall.Dirty = true; UpCall.CallStatusUpdate(this, new Travian.StatusChanged() { ChangedData = Travian.ChangedType.Queue, VillageID = VillageID }); return; } GID = 13; result = UpCall.PageQuery(VillageID, "build.php?gid=" + GID.ToString()); if (result == null) { return; } mat_str = "'build.php\\?id=(\\d+)&a=" + Aid.ToString() + "&c=([^']*?)'"; m = Regex.Match(result, mat_str, RegexOptions.Singleline); if (!m.Success) { return; } id = m.Groups[1].Value; c = m.Groups[2].Value; result = UpCall.PageQuery(VillageID, "build.php?id=" + id + "&a=" + Aid.ToString() + "&c=" + c); break; default: return; } UpCall.BuildCount(); if (TargetLevel == 0 || ResearchType == TResearchType.Research) { MarkDeleted = true; UpCall.Dirty = true; UpCall.CallStatusUpdate(this, new Travian.StatusChanged() { ChangedData = Travian.ChangedType.Queue, VillageID = VillageID }); } else if (ResearchType == TResearchType.UpTroopLevel) { if (CV.Upgrades[Aid].troop_lvl >= TargetLevel || CV.Upgrades[Aid].troop_lvl >= CV.SmithyLevel) { MarkDeleted = true; UpCall.Dirty = true; UpCall.CallStatusUpdate(this, new Travian.StatusChanged() { ChangedData = Travian.ChangedType.Queue, VillageID = VillageID }); } } UpCall.CallStatusUpdate(this, new Travian.StatusChanged() { ChangedData = Travian.ChangedType.Research, VillageID = VillageID }); }
void ApplyEffectHealing() { Aid aggregatedAid = effects.CalculateHealing(); vitals.ApplyHealing(effectiveStats, aggregatedAid); }
private WireMessage Read(IStreamReader reader) { var dataTypeCd = reader.ReadByte() - NotNullFlag; if (dataTypeCd > 0) { var message = new WireMessage(); var buffer = StringBytesCache.Acquire(); try { var sizeOfDataTypeCd = WireMessageFieldSizeOf.DataTypeCd; reader.Read(buffer, 0, WireMessageSizeOf.ConstantFields - sizeOfDataTypeCd); message.MessageType = (MessageType)buffer[WireMessageBufferOffsetOf.MessageType - sizeOfDataTypeCd]; message.State = (WireMessageState)buffer[WireMessageBufferOffsetOf.State - sizeOfDataTypeCd]; var timeoutMSec = buffer.ToInt(WireMessageBufferOffsetOf.TimeoutMSec - sizeOfDataTypeCd); message.TimeoutMSec = timeoutMSec != int.MinValue ? timeoutMSec : (int?)null; message.Id = new WireMessageId( buffer.ToInt(WireMessageBufferOffsetOf.IdMajor - sizeOfDataTypeCd), buffer.ToInt(WireMessageBufferOffsetOf.IdMajorRevision - sizeOfDataTypeCd), buffer.ToInt(WireMessageBufferOffsetOf.IdMinor - sizeOfDataTypeCd), buffer.ToInt(WireMessageBufferOffsetOf.IdMinorRevision - sizeOfDataTypeCd), buffer.ToInt(WireMessageBufferOffsetOf.IdProcessId - sizeOfDataTypeCd) ); } finally { StringBytesCache.Release(buffer); } message.From = Aid.Parse(ReadString(reader)); message.To = Aid.Parse(ReadString(reader)); var isNullByte = reader.ReadByte(); if (isNullByte != NullFlag) { var header = new Dictionary <string, string>(); message.Header = header; var count = reader.ReadInt32(); if (count > 0) { string key; for (var i = 0; i < count; i++) { key = ReadString(reader); if (key != null) { header[key] = ReadString(reader); } } } } isNullByte = reader.ReadByte(); if (isNullByte != NullFlag) { var len = reader.ReadInt32(); if (len > 0) { using (var tempStream = new ChunkedStream()) { var chunkSize = tempStream.ChunkSize; while (len > 0) { var bytes = reader.ReadBytes(chunkSize); var readLen = bytes?.Length ?? 0; if (readLen == 0) { throw new Exception(SerializationErrors.StreamNotContainingValidWireMessage); } len -= readLen; tempStream.Write(bytes, 0, readLen); } tempStream.Position = 0; message.Exception = GetSerializer().Deserialize <Exception>(tempStream); } } } ReadData(dataTypeCd, message, reader); return(message); } return(null); }
public static string Image_Terrorism(Image_TerrorismRequest request) { var uri = "https://api.ai.qq.com/fcgi-bin/image/image_terrorism"; return(Aid.Request(request, uri)); }
public static string Aai_Tts(Aai_TtsRequest request) { var uri = "https://api.ai.qq.com/fcgi-bin/aai/aai_tts"; return(Aid.Request(request, uri, "GET")); }
public static string Aai_WxAsrLong(Aai_WxAsrLongRequest request) { var uri = "https://api.ai.qq.com/fcgi-bin/aai/aai_wxasrlong"; return(Aid.Request(request, uri)); }
public static string Ocr_PlateOcr(Ocr_PlateOcrRequest request) { var uri = "https://api.ai.qq.com/fcgi-bin/ocr/ocr_plateocr"; return(Aid.Request(request, uri)); }