コード例 #1
0
        protected void Cell_Click(object sender, DirectEventArgs e)
        {
            string idEmi = "";
            string noPoliza = "";
            RowSelectionModel sm = this.gridSeguimientoEmisiones.SelectionModel.Primary as RowSelectionModel;
            foreach (SelectedRow row in sm.SelectedRows)
            {
                PagoPolizas pago = new PagoPolizas(Convert.ToString(row.RecordID));
                List<PagoPolizas> pagopol;
                pagopol = (List<PagoPolizas>)(Session["PagoPol"]);
                pagopol.Add(pago);
                Session["PagoPol"] = pagopol;

            }
            foreach (SelectedRow row in sm.SelectedRows)
            {
                Session["IdEmision"] = Convert.ToInt32(row.RecordID);
            }
            List<PagoPolizas> papol = (List<PagoPolizas>)(Session["PagoPol"]);
            if (papol.Count == 1)
            {
                idEmi = Convert.ToString(Session["IdEmision"]);
            }
            else
            {
                idEmi = "";
            }
            List<reporteEmisiones.Seguimiento> seguimientos = new List<reporteEmisiones.Seguimiento>(reportes.ReporteSeguimientoPagoPol(0, Convert.ToString(Session["FechaIni"]), Convert.ToString(Session["FechaFin"])));
            foreach (reporteEmisiones.Seguimiento nodo in seguimientos)
            {
                if (idEmi == nodo.IdEmision)
                {
                    noPoliza = nodo.NoPoliza;

                    /////
                    if (nodo.FechaCoopPagaPrybe != "")
                    {
                        txtFechaPagoCoop.Text = nodo.FechaCoopPagaPrybe;
                        txtNoOperFPC.Text = nodo.OperCoopPagaPrybe;
                        txtFechaPagoCoop.Disabled = true;

                        cfNoOperFPC.Disabled = false;

                        txtNoOperFPC.Disabled = true;
                        btnGuardaFPC.Disabled = true;
                        btnModA.Disabled = false;
                    }
                    else
                    {
                        txtFechaPagoCoop.Value = EmptyValue.EmptyString;
                        txtNoOperFPC.Text = "";
                        txtFechaPagoCoop.Disabled = false;
                        cfNoOperFPC.Disabled = false;
                    }

                    /////////
                    if (nodo.FechaPrybePagaAseg != "")
                    {
                        txtFechaPagoAseg.Text = nodo.FechaPrybePagaAseg;
                        txtNoOperFPA.Text = nodo.OperPrybePagaAseg;
                        txtFechaPagoAseg.Disabled = true;

                        cfNoOperFPA.Disabled = false;

                        txtNoOperFPA.Disabled = true;
                        btnGuardaFPA.Disabled = true;
                        btnModB.Disabled = false;


                    }
                    else
                    {
                        txtFechaPagoAseg.Value = EmptyValue.EmptyString;
                        txtNoOperFPA.Text = "";
                        txtFechaPagoAseg.Disabled = false;
                        cfNoOperFPA.Disabled = false;
                    }
                    //////
                    if (nodo.FechaAsegPagaAPrybe != "")
                    {
                        txtFechaAsegPagaPrybe.Text = nodo.FechaAsegPagaAPrybe;
                        txtNoOperFAP.Text = nodo.OperAsegPagaAPrybe;
                        txtFechaAsegPagaPrybe.Disabled = true;

                        cfNoOperFAP.Disabled = false;

                        txtNoOperFAP.Disabled = true;
                        btnNoOperFAP.Disabled = true;
                        btnModD.Disabled = false;
                    }
                    else
                    {
                        txtFechaAsegPagaPrybe.Value = EmptyValue.EmptyString;
                        txtNoOperFAP.Text = "";
                        txtFechaAsegPagaPrybe.Disabled = false;
                        cfNoOperFAP.Disabled = false;
                    }
                    //////
                    if (nodo.FechaPrybePagaACoop != "")
                    {
                        txtFechaPrybePagaCoop.Text = nodo.FechaPrybePagaACoop;
                        txtNoOperFPPC.Text = nodo.OperPrybePagaACoop;
                        txtFechaPrybePagaCoop.Disabled = true;

                        cfNoOperFPPC.Disabled = false;

                        txtNoOperFPPC.Disabled = true;
                        btnNoOperFPPC.Disabled = true;
                        btnModE.Disabled = false;
                    }
                    else
                    {
                        txtFechaPrybePagaCoop.Value = EmptyValue.EmptyString;
                        txtNoOperFPPC.Text = "";
                        txtFechaPrybePagaCoop.Disabled = false;
                        cfNoOperFPPC.Disabled = false;
                    }
                }
            }

            Session["IDEMISION"] = idEmi;

            lblEmi.Text = "";
            lblEmi.Text = "       " + idEmi;

            lblPoliza.Text = "";
            lblPoliza.Text = "       " + noPoliza;
        }
