예제 #1
0
        public bool ActualizarTicketPagoGeneral(HistorialPagos historialPagos)
        {
            bool Resultado = false;

            SqlCommand comando = new SqlCommand();

            try
            {
                comando.CommandType = System.Data.CommandType.StoredProcedure;
                comando.CommandText = "sp_TicketsActualizarGeneral";

                //====================HISTORIALPAGOS=======================================

                comando.Parameters.Add("@UidHistorialPago", SqlDbType.UniqueIdentifier);
                comando.Parameters["@UidHistorialPago"].Value = historialPagos.UidHistorialPago;

                comando.Parameters.Add("@DcmSaldo", SqlDbType.Decimal);
                comando.Parameters["@DcmSaldo"].Value = historialPagos.DcmSaldo;

                comando.Parameters.Add("@DcmOperacion", SqlDbType.Decimal);
                comando.Parameters["@DcmOperacion"].Value = historialPagos.DcmOperacion;

                comando.Parameters.Add("@DcmNuevoSaldo", SqlDbType.Decimal);
                comando.Parameters["@DcmNuevoSaldo"].Value = historialPagos.DcmNuevoSaldo;

                Resultado = this.ManipulacionDeDatos(comando);
            }
            catch (Exception)
            {
                throw;
            }
            return(Resultado);
        }
예제 #2
0
        public bool RegistrarHistorialPago(HistorialPagos historialPagos)
        {
            bool Resultado = false;

            SqlCommand comando = new SqlCommand();

            try
            {
                comando.CommandType = System.Data.CommandType.StoredProcedure;
                comando.CommandText = "sp_HistorialPagosRegistrar";

                comando.Parameters.Add("@DcmSaldo", SqlDbType.Decimal);
                comando.Parameters["@DcmSaldo"].Value = historialPagos.DcmSaldo;

                comando.Parameters.Add("@DcmOperacion", SqlDbType.Decimal);
                comando.Parameters["@DcmOperacion"].Value = historialPagos.DcmOperacion;

                comando.Parameters.Add("@DcmNuevoSaldo", SqlDbType.Decimal);
                comando.Parameters["@DcmNuevoSaldo"].Value = historialPagos.DcmNuevoSaldo;

                comando.Parameters.Add("@IdReferencia", SqlDbType.VarChar);
                comando.Parameters["@IdReferencia"].Value = historialPagos.IdReferencia;

                Resultado = this.ManipulacionDeDatos(comando);
            }
            catch (Exception)
            {
                throw;
            }
            return(Resultado);
        }
예제 #3
0
        private void btnHistorialPagos_Click(object sender, EventArgs e)
        {
            if (lblNombre.Text == "Cliente X")
            {
                return;
            }

            HistorialPagos PagosCreditosForm = new HistorialPagos(codCliente, lblNombre.Text);

            PagosCreditosForm.ShowDialog();
        }
예제 #4
0
        public void ObtenerHistorialPago(Guid UidCliente)
        {
            historialPagos = new HistorialPagos();

            SqlCommand query = new SqlCommand();

            query.CommandType = CommandType.Text;

            query.CommandText = "select cc.* from Usuarios us, ClienteCuenta cc, AuxiliarPago ap where ap.IdReferencia IS NULL and us.UidUsuario = cc.UidUsuario and cc.UidClienteCuenta = ap.UidClienteCuenta and cc.UidUsuario = '" + UidCliente + "'";

            DataTable dt = this.Busquedas(query);

            foreach (DataRow item in dt.Rows)
            {
                historialPagos.UidHistorialPago = Guid.Parse(item["UidHistorialPago"].ToString());
                historialPagos.DcmSaldo         = decimal.Parse(item["DcmSaldo"].ToString());
                historialPagos.DcmOperacion     = decimal.Parse(item["DcmOperacion"].ToString());
                historialPagos.DcmNuevoSaldo    = decimal.Parse(item["DcmNuevoSaldo"].ToString());
                historialPagos.IdReferencia     = item["IdReferencia"].ToString();
            }
        }
예제 #5
0
        private void DGClientes_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            HistorialPagos PagosCreditosForm = new HistorialPagos(codCliente, lblNombre.Text);

            PagosCreditosForm.ShowDialog();
        }
