protected void ListView1_ItemDataBound(object sender, ListViewItemEventArgs e) { //uspSEL_RRHH_DESEMPENIO_OBJETIVOS_MSG DataRowView drv = e.Item.DataItem as DataRowView; DataList innerDataList = e.Item.FindControl("DataListChat") as DataList; Label lbl = (Label)e.Item.FindControl("lblIDE_OBJETIVO"); DropDownList ddlAvance = (DropDownList)e.Item.FindControl("ddlAvance"); BL_RRHH_DESEMPENIO_OBJETIVOS_MSG obj = new BL_RRHH_DESEMPENIO_OBJETIVOS_MSG(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RRHH_DESEMPENIO_OBJETIVOS_MSG(Convert.ToInt32(lbl.Text)); foreach (DataRow rw in dtResultado.Rows) { innerDataList.DataSource = dtResultado; innerDataList.DataBind(); } DataTable dt = new DataTable(); dt = GetTableAvance(); ddlAvance.DataSource = GetTableAvance();; ddlAvance.DataTextField = "AVANCE"; ddlAvance.DataValueField = "AVANCE"; ddlAvance.DataBind(); ddlAvance.SelectedValue = drv["AVANCE"].ToString(); }
protected void btnEnvia_Click(object sender, EventArgs e) { string cleanMessage = string.Empty; if (txtRespuesta.Text.Trim() == string.Empty) { cleanMessage = "Ingresar comentarios"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { BE_RRHH_DESEMPENIO_OBJETIVOS_MSG oBESol = new BE_RRHH_DESEMPENIO_OBJETIVOS_MSG(); oBESol.IDE_MSG = 0;// Convert.ToInt32(string.IsNullOrEmpty(lblCodigo.Text) ? "0" : lblCodigo.Text); oBESol.DNI_USER = Session["IDE_USUARIO"].ToString(); oBESol.IDE_OBJETIVO = Convert.ToInt32(lblCodigo.Text); oBESol.TIPO = "RESPUESTA"; oBESol.ANIO = Convert.ToInt32(Session["ANIO"]); oBESol.ASUNTO = String.Empty; oBESol.COMENTARIO = txtRespuesta.Text.Trim(); int dtrpta = 0; dtrpta = new BL_RRHH_DESEMPENIO_OBJETIVOS_MSG().uspINS_RRHH_DESEMPENIO_OBJETIVOS_MSG(oBESol); if (dtrpta > 0) { lblCodigo.Text = string.Empty; txtRespuesta.Text = String.Empty; cleanMessage = "Envio satisfactorio"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } }
protected void VerChat(object sender, ImageClickEventArgs e) { ImageButton btnEliminar = ((ImageButton)sender); GridViewRow row = btnEliminar.NamingContainer as GridViewRow; string pk = GridView1.DataKeys[row.RowIndex].Values[0].ToString(); ModalRegistro.Show(); BL_RRHH_DESEMPENIO_OBJETIVOS_MSG obj = new BL_RRHH_DESEMPENIO_OBJETIVOS_MSG(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspSEL_RRHH_DESEMPENIO_OBJETIVOS_MSG(Convert.ToInt32(pk)); lblCodigo.Text = pk; DataListChat.DataSource = dtResultado; DataListChat.DataBind(); //dtResultado = obj.uspSEL_RRHH_DESEMPENIO_OBJETIVOS_MSG_POR_ID(Convert.ToInt32(pk)); //if (dtResultado.Rows.Count > 0) //{ // //txtChat.Text = dtResultado.Rows[0]["MENSAJE"].ToString(); // lblCodigo.Text = pk; //} //else //{ // lblCodigo.Text = string.Empty; // //txtChat.Text = string.Empty; // txtRespuesta.Text = string.Empty; //} }
protected void btnSave_Click(object sender, EventArgs e) { BL_RRHH_DESEMPENIO_OBJETIVOS_MSG obj = new BL_RRHH_DESEMPENIO_OBJETIVOS_MSG(); DataTable dtResultado = new DataTable(); dtResultado = obj.uspUPD_RRHH_DESEMPENIO_AMPLIACION(Convert.ToInt32(lblCodigo.Text), txtComentar.Text.Trim(), lblPersonal.Text, txtAmpliarFecha.Text); string cleanMessage = "Envio satisfactorio"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); ListarObjetivos(); ListarGrafico(); }
protected void enviarComentario(object sender, ImageClickEventArgs e) { String cleanMessage = String.Empty; ImageButton btn = ((ImageButton)sender); int item = Convert.ToInt32(btn.CommandArgument); ListViewItem CommentItem = btn.NamingContainer as ListViewItem; int IDE_OBJETIVO = (int)ListView1.DataKeys[CommentItem.DisplayIndex].Values["IDE_OBJETIVO"]; TextBox txtComentarios = (TextBox)CommentItem.FindControl("txtComentarios"); FileUpload FileUpload1 = (FileUpload)CommentItem.FindControl("FileUpload1"); // Si el directorio no existe, crearlo if (!Directory.Exists(Server.MapPath(FolderDesemepenio))) { Directory.CreateDirectory(FolderDesemepenio); } String fileExtension = string.Empty; Boolean fileOK = false; string fileArchivo = string.Empty; if (FileUpload1.HasFile) { string fileName = FileUpload1.FileName; int length = FileUpload1.PostedFile.ContentLength; fileExtension = Path.GetExtension(FileUpload1.PostedFile.FileName); String[] allowedExtensions = { ".gif", ".png", ".jpeg", ".jpg", ".pdf", ".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx" }; for (int i = 0; i < allowedExtensions.Length; i++) { if (fileExtension == allowedExtensions[i]) { fileOK = true; } } } if (fileOK) { try { // Se carga la ruta física de la carpeta temp del sitio string ruta = Server.MapPath(FolderDesemepenio); // Si el directorio no existe, crearlo if (!Directory.Exists(ruta)) { Directory.CreateDirectory(ruta); } string archivo = String.Format("{0}\\{1}", ruta, FileUpload1.FileName); // Verificar que el archivo no exista if (File.Exists(archivo)) { fileArchivo = DateTime.UtcNow.ToFileTimeUtc() + Path.GetExtension(FileUpload1.PostedFile.FileName); FileUpload1.SaveAs(ruta + fileArchivo); } else { fileArchivo = FileUpload1.PostedFile.FileName; FileUpload1.SaveAs(archivo); } } catch (Exception ex) { cleanMessage = "Archivo no puedo ser cargado"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } } if (txtComentarios.Text.Trim() == String.Empty) { cleanMessage = "Ingresar comentarios"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); } else { BE_RRHH_DESEMPENIO_OBJETIVOS_MSG oBESol = new BE_RRHH_DESEMPENIO_OBJETIVOS_MSG(); oBESol.IDE_MSG = 0;// Convert.ToInt32(string.IsNullOrEmpty(lblCodigo.Text) ? "0" : lblCodigo.Text); oBESol.DNI_USER = lblPersonal.Text; oBESol.IDE_OBJETIVO = IDE_OBJETIVO; oBESol.TIPO = "OBSERVACION"; oBESol.ANIO = Convert.ToInt32(Session["ANIO"]); oBESol.ASUNTO = String.Empty; oBESol.COMENTARIO = txtComentarios.Text.Trim(); oBESol.FILE = fileArchivo; oBESol.URL = FolderDesemepenio; int dtrpta = 0; dtrpta = new BL_RRHH_DESEMPENIO_OBJETIVOS_MSG().uspINS_RRHH_DESEMPENIO_OBJETIVOS_MSG(oBESol); if (dtrpta > 0) { txtComentarios.Text = String.Empty; cleanMessage = "Envio satisfactorio"; ScriptManager.RegisterStartupScript(this, typeof(Page), "invocarfuncion", "doAlert('" + cleanMessage + "');", true); ListarObjetivos(); } } }