public List <PlanInfo> GetTeamCurrentPlan()
        {
            List <PlanInfo> result = new List <PlanInfo>();
            PlanFilter      filter = new PlanFilter();

            filter.MyStatus = 2;
            List <PlanInfo> palnList = Get(filter);

            if (palnList != null && palnList.Count > 0)
            {
                foreach (PlanInfo plan in palnList)
                {
                    if ((plan.State == PlanState.Initilize && plan.Stage == PlanStage.PlanInitialize) || plan.Stage == PlanStage.CompleteEvaluate)
                    {
                        continue;
                    }
                    PlanDynamicManager dynamicManager = new PlanDynamicManager();
                    PlanDynamicState   stage          = dynamicManager.GetPlanDynamicState(plan.PlanDefineID, plan.Period.ID);
                    if (stage == PlanDynamicState.Unknown)
                    {
                        continue;
                    }
                    else
                    {
                        result.Add(plan);
                    }
                }
            }
            return(result);
        }
Exemple #2
0
        private PlanInfo AssamblyPlanInfo(DataRow row)
        {
            PlanInfo plan = new PlanInfo();

            plan.ID            = Convert.ToString(row["id"]);
            plan.MainRecipient = new SysUser()
            {
                ID = Convert.ToString(row["mainrecipient"])
            };
            plan.Name  = Convert.ToString(row["name"]);
            plan.State = (PlanState)Convert.ToInt32(row["state"]);
            plan.Stage = (PlanStage)Convert.ToInt32(row["stage"]);
            if (plan.Stage == PlanStage.SelfEvaluate)
            {
                PlanDynamicManager dynamicManager = new PlanDynamicManager();
                PlanDynamicState   stage          = dynamicManager.GetPlanDynamicState(Convert.ToString(row["plandefineid"]), Convert.ToString(row["periodid"]));
                if (stage == PlanDynamicState.InExecution || stage == PlanDynamicState.ToSet)
                {
                    plan.Stage = PlanStage.PlanExecution;
                }
            }
            if (!row.IsNull("periodid"))
            {
                plan.Period = new Period
                {
                    ID       = Convert.ToString(row["periodid"]),
                    Name     = Convert.ToString(row["periodname"]),
                    ParentID = Convert.ToString(row["periodparentid"]),
                    Type     = new PeriodType()
                    {
                        Code = Convert.ToString(row["typecode"]), Name = Convert.ToString(row["typename"])
                    }
                };
            }
            plan.Creator      = new EcpUserService().GetUserByID(Convert.ToString(row["userid"]));
            plan.CreatedTime  = Convert.ToDateTime(row["createdtime"]);
            plan.PlanDefineID = Convert.ToString(row["plandefineid"]);
            return(plan);
        }