예제 #1
0
        private void FillClpDataList()
        {
            int       maxLenght = 30;
            DataTable table     = _repository.GetAll(ClpRepository.GetClpHPData);

            foreach (DataRow row in table.Rows)
            {
                int    id       = Convert.ToInt32(row["id"]);
                int    ordering = Convert.ToInt32(row["ordering"]);
                string clpHP    = row["clp"].ToString();

                string clpClass = "";
                if (clpHP.Substring(0, 1).ToUpper() == "H")
                {
                    clpClass = row["class"].ToString();
                }

                string clpDescription = row["description"].ToString();
                if (clpDescription.Length > maxLenght)
                {
                    clpDescription = clpDescription.Substring(0, maxLenght) + " ...";
                }

                ClpDataList.Add(new ClpMV(id, clpHP, clpClass, clpDescription, ordering));
            }
        }
예제 #2
0
 public ClpListMV()
 {
     OnSelectionChangedCommand    = new RelayCommand <SelectionChangedEventArgs>(OnSelectionChangedCommandExecuted);
     OnSelectionClpChangedCommand = new RelayCommand <SelectionChangedEventArgs>(OnSelectionClpChangedCommandExecuted);
     ClpSelectedList.Clear();
     ClpDataList.Clear();
     FillClpDataList();
 }