/// <summary>
        /// Guarda en la bd el objeto actual
        /// </summary>
        protected bool SaveObject()
        {
            PgMng.Reset(3, 1, Resources.Messages.SAVING);

            User temp = _entity.Clone();

            temp.SessionCode = User.OpenSession();
            temp.BeginTransaction();
            PgMng.Grow();

            // do the save
            try
            {
                _entity = temp.Save();
                PgMng.Grow(string.Empty, "temp.Save()");

                return(true);
            }
            catch (iQValidationException ex)
            {
                PgMng.ShowInfoException(ex);
                return(false);
            }
            catch (Exception ex)
            {
                PgMng.ShowErrorException(ex);
                return(false);
            }
            finally
            {
                PgMng.FillUp();
                temp.CloseSession();
            }
        }
Beispiel #2
0
        protected override void DeleteAction()
        {
            if (CurrentDocumento == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Resources.Messages.DELETE_CONFIRM) == DialogResult.No)
            {
                return;
            }

            _back_job = BackJob.Delete;
            PgMng.Reset(9, 1, Resources.Messages.CONNECTING_SERVER, this);
            //PgMng.StartBackJob(this);
            DoJob();

            PgMng.Grow();
            if (PgMng.Result == BGResult.OK)
            {
                _entity.ApplyEdit();
                _entity.Save();
            }

            RefreshSecondaryData();
            PgMng.FillUp();
        }
        protected virtual void LoadStockAction()
        {
            try
            {
                if (Partidas_DGW.CurrentRow == null)
                {
                    return;
                }
                if (Partidas_DGW.CurrentRow.DataBoundItem == null)
                {
                    return;
                }

                BatchInfo batch = Partidas_DGW.CurrentRow.DataBoundItem as BatchInfo;

                //if (Cache.Instance.Get(typeof(StockList)) != null) return;

                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
                PgMng.Grow();

                StockList list = StockList.GetByBatchList(batch.Oid, false, true);
                list.UpdateStocksByBatch(false);
                Stock_BS.DataSource = list;
                //Cache.Instance.Save(typeof(StockList), Stock_BS.DataSource as StockList);
                PgMng.Grow();

                HideComponentes(Stock_TP);

                ControlsMng.UpdateBinding(Stock_BS);
            }
            finally
            {
                PgMng.FillUp();
            }
        }
