private void GetBetAmount(ModelBetState modelBetState) { List <ModelBet> lsttempModelBet; Type t = modelBetState.GetType(); for (int i = 0; i < 10; i++) { System.Reflection.PropertyInfo propertyInfoPlan = t.GetProperty("Bet" + i + "PlanID"); System.Reflection.PropertyInfo propertyInfoPeriod = t.GetProperty("Bet" + i + "PeriodID"); System.Reflection.PropertyInfo propertyInfoAmount = t.GetProperty("Bet" + i + "Amount"); if ((int)propertyInfoPlan.GetValue(modelBetState) == 1) { lsttempModelBet = lstBet1; } else if ((int)propertyInfoPlan.GetValue(modelBetState) == 2) { lsttempModelBet = lstBet2; } else if ((int)propertyInfoPlan.GetValue(modelBetState) == 3) { lsttempModelBet = lstBet3; } else if ((int)propertyInfoPlan.GetValue(modelBetState) == 4) { lsttempModelBet = lstBet4; } else if ((int)propertyInfoPlan.GetValue(modelBetState) == 5) { lsttempModelBet = lstBet5; } else if ((int)propertyInfoPlan.GetValue(modelBetState) == 6) { lsttempModelBet = lstBet6; } else { lsttempModelBet = new List <ModelBet>(); } ModelBet modetempbet = lsttempModelBet.Find(p => p.MyPeriodId == (int)propertyInfoPeriod.GetValue(modelBetState)); if (modetempbet != null) { //modelCurrentBetState.Bet0Amount = modetempbet.MyBetAmountPerBet; propertyInfoAmount.SetValue(modelBetState, modetempbet.MyBetAmountPerBet.ToString()); } } }
private void ProcessData() { // s1.CompareTo(s2)>0 string strPeriodFrom = CbbPeriodDateFrom.Text + CbbPeriodNoFrom.Text; string strPeriodTo = CbbPeriodDateTo.Text + CbbPeriodNoTo.Text; List <ModelSSCPeriods> lstFilterSSCPeriods = lstSSCPeriods.Where(p => p.Period.CompareTo(strPeriodFrom) >= 0 && p.Period.CompareTo(strPeriodTo) <= 0).ToList(); //current bet 保存状态 ModelCurrentBetState modelCurrentBetState = new ModelCurrentBetState() { Bet0PlanID = 1, Bet0PeriodID = 1, Bet1PlanID = 1, Bet1PeriodID = 1, Bet2PlanID = 1, Bet2PeriodID = 1, Bet3PlanID = 1, Bet3PeriodID = 1, Bet4PlanID = 1, Bet4PeriodID = 1, Bet5PlanID = 1, Bet5PeriodID = 1, Bet6PlanID = 1, Bet6PeriodID = 1, Bet7PlanID = 1, Bet7PeriodID = 1, Bet8PlanID = 1, Bet8PeriodID = 1, Bet9PlanID = 1, Bet9PeriodID = 1, }; ModelCurrentBetState modelNextBetState = new ModelCurrentBetState(); // GetBetAmount(modelCurrentBetState); // for (int i = 0; i < lstFilterSSCPeriods.Count; i++) { string strPeriod = lstFilterSSCPeriods[i].Period.Substring(2, lstFilterSSCPeriods[i].Period.Length - 2); //process ModelBetState modelBetState = new ModelBetState() { Period = strPeriod, DrawingNumber = lstFilterSSCPeriods[i].DrawingNumber, Bet0PlanID = modelCurrentBetState.Bet0PlanID, Bet1PlanID = modelCurrentBetState.Bet1PlanID, Bet2PlanID = modelCurrentBetState.Bet2PlanID, Bet3PlanID = modelCurrentBetState.Bet3PlanID, Bet4PlanID = modelCurrentBetState.Bet4PlanID, Bet5PlanID = modelCurrentBetState.Bet5PlanID, Bet6PlanID = modelCurrentBetState.Bet6PlanID, Bet7PlanID = modelCurrentBetState.Bet7PlanID, Bet8PlanID = modelCurrentBetState.Bet8PlanID, Bet9PlanID = modelCurrentBetState.Bet9PlanID, Bet0PeriodID = modelCurrentBetState.Bet0PeriodID, Bet1PeriodID = modelCurrentBetState.Bet1PeriodID, Bet2PeriodID = modelCurrentBetState.Bet2PeriodID, Bet3PeriodID = modelCurrentBetState.Bet3PeriodID, Bet4PeriodID = modelCurrentBetState.Bet4PeriodID, Bet5PeriodID = modelCurrentBetState.Bet5PeriodID, Bet6PeriodID = modelCurrentBetState.Bet6PeriodID, Bet7PeriodID = modelCurrentBetState.Bet7PeriodID, Bet8PeriodID = modelCurrentBetState.Bet8PeriodID, Bet9PeriodID = modelCurrentBetState.Bet9PeriodID, Bet0Amount = "", Bet1Amount = "", Bet2Amount = "", Bet3Amount = "", Bet4Amount = "", Bet5Amount = "", Bet6Amount = "", Bet7Amount = "", Bet8Amount = "", Bet9Amount = "" }; lstBetState.Add(modelBetState); AddPeriod(modelCurrentBetState, modelNextBetState, lstFilterSSCPeriods[i], lstFilterSSCPeriods, i); GetBetAmount(modelBetState); modelCurrentBetState = modelNextBetState; CommonFunction.GetTotal(strPeriod, lstBetState); } //filterdata // // }