Exemplo n.º 1
0
        private void ListViewTreatTime_OnLoaded(object sender, RoutedEventArgs e)
        {
            //throw new NotImplementedException();
            try
            {
                using (var treatTimeDao = new TreatTimeDao())
                {
                    Datalist.Clear();
                    var condition = new Dictionary <string, object>();
                    var list      = treatTimeDao.SelectTreatTime(condition);
                    foreach (var type in list)
                    {
                        var treatTimeData = new TreatTimeData();
                        treatTimeData.Id          = type.Id;
                        treatTimeData.Name        = type.Name;
                        treatTimeData.Activated   = type.Activated;
                        treatTimeData.BeginTime   = type.BeginTime;
                        treatTimeData.EndTime     = type.EndTime;
                        treatTimeData.Description = type.Description;

                        Datalist.Add(treatTimeData);
                    }
                }
            }
            catch (Exception ex)
            {
                MainWindow.Log.WriteInfoConsole("In CTreatTime.xaml.cs:ListViewCTreatTime_OnLoaded exception messsage: " + ex.Message);
            }
        }
Exemplo n.º 2
0
        private void RefreshData()
        {
            try
            {
                using (var treatTimeDao = new TreatTimeDao())
                {
                    Datalist.Clear();

                    var condition = new Dictionary <string, object>();
                    var list      = treatTimeDao.SelectTreatTime(condition);
                    foreach (var pa in list)
                    {
                        var treatTimeData = new TreatTimeData();
                        treatTimeData.Id          = pa.Id;
                        treatTimeData.Name        = pa.Name;
                        treatTimeData.Activated   = pa.Activated;
                        treatTimeData.BeginTime   = pa.BeginTime;
                        treatTimeData.EndTime     = pa.EndTime;
                        treatTimeData.Description = pa.Description;
                        Datalist.Add(treatTimeData);
                    }
                }
            }
            catch (Exception ex)
            {
                MainWindow.Log.WriteInfoConsole("In CTreatTime.xaml.cs:RefreshData exception messsage: " + ex.Message);
            }
        }