コード例 #1
0
    private void BindData()
    {
        string project  = "";
        string zjdh     = "";
        string teamCode = "";

        if (ASPxComboBoxProject.SelectedIndex >= 0)
        {
            project = ASPxComboBoxProject.SelectedItem.Value as string;
        }
        if (ASPxComboBoxZJDH.SelectedIndex >= 0)
        {
            zjdh = ASPxComboBoxZJDH.SelectedItem.Value as string;
        }
        if (ASPxComboBoxTeam.SelectedIndex >= 0)
        {
            teamCode = ASPxComboBoxTeam.SelectedItem.Value as string;
        }
        if (string.IsNullOrWhiteSpace(project) && string.IsNullOrWhiteSpace(teamCode))
        {
            return;
        }
        if (string.IsNullOrWhiteSpace(project))
        {
            List <PlanBomEntity> allBOMs = PlanBOMFactory.GetByTeamID(teamCode);
            if (allBOMs.Count > 0)
            {
                //doWork(allBOMs);
            }
        }
        else if (!string.IsNullOrWhiteSpace(project))
        {
            List <PlanEntity> plans = PlanFactory.GetByProjectCode(project);
            if (plans == null || plans.Count < 1)
            {
                return;
            }
            if (!string.IsNullOrWhiteSpace(zjdh))
            {
                plans = (from s in plans where s.PRODUCT_MODEL == zjdh select s).ToList <PlanEntity>();
            }
            string[]             planCodes = (from s in plans select s.PLAN_CODE).ToArray <string>();
            List <PlanBomEntity> allBOMs   = PlanBOMFactory.GetByPlanCodes(planCodes);
            if (!string.IsNullOrWhiteSpace(teamCode))
            {
                allBOMs = (from s in allBOMs where s.TEAM_CODE == teamCode select s).ToList <PlanBomEntity>();
            }
            if (allBOMs.Count > 0)
            {
                //doWork(allBOMs);
            }
        }
    }