public static List <TipoProducto> GetFLstProducto()
        {
            TipoProductoDAO     ObjTipoProducto = new TipoProductoDAO();
            List <TipoProducto> oTipoProducto   = ObjTipoProducto.ListarTipoProductos();

            return(oTipoProducto);
        }
예제 #2
0
 void CargarTipoBancos()
 {
     using (TipoProductoDAO db = new TipoProductoDAO())
     {
         grvBancos.DataSource = db.ListarTipoProductos();
         grvBancos.DataBind();
     }
 }
예제 #3
0
 void CargarSeguros(int idinstitucion)
 {
     using (TipoProductoDAO db = new TipoProductoDAO())
     {
         DDLSeguro.Items.Clear();
         DDLSeguro.DataTextField  = "Producto";
         DDLSeguro.DataValueField = "ProductoID";
         DDLSeguro.DataSource     = db.ListarTipoProductosxInstitucion(idinstitucion);
         DDLSeguro.DataBind();
     }
 }
예제 #4
0
 public bool eliminarTipoProducto(int id, string schema)
 {
     try
     {
         return(TipoProductoDAO.getInstance().eliminarTipoProducto(id, schema));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #5
0
 public bool updateTipoProducto(int id, string nombre, string schema)
 {
     try
     {
         return(TipoProductoDAO.getInstance().updateTipoProducto(id, nombre, schema));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #6
0
 public string nuevoTipoProducto(string nombre, string schema)
 {
     try
     {
         return(TipoProductoDAO.getInstance().nuevoTipoProducto(nombre, schema));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #7
0
 public List <TipoProducto> listaTiposProductos(string schema)
 {
     try
     {
         return(TipoProductoDAO.getInstance().listaTiposProductos(schema));
     }
     catch (Exception e)
     {
         throw e;
     }
 }
예제 #8
0
        protected void grvBancos_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int    fila = Convert.ToInt32(e.CommandArgument);
            string jss  = "";

            if (e.CommandName == "EditaTipoSeguro")
            {
                Session["idSeguro"] = grvBancos.Rows[fila].Cells[0].Text;
                TxtNombre.Text      = grvBancos.Rows[fila].Cells[1].Text;
                TxtDescripcion.Text = grvBancos.Rows[fila].Cells[2].Text;

                jss = "openEditarProducto();";
                ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss, true);
            }

            if (e.CommandName == "AnulaTipoSeguro")
            {
                int id = Convert.ToInt32(grvBancos.Rows[fila].Cells[0].Text);
                hdnidTipoSeguro.Value = Convert.ToString(id);
                Label lblestado = (Label)grvBancos.Rows[fila].FindControl("lblestado");
                hdnEstado.Value = lblestado.Text;
                using (TipoProductoDAO db = new TipoProductoDAO())
                {
                    if (lblestado.Text.ToUpper() == "ACTIVO")
                    {
                        lblTitleConfirm.Text = "Desactivar Compañía de Seguros";
                        lblmsgConfirm.Text   = "¿Desea desactivar este tipo de seguro: " + grvBancos.Rows[fila].Cells[1].Text + " ?";
                    }
                    //else if (lblestado.Text == "NO ACTIVO")
                    //{
                    //    lblTitleConfirm.Text = "Activar Compañía de Seguros";
                    //    lblmsgConfirm.Text = "¿Desea activar este tipo de seguro: " + grvBancos.Rows[fila].Cells[1].Text + " ?";
                    //}
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "openConfirm();", true);
                }
            }

            if (e.CommandName == "ActivaTipoSeguro")
            {
                string id = grvBancos.Rows[fila].Cells[0].Text;
                hdnidTipoSeguro.Value = id;
                Label lblestado = (Label)grvBancos.Rows[fila].FindControl("lblestado");
                hdnEstado.Value = lblestado.Text;
                using (TipoProductoDAO db = new TipoProductoDAO())
                {
                    lblTitleConfirm.Text = "Activar Compañía de Seguros";
                    lblmsgConfirm.Text   = "¿Desea activar este tipo de seguro: " + grvBancos.Rows[fila].Cells[1].Text + " ?";
                    ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "openConfirm();", true);
                }
            }
        }
 protected void btnRegistrarContact_Click1(object sender, EventArgs e)
 {
     using (TipoProductoDAO db = new TipoProductoDAO())
     {
         //Producto producto = new Producto();
         //producto.ID = Convert.ToInt32(Session["idSeguro"]);
         //producto.Nombre = TxtNombre.Text;
         //producto.Descripcion = TxtDescripcion.Text;
         //producto.FechaCreacion = DateTime.Now.Date;
         //producto.UsuarioCreacion = "";
         //db.Agregar(producto);
         ////CargarTipoBancos();
         //txtmensaje.Text = "Tipo de seguro:" + producto.Nombre + " fue registrado con exito";
         //string jss = "openModal()";
         //ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", jss, true);
     }
 }
        private void PreparaEnvioCorreo(int CampanaId, int InstitucionEducativaId, string InstitucionEducativaCod, string InstitucionEducativaNom)
        {
            string usuario = cUtil.ObtenerValorParametro("CORREO", "USER");
            string clave   = cUtil.ObtenerValorParametro("CORREO", "CLAVE");
            string smtp    = cUtil.ObtenerValorParametro("CORREO", "SMTP");
            int    puerto  = Convert.ToInt32(cUtil.ObtenerValorParametro("CORREO", "PUERTO"));
            string mensaje = "";

            mensaje = mensaje + "<br/><span>Estimados Señores,</span><br/><br/>";
            mensaje = mensaje + "<span>A continuacion, se adjunta la relación de afiliados a los seguros estudiantiles en el rango de la fecha indicado en el asunto.</span><br/>";
            mensaje = mensaje + "<br/>";
            mensaje = mensaje + "<span>RESUMEN:<br/><br/>";

            Institucion_Educativa oInstitucionEducativa = new Institucion_Educativa();
            DateTime ini     = Convert.ToDateTime(txtFecPagoDesde.Text);
            DateTime fin     = Convert.ToDateTime(txtFecPagoHasta.Text);
            string   inidate = ini.ToString("yyyyMMdd");
            string   findate = fin.ToString("yyyyMMdd");

            string Asunto = Path.Combine(InstitucionEducativaNom + " Reporte de afiliación de asegurados del " + ini.ToString("dd/MM/yyyy") + " al " + fin.ToString("dd/MM/yyyy"));

            oInstitucionEducativa.cod_IEducativa = InstitucionEducativaId;
            oInstitucionEducativa.Cod_CiaSeguro  = 0;
            oInstitucionEducativa.EstadoIsPagado = 1;
            oInstitucionEducativa.Cod_Banco      = 0;
            oInstitucionEducativa.Cod_Moneda     = 0;
            oInstitucionEducativa.FechaInicial   = Convert.ToDateTime(txtFecPagoDesde.Text);
            oInstitucionEducativa.FechaFinal     = Convert.ToDateTime(txtFecPagoHasta.Text);
            oInstitucionEducativa.TextoBusqueda  = "";

            TipoProductoDAO     ObjTipoProducto  = new TipoProductoDAO();
            List <TipoProducto> olstTipoProducto = ObjTipoProducto.getLstCntPagosByProdInst(CampanaId, InstitucionEducativaId, inidate, findate);

            List <MemoryStream> adjuntos     = new List <MemoryStream>();
            List <string>       NameAdjuntos = new List <string>();

            foreach (TipoProducto oProd in olstTipoProducto)
            {
                oInstitucionEducativa.Cod_ProductId = Convert.ToInt32(oProd.ID);

                TipoInstitucionEducativaDAO  objn_InstitucionEducativa = new TipoInstitucionEducativaDAO();
                List <Institucion_Educativa> ListarReporteExcel        = objn_InstitucionEducativa.ListarCodigosDetallesPagos(oInstitucionEducativa);
                StringBuilder sb = cUtil.sbDatosConsultaPagos(oInstitucionEducativa.Cod_ProductId, ListarReporteExcel);


                string nameFile = InstitucionEducativaCod + oProd.Nombre.Replace(" ", "") + ".xls";
                //string path = Server.MapPath("~/rptTemp/" + InstitucionEducativaCod + oProd.Nombre.Replace(" ","") + ".xls");

                //System.IO.StreamWriter file;// = new System.IO.StreamWriter(path);
                //file= File.AppendText(path);
                //file.WriteLine(sb.ToString());
                //file.Flush();
                //file.Close();
                //file.Dispose();

                mensaje = mensaje + " " + oProd.Nombre + ": " + ListarReporteExcel.Count.ToString() + " pago(s)." + "<br/>";

                //
                //ExcelModel excelModel= new ExcelModel();
                //excelModel.Data= sb.ToString();
                //ExcelHelper excelHelper = new ExcelHelper();
                //ExcelMeta meta = excelHelper.GetExcelMeta(excelModel.Data);
                //var myByteArray = excelHelper.GetExcelDocument(meta);
                //
                var myString    = sb.ToString();
                var myByteArray = System.Text.Encoding.UTF8.GetBytes(myString);
                var ms          = new MemoryStream(myByteArray);

                adjuntos.Add(ms);
                NameAdjuntos.Add(nameFile);
            }

            mensaje = mensaje + "<br/>";
            mensaje = mensaje + "<br/>";
            mensaje = mensaje + "<span>Atentamente.</span>";
            mensaje = mensaje + "<br/>";
            mensaje = mensaje + "<br/>";
            mensaje = mensaje + "<span>MIGUEL ESPINOZA GARCIA</span><br/>";
            mensaje = mensaje + "<span>EJECUTIVO DE RIESGOS ESTUDIANTILES</span><br/>";
            mensaje = mensaje + "<span>HERMES ASESORES Y CORREDORES DE SEGUROS</span><br/>";
            mensaje = mensaje + "<span>Dirección: Calle Manco Segundo 2699 - Lima 14</span><br/>";
            mensaje = mensaje + "<span>Telf.: 421-4115 Anexo 122</span><br/>";
            mensaje = mensaje + "<span>[email protected]</span><br/>";
            mensaje = mensaje + "<span>www.hermes.pe</span><br/>";

            List <USP_LISTARCONTACTOS_INST_Result> lstContactos = new List <USP_LISTARCONTACTOS_INST_Result>();
            ContactoDAO db = new ContactoDAO();

            lstContactos = db.ListarContactosxInstitucion(InstitucionEducativaId);

            string para = "";

            foreach (USP_LISTARCONTACTOS_INST_Result oContacto in lstContactos)
            {
                if (oContacto.Email.Trim().Length > 0)
                {
                    para = para + oContacto.Email.Trim() + ";";
                }
            }

            if (para != "")
            {
                string Cc = "*****@*****.**";
                cUtil.EnvioMails(para, Cc, usuario, Asunto, mensaje, true, clave, smtp, puerto, adjuntos, NameAdjuntos);
            }

            //foreach (var item in adjuntos)
            //{
            //    File.Delete(item);
            //}
        }