protected void btnGuardar_Click(object sender, EventArgs e) { if (Session["Usuario"] == null) { ScriptManager.RegisterStartupScript(Page, this.GetType(), "mykey", "CancelEdit();", true); } ReportesRRHHClient objRRHHWCF = new ReportesRRHHClient(); int idPersonal = 0; try { if (imageURL.Text.ToUpper() != "SIN FOTO") { idPersonal = 1; } objRRHHWCF.Personal_Registrar(idPersonal, (string)ViewState["nroDocumento"], (string)ViewState["fileName"], ((Usuario_LoginResult)Session["Usuario"]).idUsuario); imgPersonal.ImageUrl = "~/Images/Personal/" + (string)ViewState["fileName"] + "?" + new Random().Next(); btnGuardar.Enabled = false; btnCancelar.Enabled = false; rauImagen.Enabled = false; grdPersonal.Enabled = true; grdPersonal.DataSource = objRRHHWCF.Personal_Listar(cboEmpresa.SelectedValue, txtBuscar.Text); grdPersonal.DataBind(); } catch (Exception ex) { lblMensaje.Text = ex.Message; lblMensaje.CssClass = "mensajeError"; } }
private void IngresoPersonal(DateTime fecha) { ReportesRRHHClient objreportesrrhh = new ReportesRRHHClient(); try { List <Ingreso_PersonalResult> lst = objreportesrrhh.Ingreso_Personal(fecha).ToList(); grdAsistencia.DataSource = objreportesrrhh.Ingreso_Personal(fecha); grdAsistencia.DataBind(); ViewState["fecha"] = fecha; } catch (Exception ex) { throw ex; } }
private void IngresoPersonal_Detalle(DateTime fecha, string ccosto) { ReportesRRHHClient objreportesrrhh = new ReportesRRHHClient(); List <Ingreso_Personal_DetalleResult> lstdetalle; Ingreso_Personal_PermisosResult[] lstpermisos = null; try { lstdetalle = objreportesrrhh.Ingreso_PersonalDetalle(fecha, ccosto, ref lstpermisos).ToList(); grdAsistenciaDetalle.DataSource = lstdetalle; grdAsistenciaDetalle.DataBind(); grdAsistenciaPermisos.DataSource = lstpermisos; grdAsistenciaPermisos.DataBind(); } catch (Exception ex) { throw ex; } }
private void Personal_Cargar() { ReportesRRHHClient objRRHHWCF = new ReportesRRHHClient(); try { int mes = int.Parse(cboMes.SelectedValue.ToString()); List <Personal_ListarResult> lista = new List <Personal_ListarResult>(); lista = objRRHHWCF.Personal_Listar(cboEmpresa.SelectedValue, txtBuscar.Text).ToList(); if (mes > 0) { lista = lista.FindAll(x => x.Fecha.Value.Month == mes).ToList(); } grdPersonal.DataSource = lista; grdPersonal.DataBind(); } catch (Exception ex) { throw ex; } }