void SelectDoctor() { BPFuncionario oBPFuncionario = new BPFuncionario(); ENTFuncionario oENTFuncionario = new ENTFuncionario(); ENTResponse oENTResponse = new ENTResponse(); try { // Formulario oENTFuncionario.FuncionarioId = 0; oENTFuncionario.idUsuario = 0; oENTFuncionario.idArea = 0; oENTFuncionario.idRol = 14; // Atención a Víctimas - Doctor oENTFuncionario.TituloId = 0; oENTFuncionario.PuestoId = 0; oENTFuncionario.Nombre = ""; // Transacción oENTResponse = oBPFuncionario.SelectFuncionario(oENTFuncionario); // Errores if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } // Warnings if (oENTResponse.sMessage != "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('" + oENTResponse.sMessage + "');", true); } // Llenado de control this.ddlDoctor.DataTextField = "sFullName"; this.ddlDoctor.DataValueField = "FuncionarioId"; this.ddlDoctor.DataSource = oENTResponse.dsResponse.Tables[1]; this.ddlDoctor.DataBind(); // Opción todos this.ddlDoctor.Items.Insert(0, new ListItem("[Seleccione]", "0")); }catch (Exception ex){ throw (ex); } }
void SelectFuncionario() { ENTFuncionario oENTFuncionario = new ENTFuncionario(); BPFuncionario BPFuncionario = new BPFuncionario(); ENTResponse oENTResponse = new ENTResponse(); BPFuncionario.SelectFuncionarioBusqueda(); ddlFuncionario.DataValueField = "FuncionarioId"; ddlFuncionario.DataTextField = "Nombre"; ddlFuncionario.DataSource = BPFuncionario.FuncionarioEntity.ResultData.Tables[1]; ddlFuncionario.DataBind(); ddlFuncionario.Items.Insert(0, new ListItem("[Todos]", "0")); }
void SelectFuncionario() { ENTFuncionario oENTFuncionario = new ENTFuncionario(); ENTResponse oENTResponse = new ENTResponse(); BPFuncionario oBPFuncionario = new BPFuncionario(); try { // Formulario oENTFuncionario.FuncionarioId = 0; oENTFuncionario.idUsuario = 0; oENTFuncionario.idArea = 0; oENTFuncionario.idRol = 11; // Seguimiento - Defensor oENTFuncionario.TituloId = 0; oENTFuncionario.PuestoId = 0; oENTFuncionario.Nombre = ""; // Transacción oENTResponse = oBPFuncionario.SelectFuncionario(oENTFuncionario); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } // Mensaje de la BD if (oENTResponse.sMessage != "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('" + gcJavascript.ClearText(oENTResponse.sMessage) + "');", true); } // Llenado de combo this.ddlFuncionario.DataTextField = "sFullName"; this.ddlFuncionario.DataValueField = "FuncionarioId"; this.ddlFuncionario.DataSource = oENTResponse.dsResponse.Tables[1]; this.ddlFuncionario.DataBind(); // Agregar Item de selección this.ddlFuncionario.Items.Insert(0, new ListItem("[Seleccione]", "0")); }catch (Exception ex){ throw (ex); } }
private void UpdateFuncionario(Int32 idFuncionario) { ENTFuncionario oENTFuncionario = new ENTFuncionario(); ENTResponse oENTResponse = new ENTResponse(); BPFuncionario oBPFuncionario = new BPFuncionario(); try { // Formulario oENTFuncionario.FuncionarioId = idFuncionario; oENTFuncionario.idUsuario = this.wucBusquedaUsuario.UsuarioID; oENTFuncionario.TituloId = Int16.Parse(this.ddlActionTitulo.SelectedValue); oENTFuncionario.PuestoId = Int16.Parse(this.ddlActionPuesto.SelectedValue); oENTFuncionario.FechaIngreso = this.wucCalendar.BeginDate; // Transacción oENTResponse = oBPFuncionario.UpdateFuncionario(oENTFuncionario); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); } // Transacción exitosa ClearActionPanel(); // Actualizar grid SelectFuncionario(); // Mensaje de usuario ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('Información actualizada con éxito!'); focusControl('" + this.ddlArea.ClientID + "');", true); }catch (Exception ex){ throw (ex); } }
private void SelectFuncionario_ForEdit(Int32 idFuncionario) { ENTFuncionario oENTFuncionario = new ENTFuncionario(); ENTResponse oENTResponse = new ENTResponse(); BPFuncionario oBPFuncionario = new BPFuncionario(); try { // Formulario oENTFuncionario.FuncionarioId = idFuncionario; oENTFuncionario.idUsuario = 0; oENTFuncionario.idArea = 0; oENTFuncionario.TituloId = 0; oENTFuncionario.PuestoId = 0; oENTFuncionario.Nombre = ""; // Transacción oENTResponse = oBPFuncionario.SelectFuncionario(oENTFuncionario); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } // Mensaje de la BD this.lblActionMessage.Text = oENTResponse.sMessage; // Llenado de formulario this.ddlActionPuesto.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["PuestoId"].ToString(); this.ddlActionTitulo.SelectedValue = oENTResponse.dsResponse.Tables[1].Rows[0]["TituloId"].ToString(); this.wucBusquedaUsuario.UsuarioID = Int32.Parse(oENTResponse.dsResponse.Tables[1].Rows[0]["idUsuario"].ToString()); this.wucBusquedaUsuario.Area = oENTResponse.dsResponse.Tables[1].Rows[0]["sArea"].ToString(); this.wucCalendar.SetDate = oENTResponse.dsResponse.Tables[1].Rows[0]["dtFechaIngreso"].ToString(); }catch (Exception ex){ throw (ex); } }
private void SelectFuncionario() { ENTFuncionario oENTFuncionario = new ENTFuncionario(); ENTResponse oENTResponse = new ENTResponse(); BPFuncionario oBPFuncionario = new BPFuncionario(); String sMessage = ""; try { // Formulario oENTFuncionario.FuncionarioId = 0; oENTFuncionario.idUsuario = 0; oENTFuncionario.idArea = Int32.Parse(this.ddlArea.SelectedItem.Value); oENTFuncionario.TituloId = 0; oENTFuncionario.PuestoId = 0; oENTFuncionario.Nombre = this.txtNombre.Text; // Transacción oENTResponse = oBPFuncionario.SelectFuncionario(oENTFuncionario); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } // Mensaje de la BD if (oENTResponse.sMessage != "") { sMessage = "alert('" + oENTResponse.sMessage + "');"; } // Llenado de controles this.gvFuncionario.DataSource = oENTResponse.dsResponse.Tables[1]; this.gvFuncionario.DataBind(); // Mensaje al usuario ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), sMessage, true); }catch (Exception ex){ throw (ex); } }
private void DeleteFuncionario(Int32 idFuncionario) { ENTFuncionario oENTFuncionario = new ENTFuncionario(); ENTResponse oENTResponse = new ENTResponse(); BPFuncionario oBPFuncionario = new BPFuncionario(); try { // Formulario oENTFuncionario.FuncionarioId = idFuncionario; // Transacción oENTResponse = oBPFuncionario.DeleteFuncionario(oENTFuncionario); // Validaciones if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } if (oENTResponse.sMessage != "") { throw (new Exception(oENTResponse.sMessage)); } // Transacción exitosa ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('Funcionario eliminado con éxito!');", true); // Actualizar datos SelectFuncionario(); }catch (Exception ex){ throw (ex); } }
void SelectFuncionario() { BPFuncionario oBPFuncionario = new BPFuncionario(); ENTFuncionario oENTFuncionario = new ENTFuncionario(); ENTResponse oENTResponse = new ENTResponse(); try { // Formulario oENTFuncionario.FuncionarioId = 0; oENTFuncionario.idUsuario = 0; oENTFuncionario.idRol = 8; // Visitaduría - Visitador oENTFuncionario.TituloId = 0; oENTFuncionario.PuestoId = 0; oENTFuncionario.Nombre = ""; // Si el área es coordinaci;on penitenciaria, se muestras los funcionarios de la tercer visitaduría oENTFuncionario.idArea = (this.hddAreaId.Value == "10" ? 6 : Int32.Parse(this.hddAreaId.Value)); // Transacción oENTResponse = oBPFuncionario.SelectFuncionario(oENTFuncionario); // Errores if (oENTResponse.GeneratesException) { throw (new Exception(oENTResponse.sErrorMessage)); } // Warnings if (oENTResponse.sMessage != "") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), Convert.ToString(Guid.NewGuid()), "alert('" + oENTResponse.sMessage + "');", true); } // Llenado de control this.ddlFuncionario.DataTextField = "sFullName"; this.ddlFuncionario.DataValueField = "FuncionarioId"; this.ddlFuncionario.DataSource = oENTResponse.dsResponse.Tables[1]; this.ddlFuncionario.DataBind(); // Opción todos this.ddlFuncionario.Items.Insert(0, new ListItem("[Seleccione]", "0")); }catch (Exception ex){ throw (ex); } }