public object Clone() { MoneyItem clonedItem = new MoneyItem(null); clonedItem.Value = Value; clonedItem.Count = Count; return(clonedItem); }
private void genInfoPanel(GameDetailInfo ginfo) { if (ginfo == null) { return; } MoneyItem item = ginfo.m_item; InfoShcd info = (InfoShcd)ginfo.m_detailInfo; divHead.InnerText = item.m_genTime; // 玩家ID tdPlayer.InnerText = "玩家ID:" + item.m_playerId.ToString(); genCardInfo(divNormalResult, info); genBetTable(tableBet, info); }
public void DeleteAsync(MoneyItem moneyItem) { using (SqliteConnection db = new SqliteConnection("Filename=sqliteData.db")) { db.Open(); SqliteCommand deleteCommand = new SqliteCommand("DELETE FROM MoneyItemTable WHERE Id = @id AND ConsumeTime = @time AND Event = @event AND Amount = @amount AND CoverImage = @cover;", db); deleteCommand.Parameters.AddWithValue("@id", moneyItem.Id); deleteCommand.Parameters.AddWithValue("@time", moneyItem.ConsumeTime); deleteCommand.Parameters.AddWithValue("@event", moneyItem.Event); deleteCommand.Parameters.AddWithValue("@amount", moneyItem.Amount); deleteCommand.Parameters.AddWithValue("@cover", moneyItem.CoverImage); deleteCommand.ExecuteReader(); db.Close(); } }
private void genInfoPanel(GameDetailInfo ginfo) { if (ginfo == null) { return; } MoneyItem item = ginfo.m_item; InfoFishPark info = (InfoFishPark)ginfo.m_detailInfo; divHead.InnerText = item.m_genTime; // 玩家ID tdPlayerCrocodile.InnerText = "玩家ID:" + item.m_playerId.ToString(); tdAbandonedbullets.InnerText = "废弹:" + info.m_abandonedbullets.ToString(); genFishTable(tableFish, info); }
private void Add_Click(object sender, RoutedEventArgs e) { MoneyItem item = new MoneyItem(); if (ShowDate.Date.DateTime != null && ShowEvent.Text != null && ShowMoney.Text != null && (Regex.IsMatch(ShowMoney.Text, "^([0-9]{1,}[.][0-9]*)$") || Regex.IsMatch(ShowMoney.Text, "^([0-9]{1,})$"))) { item.ConsumeTime = ShowDate.Date.DateTime; item.Event = ShowEvent.Text; item.Amount = float.Parse(ShowMoney.Text); item.CoverImage = "Assets/image.jpg"; var viewModel = (MoneyPageViewModel)this.DataContext; viewModel.AddMoneyItem = item; viewModel.AddCommand.Execute(null); viewModel.RefreshCommand.Execute(null); MoneyListView.SelectedIndex = viewModel.MoneyItems.Count() - 1; } }
private void genInfoPanel(GameDetailInfo ginfo) { if (ginfo == null) { return; } MoneyItem item = ginfo.m_item; InfoCrocodile info = (InfoCrocodile)ginfo.m_detailInfo; divHead.InnerText = item.m_genTime; // 玩家ID tdPlayerCrocodile.InnerText = "玩家ID:" + item.m_playerId.ToString(); fillResultInfo(info); genBetTable(tableBet, info); }
public void AddAsync(MoneyItem moneyItem) { using (SqliteConnection db = new SqliteConnection("Filename=sqliteData.db")) { db.Open(); SqliteCommand insertCommand = new SqliteCommand(); insertCommand.Connection = db; insertCommand.CommandText = "INSERT INTO MoneyItemTable VALUES (NULL,@time,@event,@amount,@cover);"; insertCommand.Parameters.AddWithValue("@time", moneyItem.ConsumeTime); insertCommand.Parameters.AddWithValue("@event", moneyItem.Event); insertCommand.Parameters.AddWithValue("@amount", moneyItem.Amount); insertCommand.Parameters.AddWithValue("@cover", moneyItem.CoverImage); insertCommand.ExecuteReader(); db.Close(); } }
public void ChangeAsync(int id, MoneyItem moneyItem) { //throw new NotImplementedException(); //这里实现更新操作 using (SqliteConnection db = new SqliteConnection("Filename=sqliteData.db")) { db.Open(); SqliteCommand updateCommand = new SqliteCommand("UPDATE MoneyItemTable SET ConsumeTime = @time , Event = @event , Amount = @amount WHERE Id = @id;", db); updateCommand.Parameters.AddWithValue("@time", moneyItem.ConsumeTime); updateCommand.Parameters.AddWithValue("@event", moneyItem.Event); updateCommand.Parameters.AddWithValue("@amount", moneyItem.Amount); //updateCommand.Parameters.AddWithValue("@cover", moneyItem.CoverImage); updateCommand.Parameters.AddWithValue("@id", id); updateCommand.ExecuteReader(); db.Close(); } }
private void genInfoPanel(GameDetailInfo ginfo) { if (ginfo == null) { return; } MoneyItem item = ginfo.m_item; InfoDice info = (InfoDice)ginfo.m_detailInfo; divHead.InnerText = item.m_genTime; // 玩家ID tdPlayerCrocodile.InnerText = "玩家ID:" + item.m_playerId.ToString(); // 骰宝结果 tdDiceDesc.InnerText = DefCC.s_diceStr[info.getResult()]; addImg(tdDiceResult.Controls, info); genBetTable(tableBet, info); }
private void genInfoPanel(GameDetailInfo ginfo) { if (ginfo == null) { return; } MoneyItem item = ginfo.m_item; InfoDragon info = (InfoDragon)ginfo.m_detailInfo; divHead.InnerText = item.m_genTime; // 玩家ID tdPlayer.InnerText = "玩家ID:" + item.m_playerId.ToString(); tdIsFreeGame.InnerText = info.isFreeGame == 1 ? "是" : "否"; tdBetMoney.InnerText = ItemHelp.showMoneyValue(item.m_outlay).ToString(); genCardInfo(divResult1, info, 0); genCardInfo(divResult2, info, 1); genCardInfo(divResult3, info, 2); genBetTable(tableBet, info, item);; }
private void genInfoPanel(GameDetailInfo ginfo) { if (ginfo == null) { return; } MoneyItem item = ginfo.m_item; InfoCows info = (InfoCows)ginfo.m_detailInfo; divHead.InnerText = item.m_genTime; // 玩家ID tdPlayer.InnerText = "玩家ID:" + item.m_playerId.ToString(); // 玩家是否上庄 tdIsBanker.InnerText = info.isBanker() ? DefCC.s_isBanker[0] : DefCC.s_isBanker[1]; if (info.isBanker()) { tdServiceChargeRatio.InnerText = info.getServiceChargeRatio() + "%"; tdServiceCharge.InnerText = info.m_betInfo.costgold.ToString(); } else { trServiceCharge.Visible = false; } // 庄家牌型 genCardInfo(divBankerCard, tdBankerCardType, info.m_bankerCard); // 东牌型 genCardInfo(divEastCard, tdEastCardType, info.m_eastCard); // 南牌型 genCardInfo(divSouthCard, tdSouthCardType, info.m_southCard); // 西牌型 genCardInfo(divWestCard, tdWestCardType, info.m_westCard); // 北牌型 genCardInfo(divNorthCard, tdNorthCardType, info.m_northCard); // 押注信息 genBetInfo(info); }
private void Save_Click(object sender, RoutedEventArgs e) { if (MoneyListView.SelectedItem != null) { var viewModel = (MoneyPageViewModel)this.DataContext; var Item = MoneyListView.SelectedItem as MoneyItem; viewModel.Id = Item.Id; MoneyItem item = new MoneyItem(); item.Id = Item.Id; item.ConsumeTime = ShowDate.Date.DateTime; item.Event = ShowEvent.Text; if (ShowMoney.Text != null && (Regex.IsMatch(ShowMoney.Text, "^([0-9]{1,}[.][0-9]*)$") || Regex.IsMatch(ShowMoney.Text, "^([0-9]{1,})$"))) { item.Amount = float.Parse(ShowMoney.Text); } else { item.Amount = Item.Amount; } item.CoverImage = Item.CoverImage; viewModel.ChangeMoneyItem = item; viewModel.ChangeCommand.Execute(null); viewModel.RefreshCommand.Execute(null); int index = 0; foreach (MoneyItem moneyItem in viewModel.MoneyItems) { if (moneyItem.Id == Item.Id) { MoneyListView.SelectedIndex = index; break; } index++; } } }
private void genInfoPanel(GameDetailInfo ginfo) { if (ginfo == null) { return; } MoneyItem item = ginfo.m_item; InfoBaccarat info = (InfoBaccarat)ginfo.m_detailInfo; divHead.InnerText = item.m_genTime; // 玩家ID tdPlayer.InnerText = "玩家ID:" + item.m_playerId.ToString(); // 玩家是否上庄 tdIsBanker.InnerText = info.isBanker() ? DefCC.s_isBanker[0] : DefCC.s_isBanker[1]; if (info.isBanker()) { tdServiceChargeRatio.InnerText = info.m_serviceChargeRatio + "%"; tdServiceCharge.InnerText = info.m_serviceCharge.ToString(); tdTotalIncome.InnerText = (info.sumBet() - info.sumAward()).ToString(); } else { trServiceCharge.Visible = false; trTotalIncome.Visible = false; } // 庄家牌型 genCardInfo(divBankerCard, info.m_bankerCard); // 闲家牌型 genCardInfo(divPlayerCard, info.m_playerCard); // 押注信息 genBetInfo(info); }
// 下注表 protected void genBetTable(Table table, InfoDragon info, MoneyItem item) { GMUser user = (GMUser)Session["user"]; TableRow tr = new TableRow(); table.Rows.Add(tr); int i = 0; for (; i < s_head.Length; i++) { TableCell td = new TableCell(); tr.Cells.Add(td); td.Text = s_head[i]; } for (i = 0; i < StrName.s_dragonArea.Length; i++) { int c = 0; m_content[c++] = StrName.s_dragonArea[i]; m_content[c++] = info.getOdds(i).ToString(); m_content[c++] = ""; tr = new TableRow(); table.Rows.Add(tr); for (int j = 0; j < s_head.Length; j++) { TableCell td = new TableCell(); tr.Cells.Add(td); td.Text = m_content[j]; } } addStatFoot(table, item.m_income, info); }
public static GameDetailInfo parseGameInfo(GameId gameId, int index, GMUser user) { MoneyItem item = getMoneyItem(index, user); if (item == null) { return(null); } object info = null; switch (gameId) { case GameId.baccarat: { info = parseInfoBaccarat(item.m_param); } break; case GameId.cows: { info = parseInfoCows(item.m_param, user); } break; case GameId.crocodile: { info = parseInfoCrocodile(item.m_param); } break; case GameId.dice: { info = parseInfoDice(item.m_param); } break; case GameId.fishpark: { info = parseInfoFishPark(item.m_param); } break; case GameId.shcd: { info = parseInfoShcd(item.m_param); } break; case GameId.dragon: { info = parseInfoDragon(item.m_param); } break; } if (info == null) { return(null); } GameDetailInfo resInfo = new GameDetailInfo(); resInfo.m_item = item; resInfo.m_detailInfo = info; return(resInfo); }
public object Clone() { MoneyItem clonedItem = new MoneyItem(null); clonedItem.Value = Value; clonedItem.Count = Count; return clonedItem; }