Beispiel #4
0
        protected void DoAddAlbaran(BackgroundWorker bk)
        {
            Datos.RaiseListChangedEvents          = false;
            Datos_Concepto.RaiseListChangedEvents = false;

            try
            {
                PgMng.Reset(_results.Count + 1, 1, Resources.Messages.IMPORTANDO_ALBARANES, this);

                _entity.CopyFrom(_results[0]);

                foreach (OutputDeliveryInfo item in _results)
                {
                    _entity.Insert(item);
                    _albaranes.Add(item);
                    PgMng.Grow(string.Empty, "Insertar el Albarán");
                }

                Result = BGResult.OK;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                PgMng.FillUp();

                Datos.RaiseListChangedEvents          = true;
                Datos_Concepto.RaiseListChangedEvents = true;
#if TRACE
                PgMng.ShowCronos();
#endif
            }
        }
        /// <summary>
        /// Implementa Save_button_Click
        /// </summary>
        protected override void BkSubmitAction()
        {
            PgMng.Reset(4, 1, Face.Resources.Messages.RETRIEVING_DATA);

            long oid_auditoria = TodosAuditorias_CkB.Checked ? -1 : _auditoria.Oid;
            long oid_plan      = TodosPlanes_CkB.Checked ? -1 : _plan.Oid;

            _estado = !TodosEstados_CkB.Checked ? EstadoAuditoria.CREADA : (EstadoAuditoria)Enum.Parse(typeof(EstadoAuditoria), Estado_CB.Text);
            long     estado         = TodosEstados_CkB.Checked ? -1 : (long)_estado;
            DateTime f_ini          = FInicial_DTP.Checked ? FInicial_DTP.Value : DateTime.MinValue;
            DateTime f_fin          = FFinal_DTP.Checked ? FFinal_DTP.Value : DateTime.MaxValue;
            DateTime f_comunicacion = FComunicacion_DTP.Checked ? FComunicacion_DTP.Value : DateTime.MinValue;

            string filtro = GetFilterValues();

            PgMng.Grow();

            moleQule.Library.Application.Tools.WordExporter word = new moleQule.Library.Application.Tools.WordExporter();

            AuditoriaList lista = AuditoriaList.GetAbiertasList(oid_auditoria, oid_plan, estado, f_ini, f_fin, f_comunicacion, FInicial_DTP.Checked, FFinal_DTP.Checked, FComunicacion_DTP.Checked);

            word.ExportSeguimientoAuditorias(lista);
            PgMng.FillUp();

            _action_result = DialogResult.Ignore;
        }
        public override void DownloadAction()
        {
            PgMng.Reset(5, 1, Resources.Messages.CONNECTING_SERVER, this);

            HipatiaCtl.InitHipatia(_ftp, Principal.GetHipatiaFTPRootPath(), Principal.GetHipatiaFTPHost());
            PgMng.Grow();

            if (HipatiaCtl.ExistsDirectory(_ftp, ActiveItem.Ruta))
            {
                if (Browser.ShowDialog() == DialogResult.OK)
                {
                    string destinationPath = Browser.SelectedPath;
                    string tempFile        = destinationPath + "\\" + System.Web.HttpUtility.UrlEncode(ActiveItem.Nombre);

                    PgMng.Message = Resources.Messages.DOWNLOADING_FILE;
                    PgMng.Grow();
                    _ftp.DownloadFile(Path.GetDirectoryName(ActiveItem.Ruta), destinationPath, Path.GetFileName(ActiveItem.Nombre));
                    PgMng.Message = Resources.Messages.CLOSING_SERVER;
                    PgMng.Grow();
                    PgMng.Result = BGResult.OK;
                }
            }
            else
            {
                PgMng.Result = BGResult.Error;
                throw new iQException(Resources.Errors.FILE_NOT_FOUND);
            }

            PgMng.FillUp();
        }
