Пример #1
0
        public static object GetSelectOperacionDetalle(int jtStartIndex, int jtPageSize, string jtSorting, String[] data)
        {
            int totalI;
            int indexPage;

            if (jtStartIndex != 0)
            {
                indexPage = jtStartIndex / jtPageSize;
            }
            else
            {
                indexPage = jtStartIndex;
            }
            eOperacionVC ope = new eOperacionVC();

            ope._Ide_Contrato   = data[0];
            ope._Tip_Operacion  = data[1];
            ope._Mes_Operacion  = mes_vigente.ToString();
            ope._Ano_Operacion  = anio_vigente;
            ope._Formato_Moneda = formato_moneda;

            bOperacionSelectVC  bos   = new bOperacionSelectVC();
            List <eOperacionVC> listI = bos.GetSelectOperacionDetalle(ope, indexPage, jtPageSize, jtSorting.Substring(1), out totalI);

            return(new { Result = "OK", Records = listI, TotalRecordCount = totalI });
        }
Пример #2
0
        public static object SetEliminarOperacion(Int32 _Nro_Operacion)
        {
            bOperacionSelectVC ope = new bOperacionSelectVC();

            ope.SetEliminarOperacion(_Nro_Operacion);
            return(new { Result = "OK" });
        }
        private void SetInertarCierreProceso()
        {
            int    registro_procesado, registro_creado;
            String monto_acumulado;

            eCierreProceso ec = new eCierreProceso();

            ec._Nro_Contrato = ddl_contrato_c.SelectedItem.Value;
            ec._Tipo_Cierre  = ddl_tipo_cierre.SelectedItem.Value;
            ec._Tipo_Info    = ddl_tipinfo_c.SelectedItem.Value;
            ec._Anio_Cierre  = anio_vigente;
            ec._Mes_Cierre   = mes_vigente.ToString();
            ec._Usu_Reg      = Session["username"].ToString();
            bCierreProcesoVC bc   = new bCierreProcesoVC();
            Int32            resp = bc.SetInsertarCierreProceso(ec);

            if (resp != 0)
            {
                String       tipo_tabla = "";
                String       tipo_info  = "";
                eOperacionVC opt        = new eOperacionVC();
                opt._Ide_Contrato = ddl_contrato_c.SelectedItem.Value;
                if (ddl_tipo_cierre.SelectedItem.Value.ToUpper() == "TRI")
                {
                    tipo_tabla          = "2";
                    tipo_info           = "C" + ddl_tipinfo_c.SelectedItem.Value.Substring(1);
                    opt._Tip_Operacion  = ddl_tipinfo_c.SelectedItem.Value;
                    opt._Ano_Operacion  = anio_vigente;
                    opt._Mes_Operacion  = mes_vigente.ToString();
                    opt._Formato_Moneda = formato_moneda;
                }
                else
                {
                    tipo_tabla          = "1";
                    tipo_info           = "R" + ddl_tipinfo_c.SelectedItem.Value.Substring(1);
                    opt._Tip_Operacion  = "R" + ddl_tipinfo_c.SelectedItem.Value.Substring(1);
                    opt._Ano_Operacion  = anio_vigente;
                    opt._Mes_Operacion  = mes_vigente.ToString();
                    opt._Formato_Moneda = formato_moneda;
                }

                String[]           tabla = { tipo_tabla, tipo_info };
                bOperacionSelectVC bos   = new bOperacionSelectVC();
                bos.GetSelectTotalOperacion(opt, tabla, out registro_procesado, out registro_creado, out monto_acumulado);
                lbl_regprocesado_c.Text = registro_procesado.ToString();
                lbl_opecreada_c.Text    = registro_creado.ToString();
                lbl_totimporte_c.Text   = monto_acumulado.ToString();

                MessageBox("Operación Ejecutada Correctamente");
            }
            else
            {
                MessageBox("No se Encontró Registros Para Procesar");
            }
        }
