protected void btnSave_Click(object sender, EventArgs e) { TurntableConfig cfg = new TurntableConfig(); cfg.Value1 = Convert.ToDecimal(TextBox1.Text); cfg.Value2 = Convert.ToDecimal(TextBox2.Text); cfg.Value3 = Convert.ToDecimal(TextBox3.Text); cfg.Value4 = Convert.ToDecimal(TextBox4.Text); cfg.Value5 = Convert.ToDecimal(TextBox5.Text); cfg.Value6 = Convert.ToDecimal(TextBox6.Text); cfg.Value7 = Convert.ToDecimal(TextBox7.Text); cfg.Value8 = Convert.ToDecimal(TextBox8.Text); cfg.Value9 = Convert.ToDecimal(TextBox9.Text); cfg.Value10 = Convert.ToDecimal(TextBox10.Text); cfg.Value11 = Convert.ToDecimal(TextBox11.Text); cfg.Value12 = Convert.ToDecimal(TextBox12.Text); cfg.Value13 = Convert.ToDecimal(TextBox13.Text); cfg.id = IntParam; int mm = FacadeManage.aidePlatformFacade.SaveTurnTable(cfg); if (mm > 0) { ShowInfo("配置信息操作成功", "TurntableConfig.aspx", 1200); } else { ShowError("配置信息操作失败"); } }
public static int StartTurntable(TurntableConfig pre) { int r = new Random().Next((int)pre.MenuVaule); int i = 1; long p = 0; for (; i < 13; ++i) { decimal pp = (decimal)(pre.GetType().GetProperty("Value" + i).GetValue(pre, null)); p += (long)pp; if (p > r) { break; } } return(i); }
protected void BindData() { TurntableConfig cfg = FacadeManage.aidePlatformFacade.GetTurntableConfigByid(IntParam); TextBox1.Text = cfg.Value1.ToString(); TextBox2.Text = cfg.Value2.ToString(); TextBox3.Text = cfg.Value3.ToString(); TextBox4.Text = cfg.Value4.ToString(); TextBox5.Text = cfg.Value5.ToString(); TextBox6.Text = cfg.Value6.ToString(); TextBox7.Text = cfg.Value7.ToString(); TextBox8.Text = cfg.Value8.ToString(); TextBox9.Text = cfg.Value9.ToString(); TextBox10.Text = cfg.Value10.ToString(); TextBox11.Text = cfg.Value11.ToString(); TextBox12.Text = cfg.Value12.ToString(); TextBox13.Text = cfg.Value13.ToString(); }
public static void CreatTurnTableDate() { IList <TurntableConfig> list = aidePlatformFacade.GetTurntableConfigs(); int pp = new Random().Next(100); int turnIndex = 0; if (pp > list[3].MenuVaule && pp < list[8].MenuVaule) { turnIndex = 1; } else if (pp > list[8].MenuVaule) { turnIndex = 2; } TurntableConfig broad = list[5 * turnIndex + 2]; TurntableConfig money = list[5 * turnIndex]; AccountsInfo android = aideAccountsFacade.RandomAndroid(); int index = StartTurntable(list[5 * turnIndex + 3]); TurntableReward record = new TurntableReward(); record.money = (decimal)(money.GetType().GetProperty("Value" + index).GetValue(money, null)); record.time = DateTime.Now; string tName = ""; switch (turnIndex) { case 0: tName = "白银转盘"; break; case 1: tName = "黄金转盘"; break; default: tName = "钻石转盘"; break; } record.turnName = tName; record.nickName = android.NickName; int mm = (int)((decimal)(broad.GetType().GetProperty("Value" + index).GetValue(broad, null))); PustTurnTableRecord(record, mm); }
public int SaveTurnTable(TurntableConfig cfg) { return(_aidePlatformData.SaveTurnTable(cfg)); }