Beispiel #7
0
        protected virtual void LoadProductos()
        {
            if (Datos_Productos.DataSource as ProductList != null)
            {
                return;
            }

            try
            {
                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
                PgMng.Grow();

                Datos_Productos.RaiseListChangedEvents = false;
                Datos_Productos.DataSource             = ProductList.GetSortedList(ProductList.GetListByAlmacen(EntityInfo.Oid, false),
                                                                                   ProductoNombre.DataPropertyName,
                                                                                   ListSortDirection.Ascending);
                Datos_Productos.RaiseListChangedEvents = true;
                PgMng.Grow();

                Datos_Productos.ResetBindings(false);
            }
            finally
            {
                PgMng.FillUp();
            }
        }
        protected virtual void LoadWorkReports(bool reload = false)
        {
            if (WorkReportMonth_DGW.CurrentRow == null)
            {
                _work_reports            = null;
                WorkReport_BS.DataSource = _work_reports;
            }
            else if (_work_reports == null || reload)
            {
                try
                {
                    PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);

                    WorkReportResourceInfo work_report_month = WorkReportMonth_DGW.CurrentRow.DataBoundItem as WorkReportResourceInfo;

                    _work_reports            = WorkReportResourceList.GetByEmployeeList(EntityInfo.Oid, work_report_month.From.Year, work_report_month.From.Month, false, false);
                    WorkReport_BS.DataSource = _work_reports;
                    PgMng.Grow();
                }
                finally
                {
                    PgMng.FillUp();
                }
            }
        }
        protected virtual void LoadCategoriesDetailsExpenses()
        {
            if (WRCategories_DGW.CurrentRow == null)
            {
                _categories_detail_expenses = null;
            }
            else
            {
                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
                try
                {
                    WorkReportResourceInfo category = WRCategories_DGW.CurrentRow.DataBoundItem as WorkReportResourceInfo;

                    _categories_detail_expenses      = WorkReportResourceList.GetByCategoryAndResourceList(category.OidCategory, EntityInfo.Relations.ToChildsOidList(), true, false);
                    WRCategoriesDetail_BS.DataSource = _categories_detail_expenses;
                    PgMng.Grow(string.Empty);
                }
                finally
                {
                    _categories_detail_expenses = null;

                    PgMng.FillUp();
                }
            }
        }
        protected override void LoadAyudas()
        {
            if (_entity.ExpedientesFomento == null || _entity.ExpedientesFomento.Count == 0)
            {
                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
                try
                {
                    PgMng.Grow();
                    _entity.LoadChilds(typeof(REAExpedient), true, true);
                    Datos_REA.DataSource = _entity.ExpedientesREA;
                    Datos_REA.ResetBindings(true);
                    PgMng.Grow();
                }
                finally
                {
                    PgMng.FillUp();
                }
            }
            else
            {
                Datos_REA.DataSource = _entity.ExpedientesREA;
                Datos_REA.ResetBindings(false);
            }

            AyudaTotal_NTB.Text = _entity.AyudaExpediente.ToString("C2");
            CalculateBeneficios();
            SetExpedienteREAFormat();
        }
        public virtual void CrearFacturaAction()
        {
            DeliverySelectForm form = new DeliverySelectForm(this, ETipoEntidad.Cliente, OutputDeliveryList.GetNoFacturados(true));

            form.ShowDialog(this);

            if (form.DialogResult == DialogResult.OK)
            {
                try
                {
                    PgMng.Reset(4, 1, Resources.Messages.GENERANDO_FACTURAS, this);
                    List <OutputDeliveryInfo> albaranes = form.Selected as List <OutputDeliveryInfo>;
                    PgMng.Grow();

                    OutputInvoices facturas = OutputInvoices.NewList();
                    facturas.NewItems(albaranes);
                    PgMng.Grow();

                    facturas.Save();
                    facturas.CloseSession();

                    _selected      = albaranes;
                    _action_result = DialogResult.OK;
                }
                catch (Exception ex)
                {
                    PgMng.ShowInfoException(ex);
                }
                finally
                {
                    PgMng.FillUp();
                }
            }
        }
        protected override void EliminarConceptoAction()
        {
            if (Datos_Concepto.Current == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                PgMng.Reset(5, 1, Store.Resources.Messages.UPDATING_STOCK, this);

                BatchInfo pexp = BatchInfo.Get(Line.OidPartida, true);
                PgMng.Grow();

                if (pexp.IsKit)
                {
                    DeleteKit(pexp);
                }
                PgMng.Grow();

                _entity.Conceptos.Remove(Line);
                _entity.CalculaTotal();
                PgMng.Grow();

                RefreshConceptos();
                ControlsMng.UpdateBinding(Datos);
                PgMng.FillUp();
            }

            Serie_BT.Enabled = (_entity.Conceptos.Count > 0);
        }
