Exemplo n.º 1
0
        private void UpdateUI(bool autoWeld = false)
        {
            historiesList.Items.Clear();
            var db = new DataProcess();

            if (autoWeld)
            {
                var list = db.AutoWeldHistoryList();
                if (Histories == null)
                {
                    Histories = new List <History>();
                }
                else
                {
                    Histories.Clear();
                }
                list.ForEach((item) => {
                    Histories.Add(item);
                });
                Text = "控制记录";
            }
            else
            {
                Histories = db.HistoryList();
                Text      = "焊接历史";
            }
            Histories.ForEach((history) => {
                var name        = history.Name.Trim();
                var defaultName = autoWeld ? "(未命名控制记录)" : "(未命名焊接记录)";
                historiesList.Items.Add(name.Length == 0 ? defaultName : name);
            });
            ShowHistory();
        }
Exemplo n.º 2
0
        public static History LatestHistory()
        {
            var db              = new DataProcess();
            var histories       = db.HistoryList();
            var sortedHistories = from h in histories where true orderby h.CreatedAt descending select h;

            if (sortedHistories.Count() == 0)
            {
                return(null);
            }
            else
            {
                return(sortedHistories.First());
            }
        }
Exemplo n.º 3
0
        private void LoadWeldingDataLists()
        {
            var db          = new DataProcess();
            var gangtaoList = db.GangTaoList();

            GangTaoTypeComboBox.Items.Clear();
            gangtaoList.ForEach((item) => {
                GangTaoTypeComboBox.Items.Add(item);
            });
            var weldingItemList = db.WeldingItemList();

            WeldingItemComboBox.Items.Clear();
            weldingItemList.ForEach((item) => {
                WeldingItemComboBox.Items.Add(item);
            });
            histories = db.HistoryList();
            HistoriesListBox.Items.Clear();
            histories.ForEach((item) => {
                HistoriesListBox.Items.Add(item.ShortDescription());
            });
        }
Exemplo n.º 4
0
 private void UpdateUI(bool autoWeld = false)
 {
     historiesList.Items.Clear();
     var db = new DataProcess();
     if (autoWeld)
     {
         var list = db.AutoWeldHistoryList();
         if (Histories == null)
         {
             Histories = new List<History>();
         }
         else
         {
             Histories.Clear();
         }
         list.ForEach((item) => {
             Histories.Add(item);
         });
         Text = "控制记录";
     }
     else
     {
         Histories = db.HistoryList();
         Text = "焊接历史";
     }
     Histories.ForEach((history) => {
         var name = history.Name.Trim();
         var defaultName = autoWeld ? "(未命名控制记录)" : "(未命名焊接记录)";
         historiesList.Items.Add(name.Length == 0 ? defaultName : name);
     });
     ShowHistory();
 }
Exemplo n.º 5
0
 private void LoadWeldingDataLists()
 {
     var db = new DataProcess();
     var gangtaoList = db.GangTaoList();
     GangTaoTypeComboBox.Items.Clear();
     gangtaoList.ForEach((item) => {
         GangTaoTypeComboBox.Items.Add(item);
     });
     var weldingItemList = db.WeldingItemList();
     WeldingItemComboBox.Items.Clear();
     weldingItemList.ForEach((item) => {
         WeldingItemComboBox.Items.Add(item);
     });
     histories = db.HistoryList();
     HistoriesListBox.Items.Clear();
     histories.ForEach((item) => {
         HistoriesListBox.Items.Add(item.ShortDescription());
     });
 }
Exemplo n.º 6
0
 public static History LatestHistory()
 {
     var db = new DataProcess();
     var histories = db.HistoryList();
     var sortedHistories = from h in histories where true orderby h.CreatedAt descending select h;
     if (sortedHistories.Count() == 0)
     {
         return null;
     }
     else
     {
         return sortedHistories.First();
     }
 }