/// <summary> /// Carrega as informações da matriz que esta sendo alterada /// </summary> private void CarregaDados() { ORC_MatrizHabilidades entity = new ORC_MatrizHabilidades(); entity.mat_id = VS_mat_id; ORC_MatrizHabilidadesBO.GetEntity(entity); txtNome.Text = entity.mat_nome; ckbPadrao.Checked = entity.mat_padrao; }
/// <summary> /// Salva os dados da linha do objetivo. /// </summary> /// <param name="item">Item que contém os dados do objetivo.</param> private void Salvar() { try { ORC_MatrizHabilidades entMatriz = new ORC_MatrizHabilidades(); entMatriz.mat_id = VS_mat_id; ORC_MatrizHabilidadesBO.GetEntity(entMatriz); entMatriz.ent_id = __SessionWEB.__UsuarioWEB.Usuario.ent_id; entMatriz.mat_nome = txtNome.Text; entMatriz.mat_padrao = ckbPadrao.Checked; entMatriz.mat_situacao = 1; if (ORC_MatrizHabilidadesBO.Salvar(entMatriz)) { if (VS_mat_id <= 0) { ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Insert, "VS_mat_id: " + entMatriz.mat_id); __SessionWEB.PostMessages = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "MatrizHabilidades.Cadastro.lblMensagem.SucessoInclusao").ToString(), UtilBO.TipoMensagem.Sucesso); } else { ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Update, "VS_mat_id: " + entMatriz.mat_id); __SessionWEB.PostMessages = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "MatrizHabilidades.Cadastro.lblMensagem.SucessoAlteracao").ToString(), UtilBO.TipoMensagem.Sucesso); } Response.Redirect("~/Academico/MatrizHabilidades/Busca.aspx", false); HttpContext.Current.ApplicationInstance.CompleteRequest(); } else { lblMensagem.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "MatrizHabilidades.Cadastro.lblMensagem.ErroSalvar").ToString(), UtilBO.TipoMensagem.Erro); } } catch (ValidationException ex) { lblMensagem.Text = UtilBO.GetErroMessage(ex.Message, UtilBO.TipoMensagem.Alerta); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMensagem.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "MatrizHabilidades.Cadastro.lblMensagem.ErroSalvar").ToString(), UtilBO.TipoMensagem.Erro); } }
protected void gvMatriz_RowCommand(object sender, GridViewCommandEventArgs e) { if (e != null && e.CommandName != "Page") { int index = int.Parse(e.CommandArgument.ToString()); int mat_id = Convert.ToInt32(gvMatriz.DataKeys[index].Values[0]); if (e.CommandName == "Deletar") { try { ORC_MatrizHabilidades entity = new ORC_MatrizHabilidades { mat_id = mat_id }; ORC_MatrizHabilidadesBO.GetEntity(entity); if (ORC_MatrizHabilidadesBO.Delete(entity)) { Pesquisar(); ApplicationWEB._GravaLogSistema(LOG_SistemaTipo.Delete, "mat_id: " + mat_id); lblMensagem.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "MatrizHabilidades.Busca.gvMatriz.SucessoExclusao").ToString(), UtilBO.TipoMensagem.Sucesso); } } catch (ValidationException ex) { ApplicationWEB._GravaErro(ex); lblMensagem.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "MatrizHabilidades.Busca.gvMatriz.ErroValidaExclusao").ToString(), UtilBO.TipoMensagem.Erro); } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMensagem.Text = UtilBO.GetErroMessage(GetGlobalResourceObject("Academico", "MatrizHabilidades.Busca.gvMatriz.ErroExclusao").ToString(), UtilBO.TipoMensagem.Erro); } } } }
protected void Page_Load(object sender, EventArgs e) { try { ScriptManager sm = ScriptManager.GetCurrent(this); if (sm != null) { sm.Scripts.Add(new ScriptReference(ArquivoJS.MsgConfirmExclusao)); } if ((PreviousPage != null) && PreviousPage.IsCrossPagePostBack) { VS_cal_id = PreviousPage.EditItem_cal_id; VS_cur_id = PreviousPage.EditItem_cur_id; VS_crr_id = PreviousPage.EditItem_crr_id; VS_crp_id = PreviousPage.EditItem_crp_id; VS_tds_id = PreviousPage.EditItem_tds_id; VS_mat_id = PreviousPage.EditItem_mat_id; ORC_MatrizHabilidades entMatriz = new ORC_MatrizHabilidades(); entMatriz.mat_id = VS_mat_id; ORC_MatrizHabilidadesBO.GetEntity(entMatriz); // Mostra o label com os dados selecionados. lblInformacao.Text = "<b>Calendário escolar: </b>" + PreviousPage.EditItem_calendario + "<br/>"; lblInformacao.Text += "<b>" + GestaoEscolarUtilBO.nomePadraoCurso(__SessionWEB.__UsuarioWEB.Usuario.ent_id) + ": </b>" + PreviousPage.EditItem_curso + "<br/>"; lblInformacao.Text += "<b>" + GestaoEscolarUtilBO.nomePadraoPeriodo(__SessionWEB.__UsuarioWEB.Usuario.ent_id) + ": </b>" + PreviousPage.EditItem_grupamento + "<br/>"; lblInformacao.Text += "<b>" + GetGlobalResourceObject("Mensagens", "MSG_DISCIPLINA") + ": </b>" + PreviousPage.EditItem_tipoDisciplina + "<br />"; lblInformacao.Text += "<b>Nome da matriz: </b>" + entMatriz.mat_nome + "<br/>"; lblInformacao.Text += "<b>Matriz padrão: </b>" + (entMatriz.mat_padrao ? "Sim" : "Não") + "<br/>"; CarregaNiveis(false); } } catch (Exception ex) { ApplicationWEB._GravaErro(ex); lblMensagem.Text = UtilBO.GetErroMessage("Erro ao tentar carregar a página.", UtilBO.TipoMensagem.Erro); } }
protected void gvMatriz_DataBound(object sender, EventArgs e) { UCTotalRegistros.Total = ORC_MatrizHabilidadesBO.GetTotalRecords(); ConfiguraColunasOrdenacao(gvMatriz); }