public double Earning(double basic, double house, double Appraisal) { Earn = basic + house + 100 + 300 + 400 + 1800 + Appraisal; // Response.Write(Earn); LblEaring.Text = Earn.ToString(); return(Earn); }
protected void Page_Load(object sender, EventArgs e) { string search = Request.QueryString["search"]; DataSet d = new PaymentDAO().getEarn(search); if (d != null) { if (d.Tables[0].Rows.Count != 0) { Earn.DataSource = d; Earn.DataBind(); } else { Earn.DataSource = null; Earn.DataBind(); } } int a = 0; for (int i = 0; i < d.Tables[0].Rows.Count; i++) { a = a + Convert.ToInt32(d.Tables[0].Rows[i]["cost"]); } Total.Text = a.ToString(); }
public async Task <IActionResult> PutEarn(uint id, Earn earn) { // validate id value if (id == default) { return(BadRequest()); } // check the result if (id != earn.Id) { return(BadRequest()); } Context.Entry(earn).State = EntityState.Modified; try { await Context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { // check the problems if (!await Context.Earn.AnyAsync(e => e.Id == id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Earn> > PostEarn(Earn earn) { Context.Earn.Add(earn); await Context.SaveChangesAsync(); return(Ok(new { id = earn.Id })); }
/// <summary> /// Initializes a new instance of the <see cref="OverworldObjects.ResourceBuilding"/> class. /// </summary> /// <param name="shape">Shape.</param> /// <param name="owner">Owner.</param> /// <param name="spriteID">Sprite I.</param> /// <param name="spriteCategory">Sprite category.</param> /// <param name="resourceID">Resource I.</param> /// <param name="amountPerWeek">Amount per week.</param> /// <param name="minDistFromTown">Minimum dist from town.</param> /// <param name="maxDistFromTown">Max dist from town.</param> public ResourceBuilding(int shape, Player owner, int spriteID, IngameObjectLibrary.Category spriteCategory, Resources.type resourceID, Earn amountPerWeek, int minDistFromTown, int maxDistFromTown) : base(shape, owner, spriteID, spriteCategory) { MinDistFromTown = minDistFromTown; MaxDistFromTown = maxDistFromTown; ResourceID = resourceID; Earnings = amountPerWeek; }
public void Eat(Fish f) { this.Energy += 500; Earn.Invoke($"Вы скушали рыбку, прибавилось {f.Energy} энергии, всего осталось {this.Energy}", i++); if (this.Energy > maxEnergy) { Plenty.Invoke("Кошка заболела из-за избытка энергии"); } }
public void InitData(int result, Earn earn, int level, int exp, int levelUpExp) { m_result = result; m_earn = earn; if (m_result > 0) { titleText.text = "战斗胜利"; if (m_result == 1) { starText.text = "星级评价:1星 (多余1名武将死亡)"; } else if (m_result == 1) { starText.text = "星级评价:2星 (有1名武将死亡)"; } else if (m_result == 1) { starText.text = "星级评价:3星 (没有武将死亡)"; } } else { titleText.text = "战斗失败"; starText.text = "星级评价:无"; } goldText.text = "金币 " + m_earn.Gold; expText.text = "经验 " + m_earn.PlayerExp; levelText.text = "LV." + level; Debug.Log(exp + " " + levelUpExp); float percent = (float)exp / levelUpExp; levelFontImage.fillAmount = percent; levelPercentText.text = string.Format("{0:F0}", percent * 100) + "%"; for (int i = 0; i < m_earn.ItemIds.Count; i++) { foreach (Equip item in GameData.g_items) { if (item.Id + "" == m_earn.ItemIds[i]) { goods[i].nameText.text = item.Name; goods[i].numText.text = "1"; goods[i].gameObject.SetActive(true); } } } for (int i = m_earn.ItemIds.Count; i < goods.Length; i++) { goods[i].gameObject.SetActive(false); } }
/// <summary> /// If the group is requested /// </summary> /// <param name="query"></param> /// <param name="groupType"></param> /// <returns></returns> private async Task GroupingIfIsRequested(IQueryable <Earn> query, StringValues groupType) { if (groupType != StringValues.Empty && groupType != "none") { await ResolveGroup(query, groupType); } else { Earn = await query.ToListAsync(); Earn.ForEach(income => DataHelpers.Humanize(income)); } }
public async Task <IActionResult> OnGetAsync(uint?id) { if (id == null) { return(NotFound()); } Earn = await _context.Earn .Include(e => e.EarnCategory) .Include(e => e.User).FirstOrDefaultAsync(m => m.Id == id); if (Earn == null) { return(NotFound()); } return(Page()); }
public async Task <IActionResult> OnPostAsync(uint?id) { if (id == null) { return(NotFound()); } Earn = await _context.Earn.FindAsync(id); if (Earn != null) { _context.Earn.Remove(Earn); await _context.SaveChangesAsync(); } return(RedirectToPage("./Index")); }
public async Task <IActionResult> OnGetAsync(uint?id) { if (id == null) { return(NotFound()); } Earn = await _context.Earn .Include(e => e.EarnCategory) .Include(e => e.User).FirstOrDefaultAsync(m => m.Id == id); if (Earn == null) { return(NotFound()); } ViewData["EarnCategoryId"] = new SelectList( _context.EarnCategory .Where(x => x.UserId == HttpContext.User.GetUserId()), "Id", "Name"); return(Page()); }
/// <summary> /// Public constructor for resource building /// </summary> /// <param name="name">Name of the given building</param> /// <param name="description">Description of the current building</param> /// <param name="requirements">The building(s) that must be built before this one is available</param> /// <param name="cost">The Resource cost to make the given building</param> /// <param name="localID">The local spriteID of the given building</param> /// <param name="LOCAL_SPRITEID_BLUEPRINT">The local spriteID for the blueprint of the building</param> public ResourceBuilding(string name, string description, bool[] requirements, Cost cost, int localID, int LOCAL_SPRITEID_BLUEPRINT, Earn earnings) : base(name, description, requirements, cost, localID, LOCAL_SPRITEID_BLUEPRINT) { this.earnings = earnings; }
public void ShowResult(int result, Earn earn, int level, int exp, int levelUpExp) { resultItem.InitData(result, earn, level, exp, levelUpExp); resultItem.gameObject.SetActive(true); }
public Gold(int goldValue) : base(LOCAL_SPRITE_ID) { value = new Earn(goldValue, 0, 0, 0, 0); }
public ResourcePickup(Earn value, int localSpriteID) : base(localSpriteID, SPRITE_CATEGORY) { }