Beispiel #1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            ManagerAmbalaj m = null;

            try
            {
                m = new ManagerAmbalaj();

                Denumire = txtDenumire.Text;
                Anulat = ckAnulat.Checked;
                Greutate = txtGreutate.Value;
                if (!VerifyInfo()) { return; }
                SaveAmbalaj(m);
                IsOk = true;
                this.Close();
            }
            catch (Exception ex)
            {
                IsOk = false;
                MessageBox.Show(ex.Message);
            }
            finally
            {
                m = null;
            }
        }
Beispiel #2
0
        internal void Init()
        {
            ManagerAmbalaj m = new ManagerAmbalaj();
            IList<Ambalaj> ambalaje = null;

            ambalaje = m.GetAmbalaje(rbToateAmbalajele.Checked);
            //log.Error("Multe anbalaje: " + ambalaje.Count);
            bindingSource1.DataSource = ambalaje;
            //dgrHale.Update(true);
            //bindingSource2_PositionChanged(this, null);
            bindingSource1_PositionChanged(this, null);
        }
Beispiel #3
0
        private void ConfirmareAnulareAmbalaj(object sender, EventArgs e)
        {
            ManagerAmbalaj m = null;

            try
            {
                if ((sender as Form).DialogResult != DialogResult.Yes)
                {
                    return;
                }
                m = new ManagerAmbalaj();
                ambalajCurent.Anulat = true;
                m.SaveAmbalaj(ambalajCurent);
                Init();
                bindingSource1_PositionChanged(sender, e);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                m = null;
            }
        }
        private void SetAmbalaje()
        {
            ManagerAmbalaj m = null;
            try
            {
                m = new ManagerAmbalaj();

                ambalaje = m.GetAmbalaje(false);
                ambalaje.Add(new Ambalaj("Toate ambalajele"));
                cmbAmbalaje.DataSource = ambalaje;
                cmbAmbalaje.DisplayMember = "Denumire";
                cmbAmbalaje.Text = "Toate ambalajele";
            }
            finally
            {
                m = null;
            }
        }
Beispiel #5
0
 private void SaveAmbalaj(ManagerAmbalaj m)
 {
     Ambalaj a = new Ambalaj();
     a.Id = Id;
     a.Denumire = Denumire;
     a.Anulat = Anulat;
     a.Greutate = Greutate;
     m.SaveAmbalaj(a);
 }