コード例 #1
0
 private void refreshComboBoxInvAnno()
 {
     // init comboBoxInvMagazzino
     comboBoxInvAnno.DataSource = null;
     comboBoxInvAnno.DisplayMember = "name";
     comboBoxInvAnno.ValueMember = "value";
     comboBoxInvAnno.DataSource = from o in db.INVENTARIO
                                  where o.MAGAZZINO == magazzinoCorrente
                                  select new
                                  {
                                      value = o,
                                      name = o.anno
                                  };
     inventarioCorrente = (INVENTARIO)comboBoxInvAnno.SelectedValue;
 }
コード例 #2
0
 private void comboBoxInvAnno_SelectedIndexChanged(object sender, EventArgs e)
 {
     inventarioCorrente = (INVENTARIO)comboBoxInvAnno.SelectedValue;
     queryM3();
 }
コード例 #3
0
        /**
        * Query M4V2: Aggiunta di un nuovo inventario.
        */
        private void queryM4V2()
        {
            INVENTARIO inventario = new INVENTARIO
            {

                MAGAZZINO = (MAGAZZINO)comboBoxInvMagazzino2.SelectedValue,
                anno = Convert.ToInt32(this.numericUpDownInvAnno.Value)
            };

            db.INVENTARIO.InsertOnSubmit(inventario);
            try
            {
                db.SubmitChanges();
            }
            catch (System.Data.Linq.DuplicateKeyException e)
            {
                db.INVENTARIO.DeleteOnSubmit(inventario);
                db.SubmitChanges();
                MessageBox.Show("Hai già inserito questo inventario");
            }
            catch (Exception e)
            {
                db.INVENTARIO.DeleteOnSubmit(inventario);
                db.SubmitChanges();
                MessageBox.Show(e.GetType().ToString());
            }

            queryM3();
        }
コード例 #4
0
 partial void DeleteINVENTARIO(INVENTARIO instance);
コード例 #5
0
 partial void UpdateINVENTARIO(INVENTARIO instance);
コード例 #6
0
 partial void InsertINVENTARIO(INVENTARIO instance);
コード例 #7
0
		private void detach_INVENTARIO(INVENTARIO entity)
		{
			this.SendPropertyChanging();
			entity.MAGAZZINO = null;
		}