예제 #1
0
        private void EgresosVarios_Cargar(int idOperacion)
        {
            EgresosWCFClient objEgresoWCF     = new EgresosWCFClient();
            bool?            bloqueado        = null;
            string           mensajeBloqueado = null;

            gsEgresosVarios_BuscarDetalleResult[] lstEgresosVarios_Detalle = null;
            gsEgresosVarios_BuscarCabeceraResult  objEgresosVarios;

            try
            {
                objEgresosVarios = objEgresoWCF.EgresosVarios_Buscar(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
                                                                     ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, idOperacion, ref bloqueado, ref mensajeBloqueado,
                                                                     ref lstEgresosVarios_Detalle);

                lblSerieNro.Text     = objEgresosVarios.Serie + "-" + objEgresosVarios.NroDocumento;
                lblNomVendedor.Text  = objEgresosVarios.ID_Agenda + "-" + objEgresosVarios.AgendaNombre;
                lblFechaEmision.Text = objEgresosVarios.Vcmto.ToString("dd/MM/yyyy");
                lblMotivo.Text       = objEgresosVarios.NombreDocumento;
                lblFechaInicio.Text  = objEgresosVarios.FechaInicio.ToString("dd/MM/yyyy");
                lblFechaFinal.Text   = objEgresosVarios.Vcmto.ToString("dd/MM/yyyy");

                grdResumen.DataSource = lstEgresosVarios_Detalle.ToList().FindAll(x => x.Estado == 1);;
                grdResumen.DataBind();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
예제 #2
0
        private void EgresosVarios_Cargar(int idOperacion)
        {
            EgresosWCFClient objEgresoWCF     = new EgresosWCFClient();
            bool?            bloqueado        = null;
            string           mensajeBloqueado = null;

            gsEgresosVarios_BuscarDetalleResult[] lstEgresosVarios_Detalle = null;
            gsEgresosVarios_BuscarCabeceraResult  objEgresosVarios;

            try {
                if (idOperacion != 0)
                {
                    objEgresosVarios = objEgresoWCF.EgresosVarios_Buscar(((Usuario_LoginResult)Session["Usuario"]).idEmpresa,
                                                                         ((Usuario_LoginResult)Session["Usuario"]).codigoUsuario, idOperacion, ref bloqueado, ref mensajeBloqueado,
                                                                         ref lstEgresosVarios_Detalle);
                    if ((bool)bloqueado)
                    {
                        throw new ArithmeticException(mensajeBloqueado);
                    }

                    lblIDAgenda.Text              = objEgresosVarios.ID_Agenda;
                    txtNroDoc.Text                = objEgresosVarios.NroDocumento;
                    txtNombre.Text                = objEgresosVarios.AgendaNombre;
                    dpFecRegistro.SelectedDate    = objEgresosVarios.Fecha;
                    dpFecVencimiento.SelectedDate = objEgresosVarios.Vcmto;
                    cboMoneda.SelectedValue       = objEgresosVarios.ID_Moneda.ToString();
                    txtConcepto.Text              = objEgresosVarios.Concepto;
                    txtSerie.Text  = objEgresosVarios.Serie;
                    txtNumero.Text = objEgresosVarios.Numero.ToString();
                    cboCentroCosto.SelectedValue = objEgresosVarios.ID_CCosto;
                    cboUnidGestion.SelectedValue = objEgresosVarios.ID_UnidadGestion;
                    cboUnidProy.SelectedValue    = objEgresosVarios.ID_UnidadProyecto;
                    cboNatGasto.SelectedValue    = objEgresosVarios.ID_NaturalezaGastoIngreso;

                    ViewState["objEVCabecera"] = JsonHelper.JsonSerializer(objEgresosVarios);
                    ViewState["lstEVDetalle"]  = JsonHelper.JsonSerializer(lstEgresosVarios_Detalle.ToList());

                    lblTotal.Text = "Total: " + lstEgresosVarios_Detalle.ToList().AsEnumerable().Sum(x => x.Importe).ToString();

                    grdRecibos.DataSource = lstEgresosVarios_Detalle.ToList().FindAll(x => x.Estado == 1);;
                    grdRecibos.DataBind();
                }
                else
                {
                    txtNroDoc.Text = ((Usuario_LoginResult)Session["Usuario"]).nroDocumento;
                    txtNombre.Text = ((Usuario_LoginResult)Session["Usuario"]).nombres.ToUpper();

                    objEgresosVarios              = new gsEgresosVarios_BuscarCabeceraResult();
                    objEgresosVarios.Op           = idOperacion;
                    objEgresosVarios.ID_Agenda    = ((Usuario_LoginResult)Session["Usuario"]).nroDocumento;
                    objEgresosVarios.AgendaNombre = ((Usuario_LoginResult)Session["Usuario"]).nombres;
                    ViewState["objEVCabecera"]    = JsonHelper.JsonSerializer(objEgresosVarios);
                    ViewState["lstEVDetalle"]     = JsonHelper.JsonSerializer(new List <gsEgresosVarios_BuscarDetalleResult>());

                    lblTotal.Text = "Total: 0.00";

                    grdRecibos.DataSource = lstEgresosVarios_Detalle;
                    grdRecibos.DataBind();
                }
            }
            catch (Exception ex) {
                throw ex;
            }
        }