コード例 #1
0
        private void btnConfirmar_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                if (dgvLote.RowCount > 0)
                {
                    dialogResult = MessageBox.Show("Seguro de confirmar: " + dgvLote.CurrentRow.Cells["IdLote"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (dialogResult == DialogResult.Yes)
                    {
                        LoteBE LoteBE = new LoteBE()
                        {
                            OPCION  = 22,
                            USUARIO = General.General.GetUsuario,
                            IdLote  = dgvLote.CurrentRow.Cells["IdLote"].Value.ToString(),
                        };
                        new LoteBL().ProcesarLote(LoteBE);
                        MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        btnBuscar.PerformClick();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #2
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (Convert.ToDecimal(txtDesembolso.Text) < 0)
                {
                    MessageBox.Show("No se puede liquidar, verificar el desembolso", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                if (!ValidarDatos())
                {
                    return;
                }

                GrabarDatos();

                // Se genera la liquidacion temporal
                LoteBE IEntity = new LoteBE()
                {
                    OPCION   = 19,
                    USUARIO  = General.General.GetCodigoUsuario,
                    gFechaOp = General.General.gFechaOp,
                    IdLote   = txtIdLote.Text.Trim(),
                };
                new LoteBL().ProcesarLote(IEntity);
                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private void btnEnviarAprobacion_Click(object sender, EventArgs e)
        {
            try
            {
                //if (Convert.ToDecimal(txtDesembolso.Text) == 0)
                //{
                //    MessageBox.Show("No se puede enviar aprobación, verificar el desembolso", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                //    return;
                //}

                if (!ValidarDatos())
                {
                    return;
                }

                GrabarDatos();

                LoteBE oLoteBE = new LoteBE()
                {
                    OPCION      = 5,
                    USUARIO     = General.General.GetCodigoUsuario,
                    gFechaOp    = General.General.gFechaOp,
                    IdLote      = _IdLote,
                    IdEstado_tt = "00059", //Enviado a Aprobación
                };
                LoteBL.ProcesarLote(oLoteBE);
                _IdEstado_tt = "00059"; //Enviado a Aprobación
                MessageBox.Show("Se envió el lote a aprobación", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Dispose();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #4
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet ds     = new DataSet();
                LoteBE  LoteBE = new LoteBE()
                {
                    OPCION       = 9,
                    USUARIO      = General.General.GetUsuario,
                    IdEstado_tt  = cboIdEstado_tt.SelectedValue.ToString(), // Enviado a Aprobación
                    sdDesembolso = dtFechaRegistro.Value
                };

                ds = LoteBL.ProcesarLote(LoteBE);
                dgvLote.DataSource = ds.Tables[0];
                lblRegistros.Text  = ds.Tables[0].Rows.Count.ToString() + " registro(s)";

                foreach (DataGridViewRow row in dgvLote.Rows)
                {
                    if (row.Cells["IdEstado_tt"].Value.Equals("00077")) // Aprobado
                    {
                        row.DefaultCellStyle.ForeColor = Color.FromName(General.General.GetColorLoteAprobado);
                    }
                    else
                    {
                        row.DefaultCellStyle.ForeColor = Color.FromName(General.General.GetColorLotePorAprobar);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #5
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet ds     = new DataSet();
                LoteBE  LoteBE = new LoteBE()
                {
                    OPCION       = 21,
                    USUARIO      = General.General.GetUsuario,
                    IdSocio_Dsc  = TextBoxX1.Text.Trim(),
                    sdDesembolso = dtDesembolsoInicio.Value,
                    sdAprobacion = dtDesembolsoFin.Value,
                    FlgConfimado = rbtnTodos.Checked? "1" : string.Empty,
                    FlgEntregado = rbtnEntregado.Checked ? "1" : string.Empty,
                    FlgPendiente = rbtnPendiente.Checked ? "1" : string.Empty,
                };

                ds = new LoteBL().ProcesarLote(LoteBE);
                dgvLote.DataSource = ds.Tables[0];
                lblRegistros.Text  = ds.Tables[0].Rows.Count.ToString() + " registro(s)";

                this.dgvLote.Columns["IdFormaDesembolso_tt_Dsc"].Width = 45;
                this.dgvLote.Columns["sdDesembolso"].Width             = 80;
                FormatoGrid();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #6
0
        private void btnEntregar_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                List <LoteBE> LstLote = new List <LoteBE>();
                if (dgvLote.RowCount > 0)
                {
                    foreach (DataGridViewRow row in dgvLote.Rows)
                    {
                        DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["CheckSel"];
                        if (chk.Value.ToString() == "1")
                        {
                            LoteBE IEntity = new LoteBE()
                            {
                                OPCION  = 25,
                                USUARIO = General.General.GetUsuario,
                                IdLote  = row.Cells["IdLote"].Value.ToString(),
                                cItem   = row.Cells["cItem"].Value.ToString(),
                            };
                            LstLote.Add(IEntity);
                        }
                    }

                    if (LstLote.Count == 0)
                    {
                        MessageBox.Show("Debe seleccionar al menos un registro para el envío de confirmación.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        return;
                    }

                    List <string> LstLoteDistinct = LstLote.Select(x => x.IdLote).Distinct().ToList();
                    List <LoteBE> LstLoteEnvio    = new List <LoteBE>();

                    foreach (string item in LstLoteDistinct)
                    {
                        LoteBE IEntity = new LoteBE()
                        {
                            OPCION  = 25,
                            USUARIO = General.General.GetUsuario,
                            IdLote  = item
                        };
                        LstLoteEnvio.Add(IEntity);
                    }

                    dialogResult = MessageBox.Show("¿Seguro de enviar la confirmación de los registros seleccionados?", "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (dialogResult == DialogResult.Yes)
                    {
                        string strResult = string.Empty;
                        strResult = new LoteBL().ProcesarLoteEnvioConfirmacion(LstLoteEnvio);
                        MessageBox.Show(strResult, "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        btnBuscar.PerformClick();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #7
0
ファイル: Form1.cs プロジェクト: rolandolarosa/prototipofac
        private void GenerarPDF()
        {
            string idloteerror = string.Empty;

            try
            {
                LoteBE oEntity = new LoteBE();
                oEntity.OPCION  = 31;
                oEntity.USUARIO = "Ejecutable";
                DataSet ds = new DataSet();
                ds = new LoteBL().ProcesarLote(oEntity);


                if (ds.Tables.Count > 0)
                {
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        DataSet dsLotes = new DataSet();
                        using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                        {
                            SqlCommand cmd1 = new SqlCommand("Rpt_Lote_Cab", con);
                            cmd1.CommandType = CommandType.StoredProcedure;
                            cmd1.Parameters.AddWithValue("@IdLote", dr["IdLote"].ToString());
                            SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                            daCab.Fill(dsLotes, "Rpt_Lote_Cab");

                            SqlCommand cmd2 = new SqlCommand("Rpt_Lote_Det", con);
                            cmd2.CommandType = CommandType.StoredProcedure;
                            cmd2.Parameters.AddWithValue("@IdLote", dr["IdLote"].ToString());
                            SqlDataAdapter daDet = new SqlDataAdapter(cmd2);
                            daDet.Fill(dsLotes, "Rpt_Lote_Det");

                            con.Close();
                        }

                        EfideFactoring.Formula.Crystal.crRegLiquidacion ocrLoteLiquidacion = new EfideFactoring.Formula.Crystal.crRegLiquidacion();
                        ocrLoteLiquidacion.SetDataSource(dsLotes);
                        ocrLoteLiquidacion.SetParameterValue("usuario", dr["Usuario"].ToString().Trim()); //General.General.GetUsuario);
                        ocrLoteLiquidacion.SetParameterValue("moneda", dsLotes.Tables[0].Rows[0]["IdMoneda_Dsc"].ToString());
                        idloteerror = dr["IdLote"].ToString().Trim();
                        ocrLoteLiquidacion.ExportToDisk(ExportFormatType.PortableDocFormat, ConfigurationManager.AppSettings["RutaArchivoLiquidacionLote"].ToString() + dr["IdLote"].ToString().Trim() + ".pdf");

                        LoteBE oEntity1 = new LoteBE();
                        oEntity1.OPCION  = 32;
                        oEntity1.USUARIO = "Ejecutable";
                        oEntity1.IdLote  = dr["IdLote"].ToString().Trim();
                        new LoteBL().ProcesarLote(oEntity1);
                    }
                }
            }
            catch (Exception ex)
            {
                //MessageBox.Show(idloteerror);
                //MessageBox.Show(ex.Message);
                throw ex;
            }
        }
コード例 #8
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                if (Fase.Equals("1"))
                {
                    nopc = 28;
                }
                else
                {
                    nopc = 1;
                }

                if (!string.IsNullOrEmpty(_IdFinanciera_Dsc))
                {
                    lblFinanciera.Text  = _IdFinanciera_Dsc.Trim() + " - " + _IdMoneda_tt_Dsc.Trim();
                    btnNuevo.Visible    = false;
                    btnEditar.Visible   = false;
                    btnEliminar.Visible = false;
                    nopc = 33;
                }

                DataSet ds     = new DataSet();
                LoteBE  LoteBE = new LoteBE()
                {
                    OPCION       = nopc,
                    USUARIO      = General.General.GetUsuario,
                    IdSocio_Dsc  = TextBoxX1.Text.Trim(),
                    sdDesembolso = dtDesembolsoInicio.Value,
                    sdAprobacion = dtDesembolsoFin.Value,
                    IdEstado_tt  = Fase == "0" ? "00058" : string.Empty,
                    IdFinanciera = _IdFinancieraPar,
                    IdMoneda_tt  = _IdMoneda_tt
                };

                ds = LoteBL.ProcesarLote(LoteBE);
                dgvLote.DataSource = ds.Tables[0];
                lblRegistros.Text  = ds.Tables[0].Rows.Count.ToString() + " registro(s)";

                foreach (DataGridViewRow row in dgvLote.Rows)
                {
                    if (row.Cells["IdEstado_tt"].Value.Equals("00078")) // Anulado
                    {
                        row.DefaultCellStyle.ForeColor = Color.FromName(General.General.GetColorAnulado);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #9
0
        private void btnProcesar_Click(object sender, EventArgs e)
        {
            General.General.ValidarTipoCambio();
            General.msgHelper.Wait("Actualizando nuevos registros, espere un momento ...");
            try
            {
                LoteBE LoteBE = new LoteBE();
                foreach (DataGridViewRow row in dgvLote.Rows)
                {
                    LoteBE.OPCION      = 18;
                    LoteBE.USUARIO     = General.General.GetUsuario;
                    LoteBE.IdLote      = row.Cells["IdMovimiento"].Value.ToString();
                    LoteBE.IdSocio_Dsc = row.Cells["NumeroDocumento"].Value.ToString();
                    new LoteBL().ProcesarLote(LoteBE);
                }
                int Procesar = 0;
                foreach (DataGridViewRow row in dgvLote.Rows)
                {
                    if (row.Cells["FlgSelect"].Value != null)
                    {
                        DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["FlgSelect"];
                        if (chk.Value.ToString() == "1")
                        {
                            Procesar           = 1;
                            LoteBE.OPCION      = 16;
                            LoteBE.USUARIO     = General.General.GetUsuario;
                            LoteBE.IdLote      = row.Cells["IdMovimiento"].Value.ToString();
                            LoteBE.IdSocio_Dsc = row.Cells["NumeroDocumento"].Value.ToString();
                            new LoteBL().ProcesarLote(LoteBE);
                        }
                    }
                }

                if (Procesar == 1)
                {
                    LoteBE.OPCION   = 17;
                    LoteBE.USUARIO  = General.General.GetUsuario;
                    LoteBE.gFechaOp = General.General.gFechaOp;
                    new LoteBL().ProcesarLote(LoteBE);
                    MessageBox.Show("Se proceso correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    btnBuscar_Click(new object(), new EventArgs());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                General.msgHelper.Wait();
            }
        }
コード例 #10
0
ファイル: LoteBL.cs プロジェクト: rolandolarosa/prototipofac
        public string ProcesarLote(LoteBE oEntity, List <DetaLoteBE> LsEntityDet)
        {
            string strResult = string.Empty;

            try
            {
                strResult = LoteDA.ProcesarLote(oEntity, LsEntityDet);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(strResult);
        }
コード例 #11
0
ファイル: LoteDAL.cs プロジェクト: rolandolarosa/prototipofac
        public DataSet ProcesarLote(LoteBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("Lote_Mnt");
                cmd.CommandTimeout = 0;
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                if (BE.gFechaOp != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "gFechaOp", DbType.DateTime, BE.gFechaOp);
                }
                db.AddInParameter(cmd, "IdLote", DbType.String, BE.IdLote);
                db.AddInParameter(cmd, "IdSocio", DbType.String, BE.IdSocio);
                db.AddInParameter(cmd, "IdSocio_Dsc", DbType.String, BE.IdSocio_Dsc);
                db.AddInParameter(cmd, "IdPagadora_Dsc", DbType.String, BE.IdPagadora_Dsc);
                if (BE.sdDesembolso != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "sdDesembolso", DbType.DateTime, BE.sdDesembolso);
                }
                db.AddInParameter(cmd, "IdLinea", DbType.String, BE.IdLinea);
                db.AddInParameter(cmd, "IdMoneda_tt", DbType.String, BE.IdMoneda_tt);
                db.AddInParameter(cmd, "nImporte", DbType.Decimal, BE.nImporte);
                if (BE.sdAprobacion != DateTime.MinValue)
                {
                    db.AddInParameter(cmd, "sdAprobacion", DbType.DateTime, BE.sdAprobacion);
                }
                db.AddInParameter(cmd, "nTotal", DbType.Decimal, BE.nTotal);
                db.AddInParameter(cmd, "nAjuste", DbType.Decimal, BE.nAjuste);
                db.AddInParameter(cmd, "nDesembolso", DbType.Decimal, BE.nDesembolso);
                db.AddInParameter(cmd, "IdOperacion_tt", DbType.String, BE.IdOperacion_tt);
                db.AddInParameter(cmd, "IdFormaDesembolso", DbType.Decimal, BE.IdFormaDesembolso);
                db.AddInParameter(cmd, "IdEstado_tt", DbType.String, BE.IdEstado_tt);
                db.AddInParameter(cmd, "FlgConfimado", DbType.String, BE.FlgConfimado);
                db.AddInParameter(cmd, "FlgEntregado", DbType.String, BE.FlgEntregado);
                db.AddInParameter(cmd, "FlgPendiente", DbType.String, BE.FlgPendiente);
                db.AddInParameter(cmd, "IdFinanciera", DbType.String, BE.IdFinanciera);
                db.AddInParameter(cmd, "iCuota", DbType.Int32, BE.iCuota);
                db.AddInParameter(cmd, "nTotalCuota", DbType.Decimal, BE.nTotalCuota);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
コード例 #12
0
        private void frmMntLote_Load(object sender, EventArgs e)
        {
            dtDesembolsoInicio.Value = General.General.gFechaOp;
            dtDesembolsoFin.Value    = General.General.gFechaOp;

            if (Fase.Equals("1"))
            {
                //btnNuevo.Visible = false;
            }
            else
            {
                this.Text = "Registro de Planillas :: FASE 0";
            }

            if (!string.IsNullOrEmpty(_IdFinanciera_Dsc))
            {
                lblFinanciera.Text  = _IdFinanciera_Dsc.Trim() + " - " + _IdMoneda_tt_Dsc.Trim();
                btnNuevo.Visible    = false;
                btnEditar.Visible   = false;
                btnEliminar.Visible = false;
                nopc = 33;
                //btnBuscar.PerformClick();

                DataSet ds     = new DataSet();
                LoteBE  LoteBE = new LoteBE()
                {
                    OPCION       = nopc,
                    USUARIO      = General.General.GetUsuario,
                    IdSocio_Dsc  = TextBoxX1.Text.Trim(),
                    sdDesembolso = dtDesembolsoInicio.Value,
                    sdAprobacion = dtDesembolsoFin.Value,
                    IdEstado_tt  = Fase == "0" ? "00058" : string.Empty,
                    IdFinanciera = _IdFinancieraPar,
                    IdMoneda_tt  = _IdMoneda_tt
                };

                ds = LoteBL.ProcesarLote(LoteBE);
                dgvLote.DataSource = ds.Tables[0];
                lblRegistros.Text  = ds.Tables[0].Rows.Count.ToString() + " registro(s)";

                foreach (DataGridViewRow row in dgvLote.Rows)
                {
                    if (row.Cells["IdEstado_tt"].Value.Equals("00078")) // Anulado
                    {
                        row.DefaultCellStyle.ForeColor = Color.FromName(General.General.GetColorAnulado);
                    }
                }
            }
        }
コード例 #13
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            try
            {
                DataSet ds     = new DataSet();
                LoteBE  LoteBE = new LoteBE()
                {
                    OPCION         = 24,
                    USUARIO        = General.General.GetUsuario,
                    IdSocio_Dsc    = TextBoxX1.Text.Trim(),
                    IdPagadora_Dsc = txtIdPagadora_Dsc.Text.Trim(),
                    sdDesembolso   = rbtnConfirmados.Checked ? dtDesembolsoInicio.Value : DateTime.MinValue,
                    sdAprobacion   = rbtnConfirmados.Checked ? dtDesembolsoFin.Value : DateTime.MinValue,
                    FlgEntregado   = rbtnPEnviaronConfirmacion.Checked ? "1" : string.Empty,
                    FlgConfimado   = rbtnPendienteConfirmarPagadora.Checked ? "1" : string.Empty,
                    FlgPendiente   = rbtnConfirmados.Checked ? "1" : string.Empty,
                };

                ds = new LoteBL().ProcesarLote(LoteBE);
                dt = ds.Tables[0];
                dgvLote.DataSource = ds.Tables[0];
                lblRegistros.Text  = ds.Tables[0].Rows.Count.ToString() + " registro(s)";

                this.dgvLote.Columns["IdOperacion_tt_Dsc"].Width       = 60;
                this.dgvLote.Columns["IdFormaDesembolso_tt_Dsc"].Width = 60;

                this.dgvLote.Columns["sdDesembolso"].Width  = 80;
                this.dgvLote.Columns["dtConfirmado"].Width  = 80;
                this.dgvLote.Columns["dtEnvioCorreo"].Width = 80;
                FormatoGrid();

                //IdLote
                //IdSocio_Dsc
                //IdPagadora_Dsc
                //IdDocumento_Dsc
                //IdOperacion_tt_Dsc
                //IdFormaDesembolso_tt_Dsc
                //sdDesembolso
                //dtConfirmado
                //UsuarioConfirmado
                //dtEnvioCorreo
                //UsuarioEnvioCorreo
                //IdEstado_tt_Dsc
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #14
0
ファイル: LoteDAL.cs プロジェクト: rolandolarosa/prototipofac
        public DataSet ProcesarRptLote(LoteBE BE)
        {
            DataSet dsResult;

            try
            {
                cmd = db.GetStoredProcCommand("Rpt_Lote");
                db.AddInParameter(cmd, "OPCION", DbType.Int32, BE.OPCION);
                //db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                db.AddInParameter(cmd, "IdLote", DbType.String, BE.IdLote);
                dsResult = db.ExecuteDataSet(cmd);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsResult);
        }
コード例 #15
0
        private void RptLoteLiquidacionVisor_Load(object sender, EventArgs e)
        {
            LoteBE ILote = new LoteBE()
            {
                OPCION = 1,
                IdLote = IdLote
            };

            ds = LoteBL.ProcesarRptLote(ILote);

            ILote.OPCION = 2;
            dsDet        = LoteBL.ProcesarRptLote(ILote);

            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet1", dsDet.Tables[0]));
            reportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSet2", ds.Tables[0]));
            reportViewer1.RefreshReport();
        }
コード例 #16
0
ファイル: LoteBL.cs プロジェクト: rolandolarosa/prototipofac
        public DataSet ProcesarLote(LoteBE BE)
        {
            DataSet dsRet = new DataSet();

            try
            {
                dsRet = LoteDA.ProcesarLote(BE);
                if (BE.OPCION == 2)
                {
                    String retIdLote = dsRet.Tables[0].Rows[0]["IdLote"].ToString();
                    LoteDA.DesembolsoDet(BE.OPCION, retIdLote, BE.IdFormaDesembolso, BE.jComunCuentaID,
                                         BE.jImporteAho, BE.jTipoCambio);
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(dsRet);
        }
コード例 #17
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            General.msgHelper.Wait("Actualizando nuevos registros, espere un momento ...");
            try
            {
                DataSet ds     = new DataSet();
                LoteBL  LoteBL = new LoteBL();
                LoteBE  LoteBE = new LoteBE()
                {
                    OPCION      = 15,
                    USUARIO     = General.General.GetUsuario,
                    IdSocio_Dsc = TextBoxX1.Text.Trim()
                };

                ds = LoteBL.ProcesarLote(LoteBE);
                dgvLote.DataSource = ds.Tables[0];
                lblRegistros.Text  = ds.Tables[0].Rows.Count.ToString() + " registro(s)";

                foreach (DataGridViewRow row in dgvLote.Rows)
                {
                    if (row.Cells["Inconsistencia"].Value.ToString() != "0")
                    {
                        row.DefaultCellStyle.ForeColor = Color.FromName(General.General.GetColorAnulado);
                    }

                    if (!String.IsNullOrEmpty(row.Cells["IdLote"].Value.ToString()))
                    {
                        row.DefaultCellStyle.ForeColor = Color.FromName(General.General.GetColorLoteAprobado);
                    }
                }
                dgvLote.Refresh();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                General.msgHelper.Wait();
            }
        }
コード例 #18
0
ファイル: LoteDAL.cs プロジェクト: rolandolarosa/prototipofac
        public bool ProcesarLoteExtornacion(LoteBE BE)
        {
            bool bResult = true;

            using (DbConnection conn = db.CreateConnection())
            {
                conn.Open();
                DbTransaction trans = conn.BeginTransaction();
                try
                {
                    foreach (DataRow dr in BE.dtLote.Rows)
                    {
                        cmd = db.GetStoredProcCommand("Lote_Mnt");
                        cmd.CommandTimeout = 0;
                        db.AddInParameter(cmd, "OPCION", DbType.Int32, dr["OPCION"]);
                        db.AddInParameter(cmd, "USUARIO", DbType.String, BE.USUARIO);
                        if (BE.gFechaOp != DateTime.MinValue)
                        {
                            db.AddInParameter(cmd, "gFechaOp", DbType.DateTime, BE.gFechaOp);
                        }
                        db.AddInParameter(cmd, "IdLote", DbType.String, dr["IdLote"].ToString());
                        db.AddInParameter(cmd, "IdEstado_tt", DbType.String, BE.IdEstado_tt);
                        db.ExecuteNonQuery(cmd, trans);
                        //db.ExecuteNonQuery(cmd);
                        bResult = true;
                    }
                    trans.Commit();
                }
                catch (Exception ex)
                {
                    bResult = false;
                    trans.Rollback();
                    throw new Exception(ex.Message);
                }
                finally
                {
                    conn.Close();
                }
            }
            return(bResult);
        }
コード例 #19
0
        private void frmGeneracionLoteMensaje_Load(object sender, EventArgs e)
        {
            try
            {
                DataSet ds     = new DataSet();
                LoteBL  LoteBL = new LoteBL();
                LoteBE  LoteBE = new LoteBE()
                {
                    OPCION  = 14,
                    USUARIO = General.General.GetUsuario,
                    IdLote  = _IdLote
                };

                ds = LoteBL.ProcesarLote(LoteBE);
                dgvInconsistencias.DataSource = ds.Tables[0];
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #20
0
        private void btnEliminar_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                if (dgvLote.RowCount > 0)
                {
                    if (dgvLote.CurrentRow.Cells["IdEstado_tt"].Value.ToString().Equals("00078"))
                    {
                        return;
                    }

                    if (!dgvLote.CurrentRow.Cells["IdEstado_tt"].Value.ToString().Equals("00058")) //Registrado
                    {
                        MessageBox.Show("No se puede anular este Lote", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        return;
                    }

                    dialogResult = MessageBox.Show("Seguro de Anular: " + dgvLote.CurrentRow.Cells["IdLote"].Value.ToString().Trim(), "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (dialogResult == DialogResult.Yes)
                    {
                        LoteBE LoteBE = new LoteBE()
                        {
                            OPCION  = 3,
                            USUARIO = General.General.GetUsuario,
                            IdLote  = dgvLote.CurrentRow.Cells["IdLote"].Value.ToString(),
                        };
                        LoteBL.ProcesarLote(LoteBE);
                        MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        btnBuscar.PerformClick();
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #21
0
        private void ActualizarTotal()
        {
            try
            {
                TotalizarCuentasxCobrar();
                TotalizarCuentasxPagar();
                TotalizarGN();

                TotalizarDesembolso();
                Double nTotal      = String.IsNullOrEmpty(txtDesembolso.Text) ? 0 : Convert.ToDouble(txtDesembolso.Text);
                Double nDesembolso = General.General.Redondeo(nTotal);
                Double nAjuste     = 0;

                if (nDesembolso > nTotal)
                {
                    nAjuste = nDesembolso - nTotal;
                }
                else
                {
                    nAjuste = nTotal - nDesembolso;
                }

                LoteBE oLoteBE = new LoteBE()
                {
                    OPCION      = 10,
                    USUARIO     = General.General.GetUsuario,
                    IdLote      = txtIdLote.Text,
                    nTotal      = Convert.ToDecimal(nTotal),
                    nAjuste     = Convert.ToDecimal(nAjuste),
                    nDesembolso = Convert.ToDecimal(nDesembolso),
                };
                LoteBL.ProcesarLote(oLoteBE);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #22
0
        private void buttonX1_Click(object sender, EventArgs e)
        {
            General.msgHelper.Wait("Actualizando Web, espere un momento ...");
            try
            {
                DataSet ds     = new DataSet();
                LoteBL  LoteBL = new LoteBL();
                LoteBE  LoteBE = new LoteBE()
                {
                    OPCION  = 29,
                    USUARIO = General.General.GetUsuario
                };

                ds = LoteBL.ProcesarLote(LoteBE);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            finally
            {
                General.msgHelper.Wait();
            }
        }
コード例 #23
0
ファイル: LoteDAL.cs プロジェクト: rolandolarosa/prototipofac
        public string ProcesarLote(LoteBE oEntity, List <DetaLoteBE> LsEntityDet)
        {
            string  strResult = string.Empty;
            DataSet dsResult  = new DataSet();

            using (DbConnection conn = db.CreateConnection())
            {
                conn.Open();
                DbTransaction trans = conn.BeginTransaction();
                try
                {
                    cmd = db.GetStoredProcCommand("Lote_Mnt");
                    cmd.CommandTimeout = 0;
                    db.AddInParameter(cmd, "OPCION", DbType.Int32, oEntity.OPCION);
                    db.AddInParameter(cmd, "USUARIO", DbType.String, oEntity.USUARIO);
                    if (oEntity.gFechaOp != DateTime.MinValue)
                    {
                        db.AddInParameter(cmd, "gFechaOp", DbType.DateTime, oEntity.gFechaOp);
                    }
                    db.AddInParameter(cmd, "IdLote", DbType.String, oEntity.IdLote);
                    db.AddInParameter(cmd, "IdSocio", DbType.String, oEntity.IdSocio);
                    if (oEntity.sdDesembolso != DateTime.MinValue)
                    {
                        db.AddInParameter(cmd, "sdDesembolso", DbType.DateTime, oEntity.sdDesembolso);
                    }
                    db.AddInParameter(cmd, "IdLinea", DbType.String, oEntity.IdLinea);
                    db.AddInParameter(cmd, "IdMoneda_tt", DbType.String, oEntity.IdMoneda_tt);
                    db.AddInParameter(cmd, "nImporte", DbType.Decimal, oEntity.nImporte);
                    if (oEntity.sdAprobacion != DateTime.MinValue)
                    {
                        db.AddInParameter(cmd, "sdAprobacion", DbType.DateTime, oEntity.sdAprobacion);
                    }
                    db.AddInParameter(cmd, "nTotal", DbType.Decimal, oEntity.nTotal);
                    db.AddInParameter(cmd, "nAjuste", DbType.Decimal, oEntity.nAjuste);
                    db.AddInParameter(cmd, "nDesembolso", DbType.Decimal, oEntity.nDesembolso);
                    db.AddInParameter(cmd, "IdOperacion_tt", DbType.String, oEntity.IdOperacion_tt);
                    db.AddInParameter(cmd, "IdFormaDesembolso", DbType.Decimal, oEntity.IdFormaDesembolso);
                    db.AddInParameter(cmd, "IdEstado_tt", DbType.String, oEntity.IdEstado_tt);
                    dsResult = db.ExecuteDataSet(cmd, trans);

                    foreach (DetaLoteBE IEntity in LsEntityDet)
                    {
                        cmd = db.GetStoredProcCommand("DetaLote_Mnt");
                        db.AddInParameter(cmd, "OPCION", DbType.Int32, IEntity.OPCION);
                        db.AddInParameter(cmd, "USUARIO", DbType.String, IEntity.USUARIO);
                        db.AddInParameter(cmd, "IdLote", DbType.String, dsResult.Tables[0].Rows[0]["IdLote"].ToString());
                        db.AddInParameter(cmd, "cItem", DbType.String, IEntity.cItem);
                        db.AddInParameter(cmd, "IdPagadora", DbType.String, IEntity.IdPagadora);
                        db.AddInParameter(cmd, "IdDocumento", DbType.String, IEntity.IdDocumento);
                        db.AddInParameter(cmd, "IdSocio_Beneficiario", DbType.String, IEntity.IdSocio_Beneficiario);
                        db.AddInParameter(cmd, "IdSocio_BeneficiarioRuc", DbType.String, IEntity.IdSocio_BeneficiarioRuc);
                        db.AddInParameter(cmd, "cNumDoc", DbType.String, IEntity.cNumDoc);
                        if (IEntity.sdRecepcion != DateTime.MinValue)
                        {
                            db.AddInParameter(cmd, "sdRecepcion", DbType.DateTime, IEntity.sdRecepcion);
                        }
                        db.AddInParameter(cmd, "iPlazo", DbType.Int32, IEntity.iPlazo);
                        if (IEntity.sdVencimiento != DateTime.MinValue)
                        {
                            db.AddInParameter(cmd, "sdVencimiento", DbType.DateTime, IEntity.sdVencimiento);
                        }
                        db.AddInParameter(cmd, "nvNominal", DbType.Decimal, IEntity.nvNominal);
                        db.AddInParameter(cmd, "cNotaCredito", DbType.String, IEntity.cNotaCredito);
                        db.AddInParameter(cmd, "nNotaCredito", DbType.Decimal, IEntity.nNotaCredito);
                        db.AddInParameter(cmd, "nPorRetencion", DbType.Decimal, IEntity.nPorRetencion);
                        db.AddInParameter(cmd, "nvRetencion", DbType.Decimal, IEntity.nvRetencion);
                        db.AddInParameter(cmd, "Descuento", DbType.Decimal, IEntity.Descuento);
                        db.AddInParameter(cmd, "nvNegociable", DbType.Decimal, IEntity.nvNegociable);
                        db.AddInParameter(cmd, "nTazaActiva", DbType.Decimal, IEntity.nTazaActiva);
                        db.AddInParameter(cmd, "nFondoGarantia", DbType.Decimal, IEntity.nFondoGarantia);
                        db.AddInParameter(cmd, "nTasaSobregiro", DbType.Decimal, IEntity.nTasaSobregiro);
                        db.ExecuteDataSet(cmd, trans);
                        strResult = dsResult.Tables[0].Rows[0]["IdLote"].ToString();
                    }
                    trans.Commit();
                }
                catch (Exception ex)
                {
                    strResult = string.Empty;
                    trans.Rollback();
                    throw new Exception(ex.Message);
                }
                finally
                {
                    conn.Close();
                }
            }
            return(strResult);
        }
コード例 #24
0
ファイル: LoteBL.cs プロジェクト: rolandolarosa/prototipofac
 public bool ProcesarLoteExtornacion(LoteBE BE)
 {
     return(LoteDA.ProcesarLoteExtornacion(BE));
 }
コード例 #25
0
ファイル: LoteBL.cs プロジェクト: rolandolarosa/prototipofac
 public DataSet ProcesarRptLote(LoteBE BE)
 {
     return(LoteDA.ProcesarRptLote(BE));
 }
コード例 #26
0
        private void btnAceptar_Click(object sender, EventArgs e)
        {
            try
            {
                if (LstEntityFE.Count == 0)
                {
                    MessageBox.Show("No hay documentos para enviar a operaciones, por favor verifique.", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                int  Index      = 0;
                bool IsProcesar = true;
                List <DetaLoteBE> LstDetaLote = new List <DetaLoteBE>();
                foreach (FEXMLBE oEntityFE in LstEntityFE)
                {
                    ImportacionLoteBE oEntity = new ImportacionLoteBE()
                    {
                        RucPagadora = oEntityFE.RUC,
                        IdSocio     = txtIdSocio.Text.Trim(),
                        IdLinea     = IdLinea,
                        IdDocumento = oEntityFE.IdDocumento,
                        IdMoneda_tt = IdMoneda_tt,
                        cNumDoc     = oEntityFE.cNumDoc
                    };
                    DataSet ds = new DataSet();
                    ds = new ImportacionLoteBL().ProcesarImportacionLote(oEntity);
                    if (!ds.Tables[0].Rows[0]["Result"].Equals("OK"))
                    {
                        IsProcesar = false;
                        LstEntityFE[Index].Mensaje = ds.Tables[0].Rows[0]["MsgResult"].ToString();
                        Index++;
                        continue;
                    }
                    else
                    {
                        if (oEntityFE.nvNegociable == 0)
                        {
                            LstEntityFE[Index].Mensaje = "El importe de pago no puede ser 0.";
                            IsProcesar = false;
                            Index++;
                            continue;
                        }

                        if (oEntityFE.sdVencimiento == DateTime.MinValue)
                        {
                            LstEntityFE[Index].Mensaje = "Ingresar la fecha de vencimiento válida.";
                            IsProcesar = false;
                            Index++;
                            continue;
                        }

                        if (oEntityFE.sdVencimiento <= GeneralXML.FechaOperacion)
                        {
                            LstEntityFE[Index].Mensaje = "Fecha de vencimiento no puede ser menor a la fecha de recepción.";
                            IsProcesar = false;
                            Index++;
                            continue;
                        }

                        LstEntityFE[Index].Mensaje = "OK";

                        TimeSpan   ts             = Convert.ToDateTime(oEntityFE.sdVencimiento) - GeneralXML.FechaOperacion;
                        DetaLoteBE oEntityDetLote = new DetaLoteBE();
                        oEntityDetLote.USUARIO                 = GeneralXML.CodUsuario;
                        oEntityDetLote.OPCION                  = 2;
                        oEntityDetLote.IdLote                  = string.Empty;
                        oEntityDetLote.cItem                   = "";
                        oEntityDetLote.IdPagadora              = oEntityFE.IdPagadora;
                        oEntityDetLote.IdDocumento             = oEntityFE.IdDocumento;
                        oEntityDetLote.cNumDoc                 = oEntityFE.cNumDoc;
                        oEntityDetLote.sdRecepcion             = GeneralXML.FechaOperacion;
                        oEntityDetLote.iPlazo                  = ts.Days;
                        oEntityDetLote.sdVencimiento           = Convert.ToDateTime(oEntityFE.sdVencimiento);
                        oEntityDetLote.nvNominal               = Convert.ToDecimal(oEntityFE.nvNegociable);
                        oEntityDetLote.cNotaCredito            = string.Empty;
                        oEntityDetLote.nNotaCredito            = 0;
                        oEntityDetLote.nPorRetencion           = 0;
                        oEntityDetLote.nvRetencion             = 0;
                        oEntityDetLote.Descuento               = 0;
                        oEntityDetLote.dtRenovacion            = DateTime.MinValue;
                        oEntityDetLote.IdSocio_Beneficiario    = string.Empty;                      //_IdSocio_Beneficiario;
                        oEntityDetLote.IdSocio_BeneficiarioRuc = oEntityFE.IdSocio_BeneficiarioRuc; //_IdSocio_BeneficiarioRuc;
                        LstDetaLote.Add(oEntityDetLote);

                        Index++;
                    }
                }

                if (IsProcesar)
                {
                    LoteBE LoteBE = new LoteBE()
                    {
                        USUARIO           = GeneralXML.CodUsuario,
                        OPCION            = 2,
                        IdLote            = string.Empty,
                        IdSocio           = txtIdSocio.Text,
                        sdDesembolso      = GeneralXML.FechaOperacion,
                        IdLinea           = IdLinea,
                        IdMoneda_tt       = IdMoneda_tt,
                        nImporte          = LstDetaLote.Sum(f => f.nvNominal),
                        sdAprobacion      = DateTime.MinValue,
                        nDesembolso       = 0,
                        IdOperacion_tt    = "00080", // Email*******
                        IdFormaDesembolso = IdFormaDesembolso,
                        jComunCuentaID    = string.Empty,
                        jImporteAho       = LstDetaLote.Sum(f => f.nvNominal)
                    };
                    string Result = new LoteBL().ProcesarLote(LoteBE, LstDetaLote);

                    if (!string.IsNullOrEmpty(Result))
                    {
                        DetaLoteBE oEntity = new DetaLoteBE();
                        oEntity.OPCION  = 11;
                        oEntity.USUARIO = GeneralXML.CodUsuario;
                        oEntity.IdLote  = Result;
                        oEntity.IdSocio_Beneficiario = txtCarpetaXML.Text.ToString();
                        oEntity.iPlazo = OrigenLote;
                        DataSet ds = new DetaLoteBL().ProcesarDetaLote(oEntity);

                        if (OrigenLote == 0)
                        {
                            DetaLoteBE oEntityCorrelativo = new DetaLoteBE();
                            oEntityCorrelativo.OPCION  = 12;
                            oEntityCorrelativo.USUARIO = GeneralXML.CodUsuario;
                            DataSet dsCorr = new DetaLoteBL().ProcesarDetaLote(oEntityCorrelativo);

                            string Directorio = ConfigurationManager.AppSettings["RutaDirectorioFEXML"].ToString() + txtCarpetaXML.Text.ToString() + "\\RM-IA-" + DateTime.Now.ToString("ddMMyyyy") + "-" + dsCorr.Tables[0].Rows[0]["Correlativo"].ToString() + "-FTPLA$OVM";
                            ExportToExcel(ds.Tables[0], Directorio, "Hoja1");
                        }

                        MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        IdLinea     = string.Empty;
                        IdMoneda_tt = string.Empty;
                        txtIdSocio.Clear();
                        txtIdSocio_Dsc.Clear();
                        txtIdLinea_Dsc.Clear();
                        txtIdMoneda_tt_Dsc.Clear();
                        txtFecha.Clear();
                        txtIdTipoLinea_tt_Dsc.Clear();
                        txtCarpetaXML.Clear();
                        LstDetaLote             = new List <DetaLoteBE>();
                        LstEntityFE             = new List <FEXMLBE>();
                        dgvFEDetalle.DataSource = LstEntityFE.ToList();
                    }
                    else
                    {
                        MessageBox.Show("Ocurrio un error al procesar", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                }

                dgvFEDetalle.DataSource = LstEntityFE.ToList();
                GridFormating();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #27
0
        private void btnAprobacion_Click(object sender, EventArgs e)
        {
            try
            {
                DateTime dtOperacion = General.General.gFechaOp.Date.AddHours(DateTime.Now.Hour).AddMinutes(DateTime.Now.Minute).AddSeconds(DateTime.Now.Second);
                General.General.ValidarTipoCambio();
                Boolean IsAprobo = false;
                if (dgvLote.RowCount > 0)
                {
                    foreach (DataGridViewRow row in dgvLote.Rows)
                    {
                        DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells[0];
                        if (chk.Value != null)
                        {
                            if (chk.Value.ToString().Equals("True") && row.Cells["IdEstado_tt"].Value.ToString().Equals("00059")) //Por Aprobar
                            {
                                LoteBE LoteBE = new LoteBE()
                                {
                                    OPCION       = 6,
                                    USUARIO      = General.General.GetUsuario,
                                    IdLote       = row.Cells["IdLote"].Value.ToString(),
                                    gFechaOp     = General.General.gFechaOp,
                                    sdAprobacion = dtOperacion,
                                    sdDesembolso = dtOperacion,
                                    IdEstado_tt  = "00077" // Aprobado
                                };
                                LoteBL.ProcesarLote(LoteBE);

                                //Guardar el documento PDF
                                String  strIdLote = row.Cells["IdLote"].Value.ToString();
                                DataSet dsLotes   = new DataSet();
                                using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ConexionStrDBEfideFactoring"].ConnectionString))
                                {
                                    SqlCommand cmd1 = new SqlCommand("Rpt_Lote_Cab", con);
                                    cmd1.CommandType = CommandType.StoredProcedure;
                                    cmd1.Parameters.AddWithValue("@IdLote", strIdLote);
                                    SqlDataAdapter daCab = new SqlDataAdapter(cmd1);
                                    daCab.Fill(dsLotes, "Rpt_Lote_Cab");

                                    SqlCommand cmd2 = new SqlCommand("Rpt_Lote_Det", con);
                                    cmd2.CommandType = CommandType.StoredProcedure;
                                    cmd2.Parameters.AddWithValue("@IdLote", strIdLote);
                                    SqlDataAdapter daDet = new SqlDataAdapter(cmd2);
                                    daDet.Fill(dsLotes, "Rpt_Lote_Det");

                                    con.Close();
                                }

                                //Crystal.crRegLiquidacion ocrLoteLiquidacion = new Crystal.crRegLiquidacion();
                                //ocrLoteLiquidacion.SetDataSource(dsLotes);
                                //ocrLoteLiquidacion.SetParameterValue("usuario", General.General.GetUsuario);
                                //ocrLoteLiquidacion.SetParameterValue("moneda", dsLotes.Tables[0].Rows[0]["IdMoneda_Dsc"].ToString());
                                //ocrLoteLiquidacion.ExportToDisk(ExportFormatType.PortableDocFormat, ConfigurationManager.AppSettings["RutaArchivoLiquidacionLote"].ToString() + strIdLote.Trim() + ".pdf");
                                IsAprobo = true;

                                //SUBIR EL PDF AL MOVIMIENTO EN CASO EL LOTE VENGA DE ESTE
                                //LoteBE.OPCION = 20;
                                //LoteBE.USUARIO = General.General.GetUsuario;
                                //LoteBE.IdLote = strIdLote;
                                //LoteBE.gFechaOp = General.General.gFechaOp;
                                //LoteBL.ProcesarLote(LoteBE);
                            }
                        }
                    }

                    btnBuscar.PerformClick();
                    if (IsAprobo)
                    {
                        MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                btnBuscar.PerformClick();
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #28
0
        private void btnEntregar_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                int    CountCheck  = 0;
                string IdLoteCheck = string.Empty;
                foreach (DataGridViewRow row in dgvLote.Rows)
                {
                    DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["ChkSelAtender"];
                    if (chk.Value != null)
                    {
                        if (bool.Parse(chk.Value.ToString()))
                        {
                            IdLoteCheck = IdLoteCheck + row.Cells["IdLote"].Value.ToString().Trim() + ", ";
                            CountCheck++;
                        }
                    }
                }

                if (CountCheck == 0)
                {
                    MessageBox.Show("Debe seleccionar al menos un registro.", "Advertencia", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return;
                }

                dialogResult = MessageBox.Show("Confirmar si efectivamente se ha realizado la operación de los siguientes Lotes: " + IdLoteCheck, "Importarte", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                if (dialogResult == DialogResult.Yes)
                {
                    foreach (DataGridViewRow row in dgvLote.Rows)
                    {
                        DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells["ChkSelAtender"];
                        if (chk.Value != null)
                        {
                            if (bool.Parse(chk.Value.ToString()))
                            {
                                try
                                {
                                    LoteBE LoteBE = new LoteBE()
                                    {
                                        OPCION  = 23,
                                        USUARIO = General.General.GetUsuario,
                                        IdLote  = row.Cells["IdLote"].Value.ToString(),
                                    };
                                    new LoteBL().ProcesarLote(LoteBE);
                                }
                                catch (Exception ex)
                                {
                                    MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                }
                            }
                        }
                    }
                }
                MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                btnBuscar.PerformClick();

                /*
                 * if (dgvLote.RowCount > 0)
                 * {
                 *  switch (dgvLote.CurrentRow.Cells["IdFormaDesembolso_tt_Dsc"].Value.ToString().Trim())
                 *  {
                 *      case "TRX":
                 *          lcmensaje = "IMPORTANTE, confirmar si efectivamente " + "\n" + "se ha realizado la Transferencia en el banco" + "\n" + "Lote N° ";
                 *          lcmensaje = lcmensaje + dgvLote.CurrentRow.Cells["IdLote"].Value.ToString().Trim();
                 *          break;
                 *      case "CHQ":
                 *          lcmensaje = "IMPORTANTE, confirmar si efectivamente " + "\n" + "se ha entregado el ch/ al socio" + "\n" + "Lote N° ";
                 *          lcmensaje = lcmensaje + dgvLote.CurrentRow.Cells["IdLote"].Value.ToString().Trim();
                 *          break;
                 *      case "ABO":
                 *          lcmensaje = "IMPORTANTE, confirma si efectivamente " + "\n" + "se ha abonado a la cuenta interna de Efide" + "\n" + "Lote N° ";
                 *          lcmensaje = lcmensaje + dgvLote.CurrentRow.Cells["IdLote"].Value.ToString().Trim();
                 *          break;
                 *  }
                 *
                 *
                 *  dialogResult = MessageBox.Show(lcmensaje , "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);
                 *  if (dialogResult == DialogResult.Yes)
                 *  {
                 *      LoteBE LoteBE = new LoteBE()
                 *      {
                 *          OPCION = 23,
                 *          USUARIO = General.General.GetUsuario,
                 *          IdLote = dgvLote.CurrentRow.Cells["IdLote"].Value.ToString(),
                 *      };
                 *      new LoteBL().ProcesarLote(LoteBE);
                 *      MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 *      btnBuscar.PerformClick();
                 *  }
                 * }
                 */
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #29
0
        private void btnExtornar_Click(object sender, EventArgs e)
        {
            DialogResult dialogResult = 0;

            try
            {
                Boolean IsProcedio = false;
                int     Opcion     = 0;
                if (dgvLote.RowCount > 0)
                {
                    dialogResult = MessageBox.Show("Seguro de extornar los lotes seleccionados?: ", "Confirme", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                    if (dialogResult == DialogResult.Yes)
                    {
                        DataTable dt = new DataTable();
                        dt.Columns.Add("OPCION");
                        dt.Columns.Add("IdLote");
                        foreach (DataGridViewRow row in dgvLote.Rows)
                        {
                            DataGridViewCheckBoxCell chk = (DataGridViewCheckBoxCell)row.Cells[0];
                            if (chk.Value != null)
                            {
                                if (chk.Value.ToString().Equals("True") && row.Cells["IdEstado_tt"].Value.ToString().Equals("00059")) //Por Aprobar
                                {
                                    DataRow dr = dt.NewRow();
                                    dr["OPCION"] = 6;
                                    dr["IdLote"] = row.Cells["IdLote"].Value.ToString();
                                    dt.Rows.Add(dr);
                                }
                                else if (dgvLote.CurrentRow.Cells["IdEstado_tt"].Value.ToString().Equals("00077")) //Aprobado
                                {
                                    DataRow dr = dt.NewRow();
                                    dr["OPCION"] = 12;
                                    dr["IdLote"] = row.Cells["IdLote"].Value.ToString();
                                    dt.Rows.Add(dr);
                                }
                            }
                        }

                        //Procesar
                        LoteBE LoteBE = new LoteBE()
                        {
                            USUARIO     = General.General.GetUsuario,
                            gFechaOp    = General.General.gFechaOp,
                            dtLote      = dt,
                            IdEstado_tt = "00058" // Registrado
                        };
                        LoteBL.ProcesarLoteExtornacion(LoteBE);
                        IsProcedio = true;
                    }

                    btnBuscar.PerformClick();
                    if (IsProcedio)
                    {
                        MessageBox.Show("Se Proceso Correctamente", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }