예제 #1
0
        public List <SubVentaCheque> BuscoChequesEnVenta(int intCodigo)
        {
            string                strSql;
            SubVentaCheque        objSubVentaCheque;
            List <SubVentaCheque> listChequesEnVenta = new List <SubVentaCheque>();

            strSql  = "select id,chequeabona, chequebanco,chequenumero,chequevenc ";
            strSql += " from dbo.Cheques_Detalle where facturaid = " + intCodigo;

            LlenaCombos objLlenaCombos2 = new LlenaCombos();
            DataTable   dt2             = objLlenaCombos2.GetSqlDataAdapterbySql(strSql);

            if (dt2 != null)
            {
                for (int i = 0; i < dt2.Rows.Count; i++)
                {
                    objSubVentaCheque                    = new SubVentaCheque();
                    objSubVentaCheque.IntCodigo          = Convert.ToInt32(dt2.Rows[i]["id"].ToString());
                    objSubVentaCheque.DoAbona            = Convert.ToDecimal(dt2.Rows[i]["chequeabona"].ToString());
                    objSubVentaCheque.StrBanco           = dt2.Rows[i]["chequebanco"].ToString();
                    objSubVentaCheque.StrNumero          = dt2.Rows[i]["chequenumero"].ToString();
                    objSubVentaCheque.DtFechaVencimiento = Convert.ToDateTime(dt2.Rows[i]["chequevenc"].ToString());
                    listChequesEnVenta.Add(objSubVentaCheque);
                }
            }
            return(listChequesEnVenta);
        }
예제 #2
0
        public void ModificarCheques(SubVentaCheque objCheques)
        {
            ManejaConexiones oManejaConexiones = new ManejaConexiones();

            SqlParameter[] spParam = new SqlParameter[6];

            spParam[0]       = new SqlParameter("@codigo", SqlDbType.BigInt);
            spParam[0].Value = objCheques.IntCodigo;

            spParam[1]       = new SqlParameter("@chequeabona", SqlDbType.Decimal);
            spParam[1].Value = objCheques.DoAbona;

            spParam[2]       = new SqlParameter("@chequebanco", SqlDbType.NVarChar);
            spParam[2].Value = objCheques.StrBanco;

            spParam[3]       = new SqlParameter("@chequenumero", SqlDbType.NVarChar);
            spParam[3].Value = objCheques.StrNumero;

            spParam[4]       = new SqlParameter("@chequevenc", SqlDbType.DateTime);
            spParam[4].Value = objCheques.DtFechaVencimiento;


            oManejaConexiones.NombreStoredProcedure = "Upd_Cheque_Detalle";
            oManejaConexiones.Parametros            = spParam;
            oManejaConexiones.executeNonQuery();
        }
예제 #3
0
        public int GrabarCheques(SubVentaCheque objCheques, Int32 intFactura)
        {
            ManejaConexiones oManejaConexiones = new ManejaConexiones();

            SqlParameter[] spParam = new SqlParameter[6];

            spParam[0]       = new SqlParameter("@facturaid", SqlDbType.Int);
            spParam[0].Value = intFactura;

            spParam[1]       = new SqlParameter("@chequeabona", SqlDbType.Decimal);
            spParam[1].Value = objCheques.DoAbona;

            spParam[2]       = new SqlParameter("@chequebanco", SqlDbType.NVarChar);
            spParam[2].Value = objCheques.StrBanco;

            spParam[3]       = new SqlParameter("@chequenumero", SqlDbType.NVarChar);
            spParam[3].Value = objCheques.StrNumero;

            spParam[4]       = new SqlParameter("@chequevenc", SqlDbType.DateTime);
            spParam[4].Value = objCheques.DtFechaVencimiento;


            spParam[5]           = new SqlParameter("@codigo", SqlDbType.BigInt);
            spParam[5].Direction = ParameterDirection.Output;


            oManejaConexiones.NombreStoredProcedure = "Add_Cheque_Detalle";
            oManejaConexiones.Parametros            = spParam;
            oManejaConexiones.executeNonQuery();

            return(Convert.ToInt32(spParam[5].Value));
        }