Пример #4
0
        private void SetValidarCierreXTipoRegistro(String tiporegistro, Int32 mes_actual, Int32 mes_anterior, Int32 mes_x_trimestre)
        {
            int    registro_procesado, registro_creado;
            String monto_acumulado;

            Int32        resp = 0;
            eOperacionVC ope  = new eOperacionVC();

            ope._Ide_Contrato   = ddl_contrato_o.SelectedItem.Value;
            ope._Tip_Operacion  = ddl_tipinfo.SelectedItem.Value;
            ope._Tipo_Registro  = ddl_tipo_registro.SelectedItem.Value;
            ope._Ano_Operacion  = anio_vigente;
            ope._Mes_Operacion  = mes_vigente.ToString();
            ope._Formato_Moneda = formato_moneda;
            ope._Des_Reg_Mes    = "OPERACION " + ope._Tipo_Registro + " (" + ope._Tip_Operacion + ")";
            ope._Usu_Reg        = Session["username"].ToString();

            if (/*existe_mes_anterior > 0 &&mes_actual == 0 &&*/ ope._Tipo_Registro.ToUpper() == "MEN")
            {
                bOperacionVC bo = new bOperacionVC();
                if (ope._Tip_Operacion == "RP")
                {
                    resp = bo.SetProcesaPago(ope);
                }
                else if (ope._Tip_Operacion == "RI")
                {
                    resp = bo.SetProcesaIbnr(ope);
                }
                else if (ope._Tip_Operacion == "RR")
                {
                    resp = bo.SetProcesoRsp(ope);
                }
                else
                {
                    resp = bo.SetProcesaPrima(ope);
                }

                if (resp != 0)
                {
                    String[]           tabla = { "1", "NO" };
                    bOperacionSelectVC bos   = new bOperacionSelectVC();
                    bos.GetSelectTotalOperacion(ope, tabla, out registro_procesado, out registro_creado, out monto_acumulado);

                    lbl_regprocesado.Text = registro_procesado.ToString();
                    lbl_opecreada.Text    = registro_creado.ToString();
                    lbl_totimporte.Text   = monto_acumulado.ToString();
                    MessageBox(registro_creado + " Registros Creados");
                }
                else
                {
                    MessageBox("Aviso => No hay registros y/o ya fueron procesados verifique.");
                }
            }
            else if (mes_actual == 0 && mes_x_trimestre == 0 && ope._Tipo_Registro.ToUpper() == "TRI")
            {
                bOperacionVC bo = new bOperacionVC();
                if (ope._Tip_Operacion == "RP")
                {
                    resp = bo.SetProcesaPago(ope);
                }
                else if (ope._Tip_Operacion == "RI")
                {
                    resp = bo.SetProcesaIbnr(ope);
                }
                else if (ope._Tip_Operacion == "RR")
                {
                    resp = bo.SetProcesoRsp(ope);
                }
                else
                {
                    resp = bo.SetProcesaPrima(ope);
                }

                if (resp != 0)
                {
                    String[]           tabla = { "2", "C" + ddl_tipinfo.SelectedItem.Value.Substring(1) };
                    bOperacionSelectVC bos   = new bOperacionSelectVC();
                    bos.GetSelectTotalOperacion(ope, tabla, out registro_procesado, out registro_creado, out monto_acumulado);

                    lbl_regprocesado.Text = registro_procesado.ToString();
                    lbl_opecreada.Text    = registro_creado.ToString();
                    lbl_totimporte.Text   = monto_acumulado.ToString();
                    MessageBox(registro_creado + " Registros Creados");
                }
                else
                {
                    MessageBox("Aviso => No hay registros y/o ya fueron procesados verifique.");
                }
            }
            else
            {
                MessageBox("El Tipo de Operación " + ddl_tipinfo.SelectedItem.Value + " ya fue Procesado");
            }
        }
        private void exportarDatoExcel(eOperacionVC o)
        {
            int    total;
            String filename = "OPERACION " + ddl_tipcom_o.SelectedItem.Value + " " + String.Format("{0:dd/MM/yyyy}", System.DateTime.Today) + ".xls";

            Response.ContentType = "application/vnd.ms-excel";
            Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", filename));
            Response.Clear();

            var output = new MemoryStream();
            var writer = new StreamWriter(output);

            HSSFWorkbook xssfworkbook = new HSSFWorkbook();
            ISheet       sheet        = xssfworkbook.CreateSheet("OPERACION");

            IFont titleFont = xssfworkbook.CreateFont();

            titleFont.FontName           = "Calibri";
            titleFont.Boldweight         = (short)FontBoldWeight.Bold;
            titleFont.Color              = (IndexedColors.Black.Index);
            titleFont.FontHeightInPoints = 11;

            ICellStyle styleCabecera = xssfworkbook.CreateCellStyle();

            styleCabecera.Alignment         = HorizontalAlignment.Center;
            styleCabecera.VerticalAlignment = VerticalAlignment.Center;
            styleCabecera.SetFont(titleFont);
            styleCabecera.BorderTop    = NPOI.SS.UserModel.BorderStyle.Thin;
            styleCabecera.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
            styleCabecera.BorderLeft   = NPOI.SS.UserModel.BorderStyle.Thin;
            styleCabecera.BorderRight  = NPOI.SS.UserModel.BorderStyle.Thin;

            bOperacionSelectVC operacion = new bOperacionSelectVC();
            DataTable          dt        = operacion.GetSelectOperacionExport(o, 0, 1000000, "NRO_OPERACION ASC", out total);
            IRow  dataHeader             = sheet.CreateRow(0);
            ICell dataCellH;

            for (int cl1 = 0; cl1 < 11; cl1++)
            {
                sheet.SetColumnWidth(cl1, 150 * 25);
            }
            for (int cl = 11; cl <= 21; cl++)
            {
                sheet.SetColumnWidth(cl, 300 * 25);
            }
            //cabecera excel
            for (int h = 0; h < (dt.Columns.Count); h++)
            {
                dataCellH = dataHeader.CreateCell(h);
                dataCellH.SetCellValue(dt.Columns[h].ToString());
                dataCellH.CellStyle          = styleCabecera;
                dataCellH.CellStyle.WrapText = true;
            }
            //cuerpo excel
            for (int r = 0; r < dt.Rows.Count; r++)
            {
                IRow datacell = sheet.CreateRow(1 + r);
                for (int c = 0; c < dt.Columns.Count; c++)
                {
                    datacell.CreateCell(c, CellType.String).SetCellValue(dt.Rows[r][c].ToString());
                }
            }
            xssfworkbook.Write(output);
            writer.Flush();

            dt.Rows.Clear();
            dt.Columns.Clear();
            dt.Clear();

            Response.BinaryWrite(output.GetBuffer());
            Response.End();
        }