protected void ConvertLifeSoft(ref List <Sjqd_StatLifecycle> softs)
        {
            for (int i = softs.Count - 1; i >= 0; i--)
            {
                if (i == softs.Count - 1)
                {
                    softs[i].RetainedUserCount = softs[i].RetainedUserCount;
                }
                else
                {
                    softs[i].RetainedUserCount = softs[i].RetainedUserCount + softs[i + 1].RetainedUserCount;
                }
            }
            //增加一个点起始点,100%
            Sjqd_StatLifecycle life = new Sjqd_StatLifecycle();

            life.Days              = 0;
            life.NewUserCount      = softs[0].NewUserCount;
            life.RetainedUserCount = softs[0].NewUserCount;
            life.Platform          = softs[0].Platform;
            life.SoftID            = softs[0].SoftID;
            life.StatDate          = softs[0].StatDate;
            softs.Insert(0, life);
            softs = softs.Where(p => p.Days < 3 || p.Days % 3 == 0).Take(31).ToList();
        }
示例#2
0
        /// 绑定LifeCycle对象 生命周期
        public Sjqd_StatLifecycle LifeCycleBind(IDataReader dataReader)
        {
            Sjqd_StatLifecycle model = new Sjqd_StatLifecycle();
            object             obj;

            obj = dataReader["StatDate"];
            if (obj != null && obj != DBNull.Value)
            {
                int temp = Convert.ToInt32(obj);
                model.StatDate = new DateTime(temp / 10000, temp / 100 % 100, temp % 100, 0, 0, 0);
            }
            obj = dataReader["SoftID"];
            if (obj != null && obj != DBNull.Value)
            {
                model.SoftID = Convert.ToInt32(obj);
            }
            obj = dataReader["Platform"];
            if (obj != null && obj != DBNull.Value)
            {
                model.Platform = (MobileOption)Convert.ToInt32(obj);
            }
            obj = dataReader["NewUserCount"];
            if (obj != null && obj != DBNull.Value)
            {
                model.NewUserCount = Convert.ToInt32(obj);
            }
            obj = dataReader["RetainedUserCount"];
            if (obj != null && obj != DBNull.Value)
            {
                model.RetainedUserCount = Convert.ToInt32(obj);
            }
            obj = dataReader["Days"];
            if (obj != null && obj != DBNull.Value)
            {
                model.Days = Convert.ToInt32(obj);
            }
            return(model);
        }