Beispiel #13
0
        protected override void ResumenAction()
        {
            if (_entity == null)
            {
                return;
            }
            List <RegistroResumenPlanDocente> lista_teoricas  = null;
            List <RegistroResumenPlanDocente> lista_practicas = null;

            PgMng.Reset(2, 1, Resources.Messages.LOADING_DATA, this);
            try
            {
                lista_teoricas = RegistroResumenPlanDocente.ContabilizaClasesTeoricas(_entity.Oid);
                PgMng.Grow();
                lista_practicas = RegistroResumenPlanDocente.ContabilizaClasesPracticas(_entity.Oid);
            }
            finally
            {
                PgMng.FillUp();
            }

            ResumenPlanDocenteForm form = new ResumenPlanDocenteForm(true, lista_teoricas, lista_practicas, this);

            form.ShowDialog();
        }
        protected override void PrintAction()
        {
            PgMng.Reset(5, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            Library.Invoice.QueryConditions conditions = new Library.Invoice.QueryConditions();

            conditions.Cliente   = TodosCliente_CkB.Checked ? null : _cliente;
            conditions.Serie     = TodosSerie_CkB.Checked ? null : _serie;
            conditions.MedioPago = MedioPago_CB.SelectedValue != null ? (EMedioPago)(long)MedioPago_CB.SelectedValue : EMedioPago.Todos;
            conditions.FechaIni  = FInicial_DTP.Checked ? FInicial_DTP.Value : DateTime.MinValue;
            conditions.FechaFin  = FFinal_DTP.Checked ? FFinal_DTP.Value : DateTime.MaxValue;

            string filtro = GetFilterValues();

            PgMng.Grow();

            OutputInvoiceList facturas = OutputInvoiceList.GetList(conditions, false);

            PgMng.Grow();
            CobroFacturaList cobros = CobroFacturaList.GetList(conditions);

            PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT);

            CobroReportMng   reportMng = new CobroReportMng(AppContext.ActiveSchema, this.Text, filtro);
            InformeCobrosRpt rpt       = reportMng.GetInformeCobrosReport(cobros, facturas);

            PgMng.FillUp();

            ShowReport(rpt);

            _action_result = DialogResult.Ignore;
        }
        protected override bool SaveObject()
        {
            this.Datos.RaiseListChangedEvents = false;

            // do the save
            try
            {
                PgMng.Reset(6, 1, Library.Store.Resources.Messages.ACTUALIZANDO_STOCKS, this);

                OutputDelivery temp = _entity.Clone();
                temp.ApplyEdit();
                PgMng.Grow();

                _entity = temp.Save();
                _entity.ApplyEdit();
                PgMng.Grow();

                return(true);
            }
            catch (Exception ex)
            {
                CleanCache();
                PgMng.ShowInfoException(ex);
                return(false);
            }
            finally
            {
                this.Datos.RaiseListChangedEvents = true;
                PgMng.FillUp();
            }
        }
        protected virtual void LoadStaffExpenses(bool reload = false)
        {
            if (_staff_expenses == null || reload)
            {
                PgMng.Reset(4, 1, Face.Resources.Messages.LOADING_DATA, this);
                try
                {
                    _staff_expenses       = WorkReportResourceList.GetList(EntityInfoNoChilds.Oid, ETipoEntidad.Empleado, true, false);
                    WRStaff_BS.DataSource = _staff_expenses;

                    WRStaffProjectTotal_NTB.Text = (_staff_expenses != null) ? _staff_expenses.GetTotal().ToString("C2") : (0).ToString("C2");

                    PgMng.Grow(string.Empty);

                    _staff_works_expenses      = WorkReportResourceList.GetList(EntityInfo.Relations.ToChildsOidList(), ETipoEntidad.Empleado, true, false);
                    WRStaffWorks_BS.DataSource = _staff_works_expenses;

                    PgMng.Grow(string.Empty);

                    WRStaffWorksTotal_NTB.Text = (_staff_works_expenses != null) ? _staff_works_expenses.GetTotal().ToString("C2") : (0).ToString("C2");

                    WRStaffTotal_NTB.Text = (WRStaffProjectTotal_NTB.DecimalValue + WRStaffWorksTotal_NTB.DecimalValue).ToString("C2");

                    PgMng.Grow(string.Empty);
                }
                finally
                {
                    PgMng.FillUp();
                }
            }
        }
        protected override void DeleteLineAction()
        {
            if (Lines_BS.Current == null)
            {
                return;
            }

            if (ProgressInfoMng.ShowQuestion(Face.Resources.Messages.DELETE_CONFIRM) == DialogResult.Yes)
            {
                if (Concepto.OidPedido == 0)
                {
                    PgMng.Reset(4, 1, Store.Resources.Messages.UPDATING_STOCK, this);

                    if (Concepto.OidPartida != 0)
                    {
                        BatchInfo partida = BatchInfo.Get(Concepto.OidPartida, true);
                        PgMng.Grow();

                        if (partida.IsKit)
                        {
                            DeleteKit(partida);
                        }
                        PgMng.Grow();
                    }

                    _entity.Conceptos.Remove(Concepto, true);
                    _entity.CalculateTotal();
                    PgMng.Grow();
                }
                else
                {
                    long oidPedido = Concepto.OidPedido;

                    _entity.Conceptos.Remove(Concepto, true);
                    _entity.CalculateTotal();

                    bool free_pedido = true;

                    foreach (OutputDeliveryLine item in _entity.Conceptos)
                    {
                        if (item.OidPedido == Concepto.OidPedido)
                        {
                            free_pedido = false;
                        }
                    }

                    //Actualizamos la lista de pedidos disponibles
                    if (free_pedido)
                    {
                        _pedidos.AddItem(_pedidos_cliente.GetItem(oidPedido));
                    }
                }

                ControlsMng.UpdateBinding(Lines_BS);
                ControlsMng.UpdateBinding(Datos);
                PgMng.FillUp();
            }

            Serie_BT.Enabled = (_entity.Conceptos.Count > 0);
        }
        protected virtual void LoadToolsExpenses(bool reload = false)
        {
            if (_tools_works_expenses == null || reload)
            {
                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
                try
                {
                    _tools_expenses       = WorkReportResourceList.GetList(EntityInfoNoChilds.Oid, ETipoEntidad.Tool, true, false);
                    WRTools_BS.DataSource = _tools_expenses;

                    WRToolsProjectTotal_NTB.Text = (_tools_works_expenses != null) ? _tools_expenses.GetTotal().ToString("C2") : (0).ToString("C2");

                    PgMng.Grow(string.Empty);

                    _tools_works_expenses      = WorkReportResourceList.GetList(EntityInfo.GetExpedientsOidList(), ETipoEntidad.Tool, true, false);
                    WRToolsWorks_BS.DataSource = _tools_works_expenses;

                    WRToolsWorksTotal_NTB.Text = (_tools_works_expenses != null) ? _tools_works_expenses.GetTotal().ToString("C2") : (0).ToString("C2");

                    PgMng.Grow(string.Empty);

                    WRToolsTotal_NTB.Text = (WRToolsProjectTotal_NTB.DecimalValue + WRToolsWorksTotal_NTB.DecimalValue).ToString("C2");
                }
                finally
                {
                    PgMng.FillUp();
                }
            }
        }
        protected override void LoadWorkReports(bool reload = false)
        {
            if (_work_reports == null || reload)
            {
                PgMng.Reset(4, 1, Face.Resources.Messages.LOADING_DATA, this);
                try
                {
                    _work_reports            = WorkReportList.GetByExpedientList(_entity.Oid, false);
                    WorkReport_BS.DataSource = _work_reports;

                    PgMng.Grow(string.Empty);

                    _work_reports_works = WorkReportList.GetByExpedientList(_entity.Relations.ToChildsOidList(), false);

                    PgMng.Grow(string.Empty);

                    UpdateWorkReportsTotals();

                    PgMng.Grow(string.Empty);
                }
                finally
                {
                    PgMng.FillUp();
                }
            }
        }
        private void Promociones_CLB_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            PgMng.Reset(2, 1, Resources.Messages.LOADING_DATA);

            try
            {
                if (e.NewValue == CheckState.Unchecked)
                {
                    if (_promociones.ContainsKey(Promociones_CLB.Items[e.Index].ToString()))
                    {
                        _promociones.Remove(Promociones_CLB.Items[e.Index].ToString());
                    }
                    PgMng.Grow();
                }
                else if (e.NewValue == CheckState.Checked)
                {
                    if (!_promociones.ContainsKey(Promociones_CLB.Items[e.Index].ToString()))
                    {
                        _promociones.Add(Promociones_CLB.Items[e.Index].ToString(), _promociones_todas[Promociones_CLB.Items[e.Index].ToString()]);
                    }
                    PgMng.Grow();
                }
            }
            catch { }
            finally { PgMng.FillUp(); }
        }
        public virtual void CrearFacturaAction()
        {
            InputDeliverySelectForm form = new InputDeliverySelectForm(this, InputDeliveryList.GetNoFacturados(true));

            form.ShowDialog(this);

            if (form.DialogResult == DialogResult.OK)
            {
                try
                {
                    PgMng.Reset(4, 1, Resources.Messages.GENERANDO_FACTURAS, this);
                    List <InputDeliveryInfo> deliveries = form.Selected as List <InputDeliveryInfo>;
                    PgMng.Grow();

                    InputInvoices invoices = InputInvoices.NewList();
                    invoices.NewItems(deliveries);
                    PgMng.Grow();

                    invoices.Save();
                    invoices.CloseSession();

                    _selected      = deliveries;
                    _action_result = DialogResult.OK;
                }
                catch (Exception ex)
                {
                    PgMng.ShowInfoException(ex);
                }
                finally
                {
                    PgMng.FillUp();
                    RefreshList();
                }
            }
        }
        protected override void LoadStock(ProductInfo producto)
        {
            if (producto == null)
            {
                return;
            }

            try
            {
                PgMng.Reset(4, 1, Face.Resources.Messages.LOADING_DATA, this);

                PgMng.Grow();

                _entity.LoadStockByProducto(producto.Oid, true, true);
                SelectStockAction(producto);
                PgMng.Grow();

                ActualizaBindings();
                PgMng.Grow();
            }
            finally
            {
                PgMng.FillUp();
            }
        }
