Beispiel #1
0
        public CelulaForm(string titlu, int id, string denumire, bool anulat, string hala)
        {
            ManagerHala m=new ManagerHala();
            Hala h = null;
            InitializeComponent();

            this.Id = id;
            this.Denumire = denumire;
            this.Anulat = anulat;

            this.Text = titlu;
            txtDenumire.Text = Denumire;
            ckAnulat.Checked = Anulat;
            hale = m.GetHale(false);

                if (id == 0)
                {
                    BindCombo();

                }
                else
                {
                    h = m.GetHalaByDenumire(hala);
                    BindCombo1(h);
                }
        }
Beispiel #2
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;
            }
        }