コード例 #2
0
        protected void GuardaFechaPrybePagaACoop(object sender, EventArgs e)
        {
            RowSelectionModel sm = this.gridSeguimientoEmisiones.SelectionModel.Primary as RowSelectionModel;
            reporteEmisiones.Error error = new reporteEmisiones.Error();
            reporteEmisiones.wsReportes reportes = new reporteEmisiones.wsReportes();
            foreach (SelectedRow row in sm.SelectedRows)
            {
                PagoPolizas pago = new PagoPolizas(Convert.ToString(row.RecordID));
                List<PagoPolizas> pagopol;
                pagopol = (List<PagoPolizas>)(Session["PagoPol"]);
                pagopol.Add(pago);
                Session["PagoPol"] = pagopol;

            }
            if (txtNoOperFPC.Text != "")
            {
                if (txtFechaPagoCoop.Text != "")
                {
                    List<PagoPolizas> pagopol = (List<PagoPolizas>)(Session["PagoPol"]);
                    foreach (var item in pagopol)
                    {
                        if (Convert.ToBoolean(Session["ModF"]) == true)
                        {
                            error = reportes.ActualizaSeguimientoPagoPol(13, item.Id, txtFechaPrybePagaCoop.Text, txtNoOperFPPC.Text);
                        }
                        else
                        {
                            error = reportes.ActualizaSeguimientoPagoPol(9, item.Id, txtFechaPrybePagaCoop.Text, txtNoOperFPPC.Text);
                        }
                    }

                }
            }

            if (error.Value == false)
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title = "Operación Registrada",
                    Message = "La operación fue registrada exitosamente.",
                    Buttons = MessageBox.Button.OK,
                    Icon = MessageBox.Icon.INFO
                });
                gridSeguimientoEmisiones.RefreshView();
                BloqueaCampos();
                if (Convert.ToBoolean(Session["ModF"]) == true)
                {
                    Loguin.InsertLogDanos(Convert.ToInt32(Session["Ejecutivo"]), 18, "FECHA Y PAGO MODIFICADOS DE PRYBE A COOPERATIVA");
                }
                else
                {
                    Loguin.InsertLogDanos(Convert.ToInt32(Session["Ejecutivo"]), 18, "FECHA Y PAGO GUARDADOS DE PRYBE A COOPERATIVA");
                }

            }
            else
            {
                X.Msg.Show(new MessageBoxConfig
                {
                    Title = "Advertencia!",
                    Message = "Ha ocurrido un problema: " + error.Msg,
                    Buttons = MessageBox.Button.OK,
                    Icon = MessageBox.Icon.WARNING
                });
                BloqueaCampos();
            }
            List<reporteEmisiones.Seguimiento> seguimientos = new List<reporteEmisiones.Seguimiento>(reportes.ReporteSeguimientoPagoPol(0, Convert.ToString(Session["FechaIni"]), Convert.ToString(Session["FechaFin"])));
            this.storeSeguimiento.DataSource = seguimientos;
            this.storeSeguimiento.DataBind();
            sm.ClearSelections();
        }