Beispiel #23
0
        public virtual void EmailAction()
        {
            if (ActiveItem == null)
            {
                return;
            }

            PgMng.Reset(3, 1, Face.Resources.Messages.OPENING_EMAIL_CLIENT, this);

            MailParams mail = new MailParams();

            mail.To = ActiveItem.Email;

            try
            {
                PgMng.Grow();

                EMailSender.MailTo(mail);
            }
            catch
            {
                PgMng.ShowInfoException(moleQule.Face.Resources.Messages.NO_EMAIL_CLIENT);
            }
            finally
            {
                PgMng.FillUp();
            }
        }
Beispiel #24
0
        protected virtual void LoadIncomes(long oidExpediente)
        {
            if (_facturas_ingresos_list != null)
            {
                return;
            }

            try
            {
                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);

                _facturas_ingresos_list    = OutputInvoiceList.GetByExpedienteList(oidExpediente, false);
                Datos_FIngresos.DataSource = _facturas_ingresos_list;
                PgMng.Grow();

                TotalPendienteFacturasE_NTB.Text  = _facturas_ingresos_list.TotalPendiente().ToString("N2");
                TotalFacturasE_NTB.Text           = _facturas_ingresos_list.Total().ToString("N2");
                TotalExpedienteFacturasE_NTB.Text = _facturas_ingresos_list.TotalExpediente().ToString("N2");

                BePurchases_NTB.Text = TotalExpedienteFacturasE_NTB.DecimalValue.ToString("C2");

                _conceptos_ingresos_list   = OutputInvoiceLineList.GetByExpedienteList(oidExpediente, false);
                Datos_CIngresos.DataSource = _conceptos_ingresos_list;
                PgMng.Grow();

                CalculateBeneficios();
            }
            finally
            {
                PgMng.FillUp();
            }
        }
Beispiel #25
0
        protected override void ViewAction()
        {
            if (CurrentDocumento == null)
            {
                return;
            }

            _destination_path = System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);

            _back_job = BackJob.Download;
            PgMng.Reset(6, 1, Resources.Messages.CONNECTING_SERVER, this);
            //PgMng.StartBackJob(this);
            DoJob();

            PgMng.Grow();
            if (PgMng.Result == BGResult.OK)
            {
                System.Diagnostics.Process process = new System.Diagnostics.Process();
                process.StartInfo.FileName = TempFile;
                process.Start();
                PgMng.FillUp();
                try
                {
                    process.WaitForExit();
                }
                catch { }

                File.Delete(TempFile);
            }
            else
            {
                PgMng.FillUp();
            }
        }
Beispiel #26
0
        protected void EditFacturaGastos(Expedient expediente, InputInvoiceInfo fac)
        {
            this.Enabled = false;

            try
            {
                PgMng.Reset(5, 1, "Recalculando gastos y costes del expediente...", this);
                PgMng.Grow();

                expediente.LoadConceptosAlbaranes(false);
                PgMng.Grow();

                expediente.UpdateGasto(fac, expediente.Conceptos, true);
                PgMng.Grow();

                UpdateExpensesList();
                UpdateBindings();
                PgMng.Grow();
            }
            finally
            {
                PgMng.FillUp();
                this.Enabled = true;
            }
        }
        protected virtual void LoadPartidasAction()
        {
            try
            {
                if (Cache.Instance.Get(typeof(BatchList)) != null)
                {
                    return;
                }

                PgMng.Reset(3, 1, Face.Resources.Messages.LOADING_DATA, this);
                PgMng.Grow();

                Batch_BS.DataSource = BatchList.GetByProductList(EntityInfo.Oid, false);
                Cache.Instance.Save(typeof(BatchList), Batch_BS.DataSource as BatchList);
                PgMng.Grow();

                HideComponentes(Partidas_TP);

                ControlsMng.UpdateBinding(Batch_BS);
            }
            finally
            {
                PgMng.FillUp();
            }
        }
