public WfrmReporteAsistencia() { this.bllEvento = new BLLEvento(); }
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { BLLEvento BLLEvento = new BLLEvento(); CEvento evento = new CEvento(); string msg = "Registro Correcto"; bool correcto = true; evento.Descripcion = Convert.ToString(e.OldValues["IdEvento.Descripcion"]); evento = (BLLEvento.Read(evento, ParameterToSearch.Descripcion) as CEvento); if (EnumUtil.ParseEnum<AsocState>(e.OldValues["Confirmado"].ToString()).Equals(AsocState.No)) { msg = "El asociado no confirmo su asistencia"; correcto = false; } if (EnumUtil.ParseEnum<UserState>(e.OldValues["Estado"].ToString()).Equals(UserState.Inactivo)) { msg = "El asociado esta inactivo"; correcto = false; } if (evento.Estado == EstadoEvento.Cerrado) { msg = "No se puede modificar un evento Cerrado"; correcto = false; } if (correcto) { try { if (HttpContext.Current.User.Identity.IsAuthenticated) { if (HttpContext.Current.User.Identity is FormsIdentity) { FormsIdentity id = (FormsIdentity)HttpContext.Current.User.Identity; FormsAuthenticationTicket ticket = id.Ticket; string usuario = id.Ticket.Name; CAsociado asocidado = new CAsociado(); string IdAsociado = Convert.ToString(e.OldValues["IdAsociado.Id"]); asocidado.Id = IdAsociado; CBitacora CBitacora = new CBitacora(); CBitacora.IdEvento = evento; CBitacora.IdAsociado = asocidado; CBitacora.UsuarioModificacion = usuario; CBitacora.Presente = Convert.ToBoolean(e.NewValues["Presente"]); string asist = BLLBitacora.Update(CBitacora); e.Cancel = true; this.ASPxGridView1.CancelEdit(); this.RefreshData(); // Filter record updated string registro = e.OldValues["IdAsociado.Id"].ToString(); this.UpdateLastPosting(registro, "IdAsociado.Id"); } } } catch (Exception error) { e.Cancel = true; this.ASPxGridView1.CancelEdit(); this.ASPxGridView1.Settings.ShowTitlePanel = true; this.ASPxGridView1.SettingsText.Title = error.Message; } } else { e.Cancel = true; this.ASPxGridView1.CancelEdit(); this.ASPxGridView1.Settings.ShowTitlePanel = true; this.ASPxGridView1.SettingsText.Title = msg; } }