Ejemplo n.º 1
0
        //-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        public void Borrar(FacturasCuotasDetalle FacturasCuotasDetalle, bool Tran = false)
        {
            object[] ObjParameter = new object[1];
            ObjParameter[0] = FacturasCuotasDetalle.IdDetalle;
            try
            {
                this.InicializarMensajeError();
                this.OpenSqlBD();

                SqlCommand cmd = new SqlCommand();
                cmd = this.ConfigurarComando(TieneTransaccion.Si, "sp_del_FacturasCuotasDetalle", ObjParameter);
                cmd.ExecuteNonQuery();

                if (Tran == false)
                {
                    Commit();
                }
            }
            catch (Exception ex)
            {
                this.CodigoError = -1;
                if (Tran == false)
                {
                    Rollback();
                }
                fn.XtraMsg(ex.Message, MessageBoxIcon.Error);
            }
            finally
            {
                if (Tran == false)
                {
                    CloseSqlBD();
                }
            }
        }
Ejemplo n.º 2
0
        //-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        public void Actualizar(FacturasCuotasDetalle FacturasCuotasDetalle, bool Tran = false)
        {
            object[] ObjParameter = new object[8];
            ObjParameter[0] = FacturasCuotasDetalle.IdDetalle;
            ObjParameter[1] = FacturasCuotasDetalle.Id;
            ObjParameter[2] = FacturasCuotasDetalle.Empresa;
            ObjParameter[3] = FacturasCuotasDetalle.Numero;
            ObjParameter[4] = FacturasCuotasDetalle.FechaPago;
            ObjParameter[5] = FacturasCuotasDetalle.Vencimiento;
            ObjParameter[6] = FacturasCuotasDetalle.Cuota;
            ObjParameter[7] = FacturasCuotasDetalle.Interes;

            try
            {
                this.InicializarMensajeError();
                this.OpenSqlBD();

                SqlCommand cmd = new SqlCommand();
                cmd = this.ConfigurarComando(TieneTransaccion.Si, "sp_upd_FacturasCuotasDetalle", ObjParameter);
                cmd.ExecuteNonQuery();

                if (Tran == false)
                {
                    Commit();
                }
            }
            catch (Exception ex)
            {
                this.CodigoError = -1;
                if (Tran == false)
                {
                    Rollback();
                }
                fn.XtraMsg(ex.Message, MessageBoxIcon.Error);
            }
            finally
            {
                if (Tran == false)
                {
                    CloseSqlBD();
                }
            }
        }
Ejemplo n.º 3
0
        //-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
        public FacturasCuotasDetalle Detalles(int Id, int Empresa)
        {
            DataTable             dt  = fn.ObtieneDatos("sp_sel_FacturasCuotasDetalle", Id, 0, Empresa);
            FacturasCuotasDetalle det = new FacturasCuotasDetalle();

            if (dt.Rows.Count > 0)
            {
                det.IdDetalle   = (int)dt.Rows[0]["IdDetalle"];
                det.Id          = (int)dt.Rows[0]["Id"];
                det.Empresa     = (int)dt.Rows[0]["Empresa"];
                det.Numero      = (int)dt.Rows[0]["Numero"];
                det.FechaPago   = dt.Rows[0]["FechaPago"].ToString();
                det.Vencimiento = dt.Rows[0]["Vencimiento"].ToString();
                det.Cuota       = Convert.ToDouble(dt.Rows[0]["Cuota"]);
                det.Interes     = Convert.ToDouble(dt.Rows[0]["Interes"]);
                det.Comp_No     = (int)dt.Rows[0]["Comp_No"];
                det.Per_Id      = (int)dt.Rows[0]["Per_Id"];
                det.Mes         = (int)dt.Rows[0]["Mes"];
                det.Aplicada    = (bool)dt.Rows[0]["Aplicada"] ? 1 : 0;
            }
            return(det);
        }