Example #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;
        }
Example #2
0
 protected override void Cancel()
 {
     Lista_Fond();
     base.Cancel();
     FondEditBS.CancelEdit();
     FondEditBS.ResetBindings(false);
 }
Example #3
0
 protected override void Dodaj()
 {
     base.Dodaj();
     fond = FondEdit.CreateFondEdit();
     FondEditBS.DataSource = fond;
     FondEditBS.ResetBindings(false);
     txt_sifra_fond.Focus();
 }
Example #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);
     }
 }