Esempio n. 1
0
    public FillTopicList FillTopic(int courseId, int instId, int sid, int Flag)
    {
        NewDAL.DBManager objDB = new DBManager();
        objDB.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["FeesManagementConn"].ConnectionString;
        objDB.DBManager(DataAccessLayer.DataProvider.SqlServer, objDB.ConnectionString);
        objDB.Open();
        objDB.CreateParameters(4);
        objDB.AddParameters(0, "courseId", courseId, DbType.Int32);
        objDB.AddParameters(1, "instId", instId, DbType.Int32);
        objDB.AddParameters(2, "sid", sid, DbType.Int32);
        objDB.AddParameters(3, "Flag", Flag, DbType.Int32);

        IDataReader   dr        = (IDataReader)objDB.ExecuteReader(CommandType.StoredProcedure, "StudentPortal_StudentDetail");
        FillTopicList listTopic = new FillTopicList();

        while (dr.Read())
        {
            var item = new PortalDM.TopicListDM();
            item.SubjectName  = Education.DataHelper.GetString(dr, "SubjectName");
            item.SubjectCode  = Education.DataHelper.GetString(dr, "SubjectCode");
            item.TopicName    = Education.DataHelper.GetString(dr, "TopicName");
            item.Subject_Type = Education.DataHelper.GetString(dr, "Subject_Type");
            item.Hour         = Education.DataHelper.GetInt(dr, "Hour");
            item.PHours       = Education.DataHelper.GetInt(dr, "PHours");
            listTopic.Add(item);
        }
        objDB.DataReader.Close();
        objDB.Connection.Close();
        objDB = null;
        return(listTopic);
    }
    // Use this for initialization
    void Start()
    {
        this.ProgressManager = GameObject.Find("Progress");

        ProgressObject progress = ProgressManager.GetComponent <ProgressObject>();

        EntryTextDisplay.text = String.Empty;

        foreach (EncyclopediaEntry entry in EncyclopediaEntries)
        {
            if (entry.UnlockPath.ChapterNum == 0 || progress.ProgressPaths.progressPaths.Any(i => i.ChapterNum == entry.UnlockPath.ChapterNum && i.SectionNum == entry.UnlockPath.SectionNum))
            {
                GameObject           newEntry   = Instantiate(EncyclopediaItemPrefab) as GameObject;
                TopicPanelProperties properties = newEntry.GetComponent <TopicPanelProperties>();
                properties.Name.text        = entry.Title;
                properties.TopicTag         = entry.TopicTag;
                properties.TopicText        = entry.EntryText;
                properties.BackgroundImage  = entry.BackgroundImage;
                properties.EntryTextDisplay = this.EntryTextDisplay;

                FillTopicList fillTopic = newEntry.GetComponent <FillTopicList>();
                fillTopic.ImagePanel      = this.ImagePanel;
                fillTopic.ProgressManager = this.ProgressManager;
                fillTopic.SubTopicPanel   = this.SubTopicPanel;

                newEntry.transform.SetParent(ContentPanel.transform, false);
            }
        }
    }
    public void UpdateContents(string topicTag)
    {
        foreach (EncyclopediaSubEntry entry in entries)
        {
            if (entry.MatchTag == topicTag)
            {
                foreach (EncyclopediaEntry subEntry in entry.SubEntries)
                {
                    GameObject           newEntry   = Instantiate(EncyclopediaItemPrefab) as GameObject;
                    TopicPanelProperties properties = newEntry.GetComponent <TopicPanelProperties>();
                    properties.Name.text        = subEntry.Title;
                    properties.TopicTag         = subEntry.TopicTag;
                    properties.MatchTag         = subEntry.MatchTag;
                    properties.TopicText        = subEntry.EntryText;
                    properties.EntryTextDisplay = EntryTextDisplay;
                    newEntry.transform.SetParent(ContentPanel.transform, false);

                    FillTopicList fillTopic = newEntry.GetComponent <FillTopicList>();
                    fillTopic.ImagePanel      = this.ImagePanel;
                    fillTopic.ProgressManager = this.ProgressManager;

                    if (this.SubTopicPanel != null)
                    {
                        fillTopic.SubTopicPanel = this.SubTopicPanel;
                    }

                    panels.Add(newEntry);
                }
            }
        }
    }