Ejemplo n.º 1
0
        public tipoPagos castDR(IDataReader dr)
        {
            tipoPagos item = new tipoPagos();
            try
            {

                if (dr["idioma"] is System.DBNull)
                {
                    item.idioma = "";
                }
                else
                {
                    item.idioma = (string)dr["idioma"];
                }
                if (dr["descripcion"] is System.DBNull)
                {
                    item.descripcion = null;
                }
                else
                {
                    item.descripcion = (string)dr["descripcion"];
                }

                if (dr["idTipoPago"] is System.DBNull)
                {
                    item.idTipoPago = 0;
                }
                else
                {
                    item.idTipoPago = (int)dr["idTipoPago"];
                }

            }
            catch (Exception e)
            {

                throw new Exception(e.Message);
            }

            return item;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// instancia el recibo para guardarlo
        /// </summary>
        /// <returns></returns>
        public RecibosEbuy retornaRecibo()
        {
            //ValidationSummary1.ValidationGroup = "pago";
            TextBox tb;
            tb = (TextBox)this.Parent.FindControl("txt_empresa");
            if (tb.Text != "")
                idProveedor = tb.Text.Substring(tb.Text.IndexOf("//") + 3);
            else
                idProveedor = EbuySession.DatosDe;
               // if (Page.IsValid)
            Page.Validate("pago");

            if (Page.IsValid)
            {

                modoPago modopago = new modoPago();
                modopago.ID = int.Parse(rbl_modoPago.SelectedValue);
                modopago.descripcion = rbl_modoPago.SelectedItem.ToString();
                oRecibo.ModoPago = modopago;
                oRecibo.fechaDeposito = EbuyFunciones.EbuyFuncion.FechaTextoADateTime(fechaPago.Text);
                if (config.EsFacturador)
                {
                    oRecibo.estado = (EstadosFact)8;
                }
                else
                {
                    oRecibo.estado = (EstadosFact)7;
                }
                if (Txt_ReciboSerie.Text == "" || Txt_ReciboNumero.Text == "")
                {
                    oRecibo.ReciboId = "";
                }
                else
                {
                    oRecibo.ReciboId = Txt_ReciboSerie.Text + "-" + Txt_ReciboNumero.Text;
                }

               // oRecibo.fechaDeposito = DateTime.Parse(fechaDeposito.Text);
                oRecibo.fechaInforme = System.DateTime.Now;
                oRecibo.Importe = decimal.Parse(txt_importeE.Text + "." + txt_importeD.Text);
                oRecibo.monid = rbl_monedas.SelectedValue;
                //TODO: aca ver el tema del id
                oRecibo.provId = idProveedor;
                oRecibo.userId = EbuySession.Usuario;
                oRecibo.PagoInformado.observaciones = txt_comentarios.Text;
                oRecibo.PagoInformado.transaccion = "";
                oRecibo.conRetenciones = decimal.Parse(Txt_retencionE.Text + "." + Txt_retencionD.Text);
                if (txt_importeE.Text == "") txt_importeE.Text = "0";
                oRecibo.PagoInformado.importe = new Dinero();
                oRecibo.PagoInformado.importe.Valor = decimal.Parse(txt_importeE.Text + "." + txt_importeD.Text);
                oRecibo.PagoInformado.bancoId = 0;
                tipoPago = new tipoPagos();

                if (oRecibo.conRetenciones > 0)
                {
                    oRecibo.Importe = oRecibo.Importe + oRecibo.conRetenciones;
                    oRecibo.PagoInformado.importe.Valor = oRecibo.PagoInformado.importe.Valor + oRecibo.conRetenciones;
                }

                switch (MultiView2.ActiveViewIndex)
                {
                    case 0:
                        ((ValidationSummary) EbuyPopup1.FindControl("ValidationSummary1")).ValidationGroup = "transferencia";
                        Page.Validate("transferencia");
                        if (Page.IsValid)
                        {
                            oRecibo.PagoInformado.datosTransferencia.bancoIdDestino = BancoEbp.SelectedValue;
                            oRecibo.PagoInformado.datosTransferencia.bancoIDDesde = bancoTrans.SelectedValue;
                            oRecibo.PagoInformado.transaccion = txt_transaccion.Text;
                            tipoPago.idTipoPago = 3;
                            //oRecibo.PagoInformado.datosCheque.fechaDiferida = DateTime.Now;
                            tipoPago.descripcion = "Transferencia";

                        }
                        else
                        {
                             ((Label) EbuyPopup1.FindControl("lbl_error")).Text  = "ERROR";

                            this.Panel2_ModalPopupExtender.Show();
                            return null;
                        }

                        break;
                    case 1:
                        ((ValidationSummary) EbuyPopup1.FindControl("ValidationSummary1")).ValidationGroup = "deposito";
                         Page.Validate("deposito");
                        if (Page.IsValid)
                        {
                           /* if (DepositoEfectivoCheque.SelectedValue == "1")
                            {
                                oRecibo.PagoInformado.datosEfectivo =

                            }*/

                            if (DepositoEfectivoCheque.SelectedValue == "2")
                            {
                                Banco b = new Banco();
                                b.bank_id = bancoEbpDeposito.SelectedValue;
                                oRecibo.PagoInformado.datosCheque.BancoDestino = b;

                                oRecibo.PagoInformado.datosCheque.nroCheque = "";
                               // oRecibo.PagoInformado.bancoId = int.Parse(DepositoBancoCheque1.SelectedValue);
                                oRecibo.PagoInformado.datosCheque.sucursal = sucursalDeposito.Text;
                            //    if (FechaDiferidaDeposito.Text != "")
                                oRecibo.PagoInformado.datosCheque.fechaDiferida = Convert.ToDateTime(DateTime.Now);
                                tipoPago.idTipoPago = 2;
                                tipoPago.descripcion = "Cheque";
                            }
                            else
                            {
                                Banco b = new Banco();
                                b.bank_id = bancoEbpDeposito.SelectedValue;
                                b.Sucursal = sucursalDeposito.Text;
                                oRecibo.PagoInformado.datosEfectivo.Banco = b;
                                oRecibo.PagoInformado.bancoId = Convert.ToInt32(b.bank_id);

                                tipoPago.idTipoPago = 1;
                                tipoPago.descripcion = "Efectivo";
                            }
                        }
                        else
                        {
                            this.Panel2_ModalPopupExtender.Show();
                            return null;
                        }
                        break;
                    case 2:
                        ((ValidationSummary) EbuyPopup1.FindControl("ValidationSummary1")).ValidationGroup = "pagador";
                        Page.Validate("pagador");
                         if (Page.IsValid)
                         {
                             /*Banco b = new Banco();

                                 b.bank_id = BancoChequePagador.SelectedValue;
                                 if (FechaDiferidaPagador.Text != "")
                                     oRecibo.PagoInformado.datosCheque.fechaDiferida = Convert.ToDateTime(FechaDiferidaPagador.Text);
                                 else
                                     oRecibo.PagoInformado.datosCheque.fechaDiferida = DateTime.Now;
                                 oRecibo.PagoInformado.datosCheque.nroCheque = "";
                                 oRecibo.PagoInformado.datosCheque.sucursal = sucursalPagador.Text;

                                 oRecibo.PagoInformado.datosCheque.BancoDestino = b;
                                 oRecibo.PagoInformado.bancoId = Convert.ToInt32(b.bank_id);

                                 tipoPago.idTipoPago = 2;
                                 tipoPago.descripcion = "Cheque";

                             */
                            // oRecibo.PagoInformado.datosCheque.bancoIdDestino = ddl_BcoDestinoT.SelectedValue;
                         }
                         else
                         {
                             this.Panel2_ModalPopupExtender.Show();
                             return null;
                         }
                            break;
                    case 3:
                            ((ValidationSummary) EbuyPopup1.FindControl("ValidationSummary1")).ValidationGroup = "correspondencia";
                            Page.Validate("correspondencia");
                            if (Page.IsValid)
                            {
                               /* if (CorrespondenciaEfectivoCheque.SelectedValue == "1")
                                {
                                    oRecibo.PagoInformado.datosEfectivo.
                                }*/
                                //ModoEnvioCorrespondencia
                                 // oRecibo.PagoInformado.
                                //if (CorrespondenciaEfectivoCheque.SelectedValue == "2")
                               // {
                                    oRecibo.PagoInformado.datosCheque.BancoDestino = new Banco();
                                    oRecibo.PagoInformado.datosCheque.BancoDestino.bank_id = CorrespondenciaBanco1.Text;
                                    oRecibo.PagoInformado.datosCheque.nroCheque = CorrespondenciaCheque1.Text;
                                    oRecibo.PagoInformado.datosCheque.sucursal = "";
                                    tipoPago.idTipoPago = 2;
                                    tipoPago.descripcion = "Cheque";
                                    if (FechaDiferidaCorrespondencia.Text != "")
                                        oRecibo.PagoInformado.datosCheque.fechaDiferida = Convert.ToDateTime(FechaDiferidaCorrespondencia.Text);
                                    else
                                        oRecibo.PagoInformado.datosCheque.fechaDiferida = DateTime.Now;
                               // }
                            }
                            else
                            {
                                this.Panel2_ModalPopupExtender.Show();
                                return null;
                            }
                            break;
                    case 4:
                            ((ValidationSummary) EbuyPopup1.FindControl("ValidationSummary1")).ValidationGroup = "oficinas";
                            Page.Validate("oficinas");
                            if (Page.IsValid)
                            {

                                if (OficinaEfectivoCheque.SelectedValue == "1")
                                {
                                    tipoPago.idTipoPago = 1;
                                    tipoPago.descripcion = "Efectivo";

                                }

                                if (OficinaEfectivoCheque.SelectedValue == "2")
                                {
                                    Banco b = new Banco();
                                    b.bank_id = BancoOficina1.Text;
                                    oRecibo.PagoInformado.datosCheque.BancoDestino = b;
                                    oRecibo.PagoInformado.datosCheque.nroCheque = BancoOficinaCheque1.Text;
                                    oRecibo.PagoInformado.datosCheque.sucursal = "";
                                    tipoPago.idTipoPago = 2;
                                    tipoPago.descripcion = "Cheque";
                                    if (FechaDiferidaOficina.Text != "")
                                        oRecibo.PagoInformado.datosCheque.fechaDiferida = Convert.ToDateTime(FechaDiferidaOficina.Text);
                                    else
                                        oRecibo.PagoInformado.datosCheque.fechaDiferida = DateTime.Now;
                                }
                            }
                            else
                            {
                                this.Panel2_ModalPopupExtender.Show();
                                return null;
                            }
                            break;
                    case 5:
                           ((ValidationSummary)EbuyPopup1.FindControl("ValidationSummary1")).ValidationGroup = "pagopendiente";
                           Page.Validate("pagopendiente");
                           if (Page.IsValid)
                           {

                              oRecibo.Rec_Docid = -1;

                           }
                           else
                           {
                               this.Panel2_ModalPopupExtender.Show();
                               return null;
                           }
                           break;
                    case 6:
                            ((ValidationSummary)EbuyPopup1.FindControl("ValidationSummary1")).ValidationGroup = "pagopendiente";
                           Page.Validate("pagopendiente");
                           if (Page.IsValid)
                           {
                               oRecibo.Rec_Docid = Convert.ToDecimal(ReciboPagoAutomatico.Value);

                           }
                           else
                           {
                               this.Panel2_ModalPopupExtender.Show();
                               return null;
                           }
                           break;

                }
                return oRecibo;
            }
            else
            {
                this.Panel2_ModalPopupExtender.Show();
                return null;
            }
        }
Ejemplo n.º 3
0
        public List<tipoPagos> gettipoPagos()
        {
            SqlParameter[] param = new SqlParameter[1];
            tipoPagos item = new tipoPagos();
            param[0] = new SqlParameter("@idioma", EbuySession.Idioma);
            List<tipoPagos> lista= new List<tipoPagos>();

            datosSQL.ConGenerico = false;
            datosSQL.Parametros = param;
            datosSQL.Stored = "FEBUY_tiposPago";
            lector = ebSQL.ExecuteSPReader(datosSQL);
            while (lector.Read())
            {
                lista.Add(item.castDR(lector));
            }

            lector.Close();
            //EbuySqlFact.ExecuteSP(out lista, "FEBUY_tiposPago", param, false);
            return lista;
        }