Beispiel #28
0
        protected void RemoveFacturaGastos(Expedient expediente, InputInvoiceInfo fac)
        {
            this.Enabled = false;

            try
            {
                PgMng.Reset(5, 1, "Recalculando gastos y costes del expediente...", this);

                if (fac.Conceptos == null)
                {
                    fac.LoadChilds(typeof(InputInvoiceLine), false);
                }

                foreach (InputInvoiceLineInfo item in fac.Conceptos)
                {
                    item.IsSelected = true;
                }
                PgMng.Grow();

                expediente.LoadConceptosAlbaranes(false);
                PgMng.Grow();

                expediente.RemoveGasto(fac, expediente.Conceptos, true);
                PgMng.Grow();

                UpdateExpensesList();
                Datos.ResetBindings(false);
                PgMng.Grow();
            }
            finally
            {
                PgMng.FillUp();
                this.Enabled = true;
            }
        }
Beispiel #29
0
        public ChildForm(bool isModal, Form parent)
        {
            InitializeComponent();

            _form_id = DateTime.Now.ToBinary();

            _is_modal = isModal;

            this.MdiParent = _is_modal ? null : ((parent != null) ? ((parent.IsMdiContainer) ? parent : MainBaseForm.Instance) : MainBaseForm.Instance);

            _parent = parent as BaseForm;

            HelpProvider.HelpNamespace = Application.StartupPath + Resources.Paths.HELP_PATH + "Help.chm";

            if ((PgMng != null) && (BarSteps > 2))
            {
                if ((_parent != null) && (_parent is BaseForm))
                {
                    PgMng.Reset(BarSteps * 2, 2, Resources.Messages.LOADING_DATA, "ChildForm()", _parent as BaseForm);
                }
                else
                {
                    PgMng.Reset(BarSteps * 2, 2, Resources.Messages.LOADING_DATA, "ChildForm()", this);
                }
            }
#if TRACE
            // Para depuración de tiempos
            _timer = Library.Timer.Instance;
#endif
        }
Beispiel #30
0
        protected override void SubmitAction()
        {
            PgMng.Reset(3, 1, Face.Resources.Messages.RETRIEVING_DATA, this);

            try
            {
                PreciosExporter _exporter = new PreciosExporter();

                PgMng.Grow(Face.Resources.Messages.BUILDING_REPORT);
                if (_tipo == ETipoTitular.Cliente)
                {
                    _exporter.ExportInformePrecios(_pivoted_table, _tipo, _filtro);
                }
                else if (_tipo == ETipoTitular.Proveedor)
                {
                    _exporter.ExportInformePrecios(_pivoted_table, _tipo, _filtro);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, moleQule.Face.Resources.Labels.ADVISE_TITLE, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            finally
            {
                PgMng.FillUp();
            }

            _action_result = DialogResult.Ignore;
        }