예제 #4
0
        private void btnQuitarCheque_Click(object sender, EventArgs e)
        {
            if (this.objVentas.ListSubVentaCheque.ElementAt(objSubVentaCheque.IntIndex).IntCodigo > 0)
            {
                objVentas.ListChequesBorrados.Add(this.objVentas.ListSubVentaCheque.ElementAt(objSubVentaCheque.IntIndex));
            }


            //Luego lo borro de la lista y al momento de grabar lo borro de todos lados
            this.objVentas.ListSubVentaCheque.RemoveAt(objSubVentaCheque.IntIndex);
            grillaCheques.Rows.RemoveAt(objSubVentaCheque.IntIndex);
            btnQuitarCheque.Enabled = false;
            tabControl1_Leave(null, null);
            LimpiarCheque();
            objSubVentaCheque = null;
        }
예제 #5
0
        private void btnAgregarCheque_Click(object sender, EventArgs e)
        {
            if (!ValidoCheque())
            {
                return;
            }

            //Lo primero que debo hacer es guardar el objeto articulo en la lista
            if (objSubVentaCheque == null)
            {
                objSubVentaCheque = new SubVentaCheque();

                objSubVentaCheque.DoAbona            = Redondeo(Convert.ToDecimal(txtChequeAbona.Text));
                objSubVentaCheque.DtFechaVencimiento = Convert.ToDateTime(dtpFechaVencimiento.Text);
                objSubVentaCheque.StrBanco           = cboChequeBanco.Text;
                objSubVentaCheque.StrNumero          = txtChequeNumero.Text;

                //Actualizo la lista o lo agrego

                this.objVentas.ListSubVentaCheque.Add(objSubVentaCheque);
            }
            else
            {
                objSubVentaCheque.DoAbona            = Redondeo(Convert.ToDecimal(txtChequeAbona.Text));
                objSubVentaCheque.DtFechaVencimiento = Convert.ToDateTime(dtpFechaVencimiento.Text);
                objSubVentaCheque.StrBanco           = cboChequeBanco.Text;
                objSubVentaCheque.StrNumero          = txtChequeNumero.Text;

                this.objVentas.ListSubVentaCheque.ElementAt(objSubVentaCheque.IntIndex).DoAbona            = objSubVentaCheque.DoAbona;
                this.objVentas.ListSubVentaCheque.ElementAt(objSubVentaCheque.IntIndex).StrBanco           = objSubVentaCheque.StrBanco;
                this.objVentas.ListSubVentaCheque.ElementAt(objSubVentaCheque.IntIndex).StrNumero          = objSubVentaCheque.StrNumero;
                this.objVentas.ListSubVentaCheque.ElementAt(objSubVentaCheque.IntIndex).DtFechaVencimiento = objSubVentaCheque.DtFechaVencimiento;
            }

            CargoGrillaCheque();


            CargoGrillaTarjeta();

            LimpiarCheque();
            objSubVentaCheque = null;

            tabControl1_Leave(null, null);
        }
예제 #6
0
        private void grillaCheques_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (objVentas.StrEstado == "PENDIENTE" || string.IsNullOrEmpty(objVentas.StrEstado))
            {
                objSubVentaCheque = new SubVentaCheque();

                txtChequeAbona.Text       = Convert.ToString(grillaCheques.Rows[grillaCheques.CurrentRow.Index].Cells[0].Value.ToString());
                cboChequeBanco.Text       = Convert.ToString(grillaCheques.Rows[grillaCheques.CurrentRow.Index].Cells[1].Value.ToString());
                txtChequeNumero.Text      = Convert.ToString(grillaCheques.Rows[grillaCheques.CurrentRow.Index].Cells[2].Value.ToString());
                dtpFechaVencimiento.Value = Convert.ToDateTime(grillaCheques.Rows[grillaCheques.CurrentRow.Index].Cells[3].Value.ToString());

                //Aca deberia habilitar el boton de borrado
                btnQuitarCheque.Enabled  = true;
                btnAgregarCheque.Enabled = true;

                objSubVentaCheque.DoAbona            = Redondeo(Convert.ToDecimal(txtChequeAbona.Text));
                objSubVentaCheque.StrBanco           = cboChequeBanco.Text;
                objSubVentaCheque.StrNumero          = txtChequeNumero.Text;
                objSubVentaCheque.DtFechaVencimiento = dtpFechaVencimiento.Value;

                objSubVentaCheque.IntIndex = Convert.ToInt32(grillaCheques.CurrentRow.Index);
            }
        }