public XElement InsertarActualizarCompetencia(string pTipoTransaccion, E_COMPETENCIA_NIVEL vCompetencia, string pClUsuario, string pNbPrograma) { using (context = new SistemaSigeinEntities()) { //Declaramos el objeto de valor de retorno ObjectParameter pout_clave_retorno = new ObjectParameter("XML_RESULTADO", typeof(XElement)); context.SPE_INSERTA_ACTUALIZA_C_COMPETENCIA(pout_clave_retorno, vCompetencia.ID_COMPETENCIA, vCompetencia.CL_COMPETENCIA, vCompetencia.NB_COMPETENCIA, vCompetencia.DS_COMPETENCIA, vCompetencia.CL_TIPO_COMPETENCIA, vCompetencia.CL_CLASIFICACION, vCompetencia.FG_ACTIVO, vCompetencia.DS_NIVEL_COMPETENCIA_PUESTO_N0, vCompetencia.DS_NIVEL_COMPETENCIA_PERSONA_N0, vCompetencia.DS_NIVEL_COMPETENCIA_PUESTO_N1, vCompetencia.DS_NIVEL_COMPETENCIA_PERSONA_N1, vCompetencia.DS_NIVEL_COMPETENCIA_PUESTO_N2, vCompetencia.DS_NIVEL_COMPETENCIA_PERSONA_N2, vCompetencia.DS_NIVEL_COMPETENCIA_PUESTO_N3, vCompetencia.DS_NIVEL_COMPETENCIA_PERSONA_N3, vCompetencia.DS_NIVEL_COMPETENCIA_PUESTO_N4, vCompetencia.DS_NIVEL_COMPETENCIA_PERSONA_N4, vCompetencia.DS_NIVEL_COMPETENCIA_PUESTO_N5, vCompetencia.DS_NIVEL_COMPETENCIA_PERSONA_N5, vCompetencia.XML_CAMPOS_ADICIONALES, pClUsuario, pClUsuario, pNbPrograma, pNbPrograma, pTipoTransaccion); //regresamos el valor de retorno de sql return(XElement.Parse(pout_clave_retorno.Value.ToString())); } }
protected void btnSave_click(object sender, EventArgs e) { //GuardarDatos(); string tipo_transaccion = ""; CompetenciaNegocio nccompetencia = new CompetenciaNegocio(); E_COMPETENCIA_NIVEL vObjetoAgregar = new E_COMPETENCIA_NIVEL(); string clave = txtClave.Text; string nbclasificacion = txtNbCompetencia.Text; string descripcion = txtDescripcion.Text; //EDITAR if (!ptipo.Equals("Agregar")) { if (ptipo.Equals("Editar")) { vObjetoAgregar.ID_COMPETENCIA = vIdCompetencia; tipo_transaccion = E_TIPO_OPERACION_DB.A.ToString(); } else { tipo_transaccion = E_TIPO_OPERACION_DB.I.ToString(); vObjetoAgregar.ID_COMPETENCIA = 1; } vObjetoAgregar.CL_COMPETENCIA = txtClave.Text; vObjetoAgregar.NB_COMPETENCIA = txtNbCompetencia.Text; vObjetoAgregar.DS_COMPETENCIA = txtDescripcion.Text; vObjetoAgregar.CL_TIPO_COMPETENCIA = cmbCategoria.SelectedValue; vObjetoAgregar.CL_CLASIFICACION = cmbClasificaciones.SelectedValue; vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N0 = radEditorPersona0.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N0 = radEditorPuesto0.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N1 = radEditorPersona1.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N1 = radEditorPuesto1.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N2 = radEditorPersona2.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N2 = radEditorPuesto2.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N3 = radEditorPersona3.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N3 = radEditorPuesto3.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N4 = radEditorPersona4.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N4 = radEditorPuesto4.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N5 = radEditorPersona5.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N5 = radEditorPuesto5.Content.Replace("<", ""); vObjetoAgregar.XML_CAMPOS_ADICIONALES = null; vObjetoAgregar.FG_ACTIVO = chkActivo.Checked; if (vObjetoAgregar.CL_COMPETENCIA != "" && vObjetoAgregar.NB_COMPETENCIA != "") { E_RESULTADO vResultado = nccompetencia.InsertaActualizaCompetencia(pTipoTransaccion: tipo_transaccion, pClUsuario: vClUsuario, pNbPrograma: vNbPrograma, pCompetencia: vObjetoAgregar); string vMensaje = vResultado.MENSAJE.Where(w => w.CL_IDIOMA.Equals(vClIdioma.ToString())).FirstOrDefault().DS_MENSAJE; UtilMensajes.MensajeResultadoDB(rnMensaje, vMensaje, vResultado.CL_TIPO_ERROR); } else { UtilMensajes.MensajeResultadoDB(rnMensaje, "Los campos Clave y Competencia no pueden ser vacios.", E_TIPO_RESPUESTA_DB.WARNING, pCallBackFunction: ""); } } else { //AGREGAR radEditorPersona0.EditModes = radEditorPersona0.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPuesto0.EditModes = radEditorPuesto0.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPersona1.EditModes = radEditorPersona1.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPuesto1.EditModes = radEditorPuesto1.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPersona2.EditModes = radEditorPersona2.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPuesto2.EditModes = radEditorPuesto2.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPersona3.EditModes = radEditorPersona3.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPuesto3.EditModes = radEditorPuesto3.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPersona4.EditModes = radEditorPersona4.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPuesto4.EditModes = radEditorPuesto4.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPersona5.EditModes = radEditorPersona5.EditModes ^ Telerik.Web.UI.EditModes.Html; radEditorPuesto5.EditModes = radEditorPuesto5.EditModes ^ Telerik.Web.UI.EditModes.Html; vObjetoAgregar.ID_COMPETENCIA = 1; vObjetoAgregar.CL_COMPETENCIA = txtClave.Text; vObjetoAgregar.NB_COMPETENCIA = txtNbCompetencia.Text; vObjetoAgregar.DS_COMPETENCIA = txtDescripcion.Text; vObjetoAgregar.CL_TIPO_COMPETENCIA = cmbCategoria.SelectedValue; vObjetoAgregar.CL_CLASIFICACION = cmbClasificaciones.SelectedValue; vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N0 = radEditorPersona0.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N0 = radEditorPuesto0.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N1 = radEditorPersona1.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N1 = radEditorPuesto1.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N2 = radEditorPersona2.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N2 = radEditorPuesto2.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N3 = radEditorPersona3.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N3 = radEditorPuesto3.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N4 = radEditorPersona4.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N4 = radEditorPuesto4.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PERSONA_N5 = radEditorPersona5.Content.Replace("<", ""); vObjetoAgregar.DS_NIVEL_COMPETENCIA_PUESTO_N5 = radEditorPuesto5.Content.Replace("<", ""); vObjetoAgregar.XML_CAMPOS_ADICIONALES = null; vObjetoAgregar.FG_ACTIVO = chkActivo.Checked; if (vObjetoAgregar.CL_COMPETENCIA != "" && vObjetoAgregar.NB_COMPETENCIA != "") { E_RESULTADO vResultado = nccompetencia.InsertaActualizaCompetencia(pTipoTransaccion: E_TIPO_OPERACION_DB.I.ToString(), pClUsuario: vClUsuario, pNbPrograma: vNbPrograma, pCompetencia: vObjetoAgregar); string vMensaje = vResultado.MENSAJE.Where(w => w.CL_IDIOMA.Equals(vClIdioma.ToString())).FirstOrDefault().DS_MENSAJE; UtilMensajes.MensajeResultadoDB(rnMensaje, vMensaje, vResultado.CL_TIPO_ERROR); } else { UtilMensajes.MensajeResultadoDB(rnMensaje, "Los campos Clave y Competencia no pueden ser vacios.", E_TIPO_RESPUESTA_DB.WARNING, pCallBackFunction: ""); } } }
public E_RESULTADO InsertaActualizaCompetencia(string pTipoTransaccion, E_COMPETENCIA_NIVEL pCompetencia, string pClUsuario, string pNbPrograma) { CompetenciaOperaciones oCompetencia = new CompetenciaOperaciones(); return(UtilRespuesta.EnvioRespuesta(oCompetencia.InsertarActualizarCompetencia(pTipoTransaccion, pCompetencia, pClUsuario, pNbPrograma))); }