protected void RegistrarNuevoMOI() { string cleanMessage = string.Empty; int rpta; string requerimiento = Convert.ToString(Session["ID_DETALLE_REQUERIMIENTO_PERSONAL"]); string dni = Convert.ToString(Session["DES_DNI"]); string responsable = Convert.ToString(Session["IDE_USUARIO"]); rpta = new BL_PERSONAL().Mant_Insert_OperariosNuevosMoi(requerimiento, dni, responsable); if (rpta > 0) { // consultarEmpleado(txtDNI.Text); cleanMessage = "Registro Satisfactorio"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); lblIde_MOI.Text = rpta.ToString(); BL_PERSONAL obj = new BL_PERSONAL(); DataTable dtResultado = new DataTable(); dtResultado = obj.BuscarDNI_MOI(Convert.ToInt32(lblIde_MOI.Text)); Estado(); PanelDatos.Visible = true; txtDNI.ReadOnly = true; txtNombre.ReadOnly = true; } }
protected void RegistrarMOI() { string cleanMessage = string.Empty; BE_MOI oBEPersonal = new BE_MOI(); oBEPersonal = f_CapturarDatos(); int rpta; rpta = new BL_PERSONAL().Mant_Insert_Operarios(oBEPersonal); if (rpta > 0) { // consultarEmpleado(txtDNI.Text); cleanMessage = "Registro Satisfactorio"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); lblIde_MOI.Text = rpta.ToString(); BL_PERSONAL obj = new BL_PERSONAL(); DataTable dtResultado = new DataTable(); dtResultado = obj.BuscarDNI_MOI(Convert.ToInt32(lblIde_MOI.Text)); Estado(); PanelDatos.Visible = true; txtDNI.ReadOnly = true; txtNombre.ReadOnly = true; //Response.Redirect("frmRequerimiento.aspx");//?id=123 //ClientScript.RegisterStartupScript(typeof(Page), "closePage", "window.open('frmMOI.aspx', '_self', null);", true); //ScriptManager.RegisterStartupScript(this, typeof(Page), "closePage", "window.open('frmMOI.aspx', '_self', null);", true); } }
protected void consultarEmpleado(string dni) { string cleanMessage = string.Empty; if (dni == string.Empty) { cleanMessage = "Ingresar Nombre o DNI a consultar"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { BL_PERSONAL objPersona = new BL_PERSONAL(); DataTable dtResul = new DataTable(); int i = 0; int j = 0; char[] letras = dni.ToCharArray(); for (i = 0; i < dni.Length; i++) { if (letras[i] == '-') { j = i; break; } } if (j > 0) { dtResul = objPersona.BuscarDNI(dni.Substring(0, j - 1)); } else { dtResul = objPersona.BuscarDNI(dni); } limpiar(); if (dtResul.Rows.Count > 0) { //lblPersonal.Text = dtResul.Rows[0]["DES_NOMBRE"].ToString(); int idPersona = Convert.ToInt32(dtResul.Rows[0]["IDE_EMPLEADO"].ToString()); //lblIdPersonal.Text = dtResul.Rows[0]["IDE_EMPLEADO"].ToString(); BL_PERSONAL obj = new BL_PERSONAL(); DataTable dtResultado = new DataTable(); dtResultado = obj.BuscarDNI_MOI(idPersona); if (dtResultado.Rows.Count > 0) { ModalRegistro.Show(); int EnProcesos = Convert.ToInt32(dtResultado.Rows[0]["EN_PROCESO"].ToString()); if (EnProcesos > 0) { // btnAsignar.Visible = false; //////btnNo.Visible = false; btnCerrar.Visible = true; } else { // btnAsignar.Visible = true; //btnNo.Visible = true; btnCerrar.Visible = false; } gridPersonal.DataSource = dtResultado; gridPersonal.DataBind(); } else { // REGISTRO NUEVOS //lblIde_MOI.Text = "0"; Estado(); //PanelDatos.Visible = true; //txtDNI.ReadOnly = true; //txtNombre.ReadOnly = true; //txtDNI.Text = dtResul.Rows[0]["DES_DNI"].ToString(); //txtNombre.Text = dtResul.Rows[0]["DES_NOMBRE"].ToString(); //lblIdPersonal.Text = dtResul.Rows[0]["IDE_EMPLEADO"].ToString(); //txtDniBusqueda.Text = string.Empty; //txtPersonal.Text = string.Empty; //chkEstado.Checked = true; //chkAtendido.Checked = false; //restricciones(); } } else { //PanelDatos.Visible = false; //txtDniBusqueda.Text = string.Empty; //txtPersonal.Text = string.Empty; cleanMessage = "No se registra informacion"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }