public void JMPutItem(JM unit)
        {
            string procedure = ("dbo.jm_putItem");

            GetPropertiesToUpdate(ref procedure, unit);
            daJMs.PutItem(procedure, unit);
        }
        private void JMSListView_DoubleClick(object sender, EventArgs e)
        {
            JM         theUnit = (JM)JMSListView.SelectedItems[0].Tag;
            EditJMForm form    = new EditJMForm(theUnit);

            form.FormClosed += ClosedEditJMForm;
            form.ShowDialog();
        }
Esempio n. 3
0
 public EditJMForm(JM unit = null)
 {
     InitializeComponent();
     if (unit == null)
     {
         theUnit = new JM();
     }
     else
     {
         theUnit = unit;
     }
     PrecisionComboBox.Items.Add("1");
     PrecisionComboBox.Items.Add("0,1");
     PrecisionComboBox.Items.Add("0,01");
     PrecisionComboBox.Items.Add("0,001");
     NameUnitTextBox.Text            = theUnit.Name;
     PrecisionComboBox.SelectedIndex = theUnit.Precision;
 }
        private void UpdateJMSListView()
        {
            JMS = db.JMGetAll();

            JMSListView.Items.Clear();

            JM newJM = new JM();

            ListViewItem lvi;

            foreach (var item in JMS)
            {
                lvi = new ListViewItem(new string[]
                {
                    item.Name,
                    Helper.MekePracision(item.Precision)
                });;
                lvi.Tag = item;
                JMSListView.Items.Add(lvi);
            }
            lvi     = new ListViewItem("");
            lvi.Tag = newJM;
            JMSListView.Items.Add(lvi);
        }