예제 #1
0
        internal void Init()
        {
            ManagerCelula m = new ManagerCelula();
            IList<CelulaIMO> celule = null;

            //hale = m.GetHaleIMO(true);
            celule = m.GetCeluleIMO(rbToateCelulele.Checked);

            bindingSource1.DataSource = celule;
            //dgrHale.Update(true);
            //bindingSource2_PositionChanged(this, null);
            bindingSource1_PositionChanged(this, null);
        }
예제 #2
0
 private void SaveCelula(ManagerCelula m)
 {
     Celula c = new Celula();
     c.Id = Id;
     c.Denumire = Denumire;
     c.Anulat = Anulat;
     c.Hala = Hala;
     m.SaveCelula(c);
 }
예제 #3
0
        private void ConfirmareAnulareCelula(object sender, EventArgs e)
        {
            ManagerCelula m = null;
            ManagerHala m1 = null;
            Celula c = null;

            try
            {
                if ((sender as Form).DialogResult != DialogResult.Yes)
                {
                    return;
                }
                m = new ManagerCelula();
                m1 = new ManagerHala();
                c = new Celula();
                celulaCurenta.Anulat = true;
                c.Id = celulaCurenta.Id;
                c.Denumire = celulaCurenta.Denumire;
                c.Anulat = celulaCurenta.Anulat;
                c.Hala = m1.GetHalaByDenumire(celulaCurenta.Hala);
                m.SaveCelula(c);
                Init();
                bindingSource1_PositionChanged(sender, e);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                m = null;
            }
        }
예제 #4
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            ManagerCelula m = null;

            try
            {
                m = new ManagerCelula();

                Denumire = txtDenumire.Text;
                Anulat = ckAnulat.Checked;
                Hala = cmbHale.SelectedItem as Hala;

                if (!VerifyInfo()) { return; }
                SaveCelula(m);
                IsOk = true;
                this.Close();
            }
            catch (Exception ex)
            {
                IsOk = false;
                MessageBox.Show(ex.Message);
            }
            finally
            {
                m = null;
            }
        }