Esempio n. 1
0
        private void lst_nozzels_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lst_nozzels.SelectedItems.Count > 0)
            {
                dt.Rows.Clear();
                var selectedtank = (Tank)lst_nozzels.SelectedItems[0].Tag;
                lbl_innerdia.Text = selectedtank.InnerDiameter.ToString();
                lbl_len.Text      = selectedtank.Length.ToString();
                lbl_capacity.Text = selectedtank.Capacity.ToString();
                lbl_stock.Text    = selectedtank.CurrentSIH.ToString();


                lst_nos.Items.Clear();
                var tanks = CustomeRepository.GetNozzelsOFTanks(selectedtank.Id);
                foreach (var item in tanks)
                {
                    DataRow drow = dt.NewRow();
                    drow[0] = item.Id;
                    drow[1] = item.NozzelName;
                    drow[2] = 0.00;
                    string       name = item.NozzelName;
                    ListViewItem itm  = new ListViewItem(name + Environment.NewLine + item.LastTotalizerReading.ToString());
                    itm.Tag        = item;
                    itm.ImageIndex = 0;
                    lst_nos.Items.Add(itm);
                    dt.Rows.Add(drow);
                }
            }
        }