Ejemplo n.º 1
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    CobroList listA = CobroList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.GetSortedList();
                }
                break;

            case molAction.Edit:
            case molAction.Lock:
            case molAction.Unlock:
                if (_entity == null)
                {
                    return;
                }
                ActiveItem.CopyFrom(_entity);
                break;

            case molAction.Delete:
                if (ActiveItem == null)
                {
                    return;
                }
                List.RemoveItem(ActiveOID);
                if (FilterType == IFilterType.Filter)
                {
                    CobroList listD = CobroList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            RefreshSources();
            if (_entity != null)
            {
                Select(_entity.Oid);
            }
            _entity = null;
        }
Ejemplo n.º 2
0
 protected override void DocumentsAction()
 {
     try
     {
         AgenteEditForm form = new AgenteEditForm(typeof(Charge), Cobro.GetInfo() as IAgenteHipatia);
         form.ShowDialog(this);
     }
     catch (HipatiaException ex)
     {
         if (ex.Code == HipatiaCode.NO_AGENTE)
         {
             AgenteAddForm form = new AgenteAddForm(typeof(Charge), Cobro.GetInfo() as IAgenteHipatia);
             form.ShowDialog(this);
         }
         else
         {
             MessageBox.Show(ex.Message, moleQule.Face.Resources.Labels.ERROR_TITLE);
         }
     }
 }
Ejemplo n.º 3
0
        protected override void PrintCobroAction()
        {
            if (Cobro == null)
            {
                return;
            }

            ChargeInfo c;

            if (Datos_Cobros.Current.GetType().Equals("ChargeInfo"))
            {
                c = (ChargeInfo)Datos_Cobros.Current;
            }
            else
            {
                c = Cobro.GetInfo();
            }

            CobroReportMng reportMng = new CobroReportMng(AppContext.ActiveSchema);

            ReportViewer.SetReport(reportMng.GetDetallesCobroIndividualReport(c));
            ReportViewer.ShowDialog();
        }