Ejemplo n.º 1
0
        public void InitDropDownList_Season(CostumeGuide_Dlg owner, ref DropDownList DDL_Season)
        {
            List <byte> seasonList = NrTSingleton <NrTableSolGuideManager> .Instance.GetSeasonList();

            if (seasonList == null || DDL_Season == null || owner == null)
            {
                Debug.LogError("ERROR, CostumeGuide_Dlg.cs, SetDropDownList_Season(), solSesonList or DDL_Season or owner is Null");
                return;
            }
            DDL_Season.SetViewArea(seasonList.Count + 1);
            DDL_Season.Clear();
            ListItem listItem = new ListItem();

            listItem.Key = owner.ENTIRE_SEASON;
            listItem.SetColumnStr(0, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1943"));
            DDL_Season.Add(listItem);
            string empty = string.Empty;

            foreach (byte current in seasonList)
            {
                ListItem listItem2 = new ListItem();
                listItem2.Key = current;
                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
                {
                    NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2302"),
                    "count",
                    current.ToString()
                });

                listItem2.SetColumnStr(0, empty);
                DDL_Season.Add(listItem2);
            }
            DDL_Season.RepositionItems();
            DDL_Season.SetFirstItem();
        }
Ejemplo n.º 2
0
        public void InitDropDownList_Setorder(CostumeGuide_Dlg owner, ref DropDownList DDL_Setorder)
        {
            DDL_Setorder.SetViewArea(3);
            DDL_Setorder.Clear();
            ListItem listItem = new ListItem();

            listItem.Key = SolGuideSlot.SLOTTYPE_GRADE_ASCENDING;
            listItem.SetColumnStr(0, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1891"));
            DDL_Setorder.Add(listItem);
            ListItem listItem2 = new ListItem();

            listItem2.Key = SolGuideSlot.SLOTTYPE_GRADE_DESCENDING;
            listItem2.SetColumnStr(0, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1892"));
            DDL_Setorder.Add(listItem2);
            ListItem listItem3 = new ListItem();

            listItem3.Key = SolGuideSlot.SLOTTYPE_NAME;
            listItem3.SetColumnStr(0, NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1890"));
            DDL_Setorder.Add(listItem3);
            DDL_Setorder.RepositionItems();
            DDL_Setorder.SetFirstItem();
            owner._currentSort = COSTUME_SORT.SLOTTYPE_GRADE_ASCENDING;
        }
Ejemplo n.º 3
0
 public void GetDropDownList()
 {
     //Pass your data base connection string here
     using (SqlConnection c = new SqlConnection("Data Source = XE - PC; Initial Catalog = EmployeeApp; Integrated Security = True"))
         //Pass your SQL Query and above created SqlConnection object  "c"
         using (SqlCommand cmd = new SqlCommand("SELECT Name FROM CompanyTable", c))
         {
             using (SqlDataReader rdr = cmd.ExecuteReader())
             {
                 while (rdr.Read())
                 {
                     DropDownList.Add(rdr["Name"].ToString());
                 }
             }
         }
 }
Ejemplo n.º 4
0
        private void AddCompleteCombinationItem(DropDownList solCompleteCombinationDDL, Dictionary <int, string> complteCombinationDic)
        {
            int num = 0;

            foreach (KeyValuePair <int, string> current in complteCombinationDic)
            {
                ListItem listItem = new ListItem();
                listItem.Key = current.Key;
                string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(current.Value);

                listItem.SetColumnStr(0, textFromInterface);
                this._listItemInfo.Add(num++, current.Key);
                solCompleteCombinationDDL.Add(listItem);
            }
            solCompleteCombinationDDL.RepositionItems();
        }