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");
            }
        }
        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");
            }
        }