예제 #6
0
        public bool Autorizacion(int idperiodo)
        {
            var            result    = false;
            HistorialPagos historial = new HistorialPagos();

            try
            {
                var nomina = ctx.NOM_Nomina.Where(x => x.IdPeriodo == idperiodo).ToList();
                foreach (var n in nomina)
                {
                    var detNom = ctx.NOM_Nomina_Detalle.Where(x => x.IdNomina == n.IdNomina).ToList();
                    foreach (var d in detNom)
                    {
                        using (var Transaction = ctx.Database.BeginTransaction())
                        {
                            try
                            {
                                if (d.IdConcepto == 51)
                                {
                                    historial.IdPrestamo        = d.IdPrestamo;
                                    historial.IdNomina          = n.IdNomina;
                                    historial.CantidadDescuento = d.Total;
                                    historial.FechaRegistro     = DateTime.Now;
                                    historial.TipoPrestamo      = 3;
                                    historial.Salario           = n.SDI;
                                    historial.DiasDescontados   = n.Dias_Laborados;
                                    ctx.HistorialPagos.Add(historial);
                                    //   var guardar = ctx.SaveChanges();
                                }

                                else
                                if (d.IdConcepto == 52)
                                {
                                    historial.IdPrestamo        = d.IdPrestamo;
                                    historial.IdNomina          = n.IdNomina;
                                    historial.CantidadDescuento = d.Total;
                                    historial.FechaRegistro     = DateTime.Now;
                                    historial.TipoPrestamo      = 2;
                                    historial.Salario           = n.SDI;
                                    historial.DiasDescontados   = n.Dias_Laborados;
                                    ctx.HistorialPagos.Add(historial);


                                    var descuento = ctx.Empleado_Fonacot.FirstOrDefault(x => x.Id == d.IdPrestamo);

                                    decimal total = 0;
                                    total = descuento.Saldo - d.Total;

                                    descuento.Saldo = total;
                                    var guardarDescuento = ctx.SaveChanges();
                                }

                                var guardar = ctx.SaveChanges();


                                Transaction.Commit();
                            }
                            catch (Exception e)
                            {
                                Transaction.Rollback();
                            }
                        }
                    }
                }

                var item = ctx.NOM_PeriodosPago.FirstOrDefault(x => x.IdPeriodoPago == idperiodo);



                item.Autorizado        = true;
                item.FechaAutorizacion = DateTime.Now;
                item.UsuarioAutorizo   = SessionHelpers.GetIdUsuario();
                var r2 = ctx.SaveChanges();

                result = true;

                return(result);
            }
            catch (Exception e)
            {
                return(result);
            }
        }
예제 #7
0
        public bool RegistrarTicketPago(Tickets tickets, HistorialPagos historialPagos)
        {
            bool Resultado = false;

            SqlCommand comando = new SqlCommand();

            try
            {
                comando.CommandType = System.Data.CommandType.StoredProcedure;
                comando.CommandText = "sp_TicketsRegistrar";

                comando.Parameters.Add("@VchFolio", SqlDbType.VarChar, 100);
                comando.Parameters["@VchFolio"].Value = tickets.VchFolio;

                comando.Parameters.Add("@DcmImporte", SqlDbType.Decimal);
                comando.Parameters["@DcmImporte"].Value = tickets.DcmImporte;

                comando.Parameters.Add("@DcmDescuento", SqlDbType.Decimal);
                comando.Parameters["@DcmDescuento"].Value = tickets.DcmDescuento;

                comando.Parameters.Add("@DcmTotal", SqlDbType.Decimal);
                comando.Parameters["@DcmTotal"].Value = tickets.DcmTotal;

                comando.Parameters.Add("@VchDescripcion", SqlDbType.VarChar, 50);
                comando.Parameters["@VchDescripcion"].Value = tickets.VchDescripcion;

                comando.Parameters.Add("@UidPropietario", SqlDbType.UniqueIdentifier);
                comando.Parameters["@UidPropietario"].Value = tickets.UidPropietario;

                comando.Parameters.Add("@DtRegistro", SqlDbType.DateTime);
                comando.Parameters["@DtRegistro"].Value = tickets.DtRegistro;

                comando.Parameters.Add("@UidHistorialPago", SqlDbType.UniqueIdentifier);
                comando.Parameters["@UidHistorialPago"].Value = tickets.UidHistorialPago;

                comando.Parameters.Add("@IntWA", SqlDbType.Int);
                comando.Parameters["@IntWA"].Value = tickets.IntWA;

                comando.Parameters.Add("@IntSMS", SqlDbType.Int);
                comando.Parameters["@IntSMS"].Value = tickets.IntSMS;

                comando.Parameters.Add("@IntCorreo", SqlDbType.Int);
                comando.Parameters["@IntCorreo"].Value = tickets.IntCorreo;

                //====================HISTORIALPAGOS=======================================

                comando.Parameters.Add("@DcmSaldo", SqlDbType.Decimal);
                comando.Parameters["@DcmSaldo"].Value = historialPagos.DcmSaldo;

                comando.Parameters.Add("@DcmOperacion", SqlDbType.Decimal);
                comando.Parameters["@DcmOperacion"].Value = historialPagos.DcmOperacion;

                comando.Parameters.Add("@DcmNuevoSaldo", SqlDbType.Decimal);
                comando.Parameters["@DcmNuevoSaldo"].Value = historialPagos.DcmNuevoSaldo;

                Resultado = this.ManipulacionDeDatos(comando);
            }
            catch (Exception)
            {
                throw;
            }
            return(Resultado);
        }