public TemasPage() { crudTema = new Tema(); usuarioBL = new UsuarioBL(); temaBL = new TemaBL(); InitializeComponent(); RefreshTemasListView(); cbSoloYo.IsChecked = true; Usuarios = new ObservableCollection <UsuarioListViewItem>(); var data = usuarioBL.Listar(); foreach (var item in data) { var userlb = new UsuarioListViewItem { Usuario = item }; userlb.Content = userlb.Usuario.GetNombreCompleto(); Usuarios.Add(userlb); } OnPropertyChanged("Usuarios"); TemaMode(); var acciones = usuarioBL.ListarAccionesDisponiblesEnVista(SesionActiva.ObtenerInstancia().Usuario.ID, 8); CreateCommandBar(this.AccionesBar, acciones); }
public IniciativasTemaPage() { InitializeComponent(); btnGuardar.IsEnabled = false; iniciativaBL = new IniciativaBL(); temaBL = new TemaBL(); usuarioBL = new UsuarioBL(); Iniciativas = new ObservableCollection <Iniciativa>(); opciones = new ObservableCollection <OpcionListViewItem>(); var acciones = usuarioBL.ListarAccionesDisponiblesEnVista(SesionActiva.ObtenerInstancia().Usuario.ID, 9); CreateCommandBar(this.AccionesBar, acciones); var tipos = iniciativaBL.ListarTipos(); foreach (var item in tipos) { this.cbTipoIniciativa.Items.Add(new KeyValuePair <string, string>(item[1], item[0])); } this.cbTipoIniciativa.SelectedValuePath = "Key"; this.cbTipoIniciativa.DisplayMemberPath = "Value"; }
private void tlbMenu_DeleteClick() { try { Cursor = Cursors.WaitCursor; if (XtraMessageBox.Show("Esta seguro de anular el Tema?", this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { int intIdTema = int.Parse(gvTema.GetFocusedRowCellValue("IdTema").ToString()); int intIdSituacion = int.Parse(gvTema.GetFocusedRowCellValue("IdSituacion").ToString()); if (intIdSituacion == Parametros.intTEMAActivo) { TemaBL objBL_Tema = new TemaBL(); objBL_Tema.ActualizaSituacion(intIdTema, Parametros.intTEMAInactivo); XtraMessageBox.Show("El Tema se anuló correctamente", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); Cargar(); } else { XtraMessageBox.Show("No se puede anular un Tema diferente al Estado Activo", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); } } Cursor = Cursors.Default; } catch (Exception ex) { Cursor = Cursors.Default; XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
protected virtual void InitData() { try { Cursor = Cursors.WaitCursor; //TRAEMOS LA INFORMACION DE LA BASE DE DATOS List <TemaBE> lstTema = null; lstTema = new TemaBL().ListaTodosActivo(0, 0, Parametros.intTEMAVirtual, Parametros.intTEMAActivo, Parametros.intPeriodo); //var homesTable = VideoCatalogDataSet(); var homesTable = new FuncionBase().ToDataTable(lstTema); homesTable.Columns.Add("Image", typeof(Image)); homesTable.Columns.Add("Curso", typeof(String)); foreach (DataRow row in homesTable.Rows) { var img = DevExpress.XtraEditors.Controls.ByteImageConverter.FromByteArray(row["Logo"] as byte[]); row["Image"] = new Bitmap(img, new Size(351, 234)); row["Curso"] = row["DescSituacion"].ToString(); } gridControl1.DataSource = homesTable; Cursor = Cursors.Default; } catch (Exception ex) { Cursor = Cursors.Default; XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void frmManTemaVirtualEdit_Load(object sender, EventArgs e) { txtPeriodo.EditValue = Parametros.intPeriodo; BSUtils.LoaderLook(cboCategoriaTema, new CategoriaTemaBL().ListaCombo(0), "DescCategoriaTema", "IdCategoriaTema", true); cboCategoriaTema.EditValue = IdCategoriaTema; deFechaIni.EditValue = DateTime.Now; deFechaFin.EditValue = DateTime.Now; BSUtils.LoaderLook(cboTipoCapacitacion, new TipoCapacitacionBL().ListaCombo(Parametros.intEmpresaId), "DescTipoCapacitacion", "IdTipoCapacitacion", true); if (pOperacion == Operacion.Nuevo) { this.Text = "Tema Virtual - Nuevo"; IdSituacion = Parametros.intTEMAActivo; } else if (pOperacion == Operacion.Modificar) { this.Text = "Tema Virtual - Modificar"; TemaBE objE_Tema = null; objE_Tema = new TemaBL().Selecciona(Parametros.intEmpresaId, IdTema); if (objE_Tema != null) { cboCategoriaTema.EditValue = objE_Tema.IdCategoriaTema; txtPeriodo.EditValue = objE_Tema.Periodo; txtObjetivo.Text = objE_Tema.Objetivo; txtDescripcion.Text = objE_Tema.DescTema; deFechaIni.DateTime = objE_Tema.FechaIni; deFechaFin.DateTime = objE_Tema.FechaFin; txtHoras.EditValue = objE_Tema.Horas; if (objE_Tema.Logo != null) { this.picImage.Image = new FuncionBase().Bytes2Image((byte[])objE_Tema.Logo); } else { this.picImage.Image = SSOMA.Presentacion.Properties.Resources.noImage; } if (objE_Tema.Firma1 != null) { this.picFirma.Image = new FuncionBase().Bytes2Image((byte[])objE_Tema.Firma1); } else { this.picFirma.Image = SSOMA.Presentacion.Properties.Resources.firma; } IdSituacion = objE_Tema.IdSituacion; txtResponsable.Text = objE_Tema.Responsable; txtResponsableCargo.Text = objE_Tema.ResponsableCargo; txtResponsableEmpresa.Text = objE_Tema.ResponsableEmpresa; cboTipoCapacitacion.EditValue = objE_Tema.IdTipoCapacitacion; } } txtObjetivo.Select(); CargaTemaDetalle(); }
private void tileView1_DoubleClick(object sender, EventArgs e) { if (tileView1.RowCount > 0) { int intIdTema = int.Parse(tileView1.GetFocusedRowCellValue("IdTema").ToString()); string strDescTema = tileView1.GetFocusedRowCellValue("DescTema").ToString(); TemaBE objE_Tema = null; objE_Tema = new TemaBL().Selecciona(0, intIdTema); if (objE_Tema != null) { if (objE_Tema.IdSituacion == Parametros.intTEMAInactivo) { XtraMessageBox.Show("El Curso se encuentra inactivo no puede ingresar", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } List <TemaPersonaBE> lstTemaPersona = null; lstTemaPersona = new TemaPersonaBL().ListaTodosActivo(0, intIdTema, Parametros.intPersonaId); if (lstTemaPersona.Count == 0) { XtraMessageBox.Show("Ud. No tiene permiso para ingresar al curso virtual.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } List <ResumenPersonaBE> lstResumenPersona = null; lstResumenPersona = new ResumenPersonaBL().ListaTodosActivo(0, intIdTema, Parametros.intPersonaId); if (lstResumenPersona.Count == 1) { if (lstResumenPersona[0].Situacion == "APROBADO") { XtraMessageBox.Show("Ud. se encuentra aprobadado en el curso, no puede ingresar.", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } int intCuentaDesaprobado = 0; intCuentaDesaprobado = new ResumenPersonaBL().CuentaDesaprobado(0, Parametros.intPersonaId, intIdTema); if (intCuentaDesaprobado == 2) { XtraMessageBox.Show("Ud. Tiene dos intentos desaprobados del curso virtual\n Comuníquese con el correo: [email protected]", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } frmRegCapacitacionVirtualEdit frm = new frmRegCapacitacionVirtualEdit(); frm.intIdTema = intIdTema; frm.strDescTema = strDescTema; frm.strParticipante = Parametros.strUsuarioNombres; frm.Show(); } } }
public HttpResponseMessage ObtenerPorCoincidencia(string descripcion = null) { var resultado = (HttpResponseMessage)null; try { resultado = Request.CreateResponse(HttpStatusCode.OK, TemaBL.ObtenerPorCoincidenciaDescripcion(descripcion)); } catch (Exception exception) { resultado = Request.CreateResponse(HttpStatusCode.InternalServerError, new { message = exception.Message }); } return(resultado); }
public ReportesPage() { reporteBL = new ReporteBL(); usuarioBL = new UsuarioBL(); temaBL = new TemaBL(); Usuarios = usuarioBL.Listar(); Temas = temaBL.Listar(); InitializeComponent(); LoadAuditoria(); LoadSesionesPorUsuario(); LoadSesionesPorGrupo(); LoadIniciativas(); LoadParticipacion(); LoadTareas(); }
void CargaTreeviewTemas(TreeNode nodo) { nodo.Nodes.Clear(); List <TemaBE> lstTema = null; lstTema = new TemaBL().ListaTodosActivo(0, IdCategoriaTema, Parametros.intTEMAVirtual, Parametros.intTEMAActivo, Parametros.intPeriodo); foreach (var item in lstTema) { TreeNode nuevoNodoChild = new TreeNode(); nuevoNodoChild.ImageIndex = 2; nuevoNodoChild.SelectedImageIndex = 2; nuevoNodoChild.Text = item.DescTema; nuevoNodoChild.Tag = "TEM" + item.IdTema.ToString(); nodo.Nodes.Add(nuevoNodoChild); } }
private void btnGrabar_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; if (!ValidarIngreso()) { TemaBL objBL_Tema = new TemaBL(); TemaBE objTema = new TemaBE(); objTema.IdEmpresa = Parametros.intEmpresaId; objTema.IdTema = IdTema; objTema.Periodo = Convert.ToInt32(txtPeriodo.EditValue); objTema.IdCategoriaTema = Convert.ToInt32(cboCategoriaTema.EditValue); objTema.IdTipoTema = Parametros.intTEMAVirtual; objTema.Objetivo = txtObjetivo.Text; objTema.DescTema = txtDescripcion.Text; objTema.FechaIni = Convert.ToDateTime(deFechaIni.DateTime.ToShortDateString()); objTema.FechaFin = Convert.ToDateTime(deFechaFin.DateTime.ToShortDateString()); objTema.Horas = Convert.ToInt32(txtHoras.EditValue); objTema.Logo = new FuncionBase().Image2Bytes(this.picImage.Image); objTema.Firma1 = new FuncionBase().Image2Bytes(this.picFirma.Image); objTema.Firma2 = new FuncionBase().Image2Bytes(this.picFirma2.Image); objTema.Responsable = txtResponsable.Text; objTema.ResponsableCargo = txtResponsableCargo.Text; objTema.ResponsableEmpresa = txtResponsableEmpresa.Text; objTema.IdTipoCapacitacion = Convert.ToInt32(cboTipoCapacitacion.EditValue); objTema.IdSituacion = IdSituacion; objTema.FlagEstado = true; objTema.Usuario = Parametros.strUsuarioLogin; objTema.Maquina = WindowsIdentity.GetCurrent().Name.ToString(); List <TemaDetalleBE> lstTemaDetalle = new List <TemaDetalleBE>(); foreach (var item in mListaTemaDetalleOrigen) { TemaDetalleBE objE_TemaDetalle = new TemaDetalleBE(); objE_TemaDetalle.IdEmpresa = item.IdEmpresa; objE_TemaDetalle.IdTemaDetalle = item.IdTemaDetalle; objE_TemaDetalle.IdTema = item.IdTema; objE_TemaDetalle.Archivo = item.Archivo; objE_TemaDetalle.NombreArchivo = item.NombreArchivo; objE_TemaDetalle.Extension = item.Extension; objE_TemaDetalle.Descripcion = item.Descripcion; objE_TemaDetalle.TipoOper = item.TipoOper; objE_TemaDetalle.FlagEstado = true; objE_TemaDetalle.Usuario = Parametros.strUsuarioLogin; objE_TemaDetalle.Maquina = WindowsIdentity.GetCurrent().Name.ToString(); objE_TemaDetalle.TipoOper = item.TipoOper; lstTemaDetalle.Add(objE_TemaDetalle); } if (pOperacion == Operacion.Nuevo) { objBL_Tema.Inserta(objTema, lstTemaDetalle); } else { objBL_Tema.Actualiza(objTema, lstTemaDetalle); } this.Close(); } } catch (Exception ex) { Cursor = Cursors.Default; XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnGrabar_Click(object sender, EventArgs e) { try { Cursor = Cursors.WaitCursor; TemaPersonaBL objBL_TemaPersona = new TemaPersonaBL(); objBL_TemaPersona.Actualiza(mLista, IdTema, Parametros.strUsuarioLogin, WindowsIdentity.GetCurrent().Name.ToString()); XtraMessageBox.Show("La matricula se realizó correctamente. ", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information); Cargar(); string strFechaIni = ""; string strFechaFin = ""; int intDuracion = 0; TemaBE objE_Tema = null; objE_Tema = new TemaBL().Selecciona(0, IdTema); if (objE_Tema != null) { strFechaIni = objE_Tema.FechaIni.ToString("dd/MM/yyyy"); strFechaFin = objE_Tema.FechaFin.ToString("dd/MM/yyyy"); intDuracion = objE_Tema.Horas; } //ENVIO DE CORREO StringBuilder strMensaje = new StringBuilder(); strMensaje.Append("*****************************************************************************\n\n"); strMensaje.Append("Tema : " + strDescTema + "\n"); strMensaje.Append("Fecha de Vigencia : " + "DEL " + strFechaIni + "AL " + strFechaFin + "\n"); strMensaje.Append("Duración : " + intDuracion.ToString() + " Horas" + "\n"); int i = 1; foreach (var item in mLista) { if (item.FlagMatricula) { strMensaje.Append(" " + item.ApeNom + "\n\n"); } i = i + 1; } strMensaje.Append("SE ADJUNTA EL MANUAL DE USUARIO\n\n"); strMensaje.Append("*****************************************************************************\n\n"); string strMailTO = "*****@*****.**"; foreach (var itempersona in mLista) { if (itempersona.FlagMatricula) { PersonaBE objE_Persona = new PersonaBE(); objE_Persona = new PersonaBL().Selecciona(0, 0, 0, itempersona.IdPersona); if (objE_Persona != null) { if (objE_Persona.Email.Length > 0 && objE_Persona.Email != "*****@*****.**") { strMailTO = strMailTO + ";" + objE_Persona.Email; } } } } string filename = Path.Combine(Directory.GetCurrentDirectory(), "Pdf\\Manual_SSOMA_Capacitacion.pdf"); BSUtils.EmailSend(strMailTO, "MATRÍCULA DE CAPACITACIÓN VIRTUAL", strMensaje.ToString(), filename, "", "", ""); Application.DoEvents(); Cursor = Cursors.Default; } catch (Exception ex) { Cursor = Cursors.Default; XtraMessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error); } }