public void SetUserRevenueData(UserRevenueBean userRevenueData) { this.userRevenueData = userRevenueData; GameTimeHandler.Instance.GetTime(out int year, out int month, out int day); if (month == 0) { month = 1; } rgMonth.SetPosition(month - 1, true); }
/// <summary> /// 获取相应月份数据 /// </summary> /// <param name="month"></param> /// <param name="userRevenueData"></param> /// <returns></returns> public UserRevenueMonthBean GetUserRevenueMonthData(int month, UserRevenueBean userRevenueData) { if (userRevenueData == null || userRevenueData.listMonthData == null) { return(null); } foreach (UserRevenueMonthBean monthData in userRevenueData.listMonthData) { if (month == monthData.month) { return(monthData); } } return(null); }
public void SetUserRevenue(string userId, InnRecordBean innRecordData) { UserRevenueBean userRevenueData = GetModel().GetUserRevenueByYear(userId, innRecordData.year); if (userRevenueData == null) { userRevenueData = new UserRevenueBean(); userRevenueData.year = innRecordData.year; userRevenueData.userId = userId; } if (userRevenueData.listMonthData == null) { userRevenueData.listMonthData = new List <UserRevenueMonthBean>(); } bool hasMonthData = false; foreach (UserRevenueMonthBean itemMonth in userRevenueData.listMonthData) { if (itemMonth.month == innRecordData.month) { if (itemMonth.listDayData == null) { itemMonth.listDayData = new List <InnRecordBean>(); } itemMonth.listDayData.Add(innRecordData); hasMonthData = true; } } if (!hasMonthData) { UserRevenueMonthBean itemMonth = new UserRevenueMonthBean(); itemMonth.month = innRecordData.month; itemMonth.listDayData = new List <InnRecordBean>(); itemMonth.listDayData.Add(innRecordData); userRevenueData.listMonthData.Add(itemMonth); } SetUserRevenue(userRevenueData); }
public void GetUserRevenueSuccess(UserRevenueBean userRevenue, Action <UserRevenueBean> action) { action?.Invoke(userRevenue); }
/// <summary> /// 设置营收数据 /// </summary> /// <param name="userRevenue"></param> public void SetUserRevenue(UserRevenueBean userRevenue) { userRevenueService.UpdateDataByYear(userRevenue); }
public void GetUserRevenueByYear(string userId, int year, Action <UserRevenueBean> action) { UserRevenueBean userRevenueData = GetModel().GetUserRevenueByYear(userId, year); GetView().GetUserRevenueSuccess(userRevenueData, action); }
public void SetUserRevenue(UserRevenueBean userRevenueData) { GetModel().SetUserRevenue(userRevenueData); }