示例#1
0
        protected override void Snimi()
        {
            FondEditBS.RaiseListChangedEvents = false;
            FondEditBS.EndEdit();
            try
            {
                if (!fond.IsValid)
                {
                    var           errors = fond.BrokenRulesCollection;
                    StringBuilder sb     = new StringBuilder();
                    foreach (var er in errors)
                    {
                        sb.AppendLine(er.Description);
                    }

                    MessageBox.Show(sb.ToString());
                    return;
                }


                fond = fond.Save();
                base.Snimi();
                Lista_Fond();
            }
            catch (DataPortalException ex)
            {
                MessageBox.Show(ex.BusinessException.Message, "Snimi", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }

            FondEditBS.RaiseListChangedEvents = true;
        }
示例#2
0
 protected override void Dodaj()
 {
     base.Dodaj();
     fond = FondEdit.CreateFondEdit();
     FondEditBS.DataSource = fond;
     FondEditBS.ResetBindings(false);
     txt_sifra_fond.Focus();
 }
示例#3
0
        protected override void Obrisi()
        {
            base.Obrisi();
            var select = FondInfoListBS.Current as FondInfo;

            if (select == null)
            {
                return;
            }

            if (MessageBox.Show("Da li ste sigurni?", "Potvrdi", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                FondEdit.DeleteFondEdit(select.Id);
                Lista_Fond();
            }
        }
示例#4
0
 protected override void Izmjeni()
 {
     base.Izmjeni();
     try
     {
         if (FondInfoListBS.Current == null)
         {
             return;
         }
         var select = FondInfoListBS.Current as FondInfo;
         fond = FondEdit.GetFondEdit(select.Id);
         FondEditBS.DataSource = fond;
         fond.Id = select.Id;
         FondEditBS.ResetBindings(false);
         txt_sifra_fond.Focus();
     }
     catch (DataPortalException ex)
     {
         MessageBox.Show(ex.BusinessException.Message, "Izmjeni", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }