public JsonResult DependientesEmpleado(ServiceReference.EmpleadoDTO empleado) { bool boolSession = true; bool boolError = false; string strError = string.Empty; Session["idEmpleadoPadre"] = empleado.idEmpleado; return(Json(new { Session = boolSession, Resul = empleado, Error = boolError, MensajeError = strError }, JsonRequestBehavior.AllowGet)); }
public JsonResult EditDependiente(ServiceReference.EmpleadoDTO dependiente, List <ServiceReference.EmpleadoDTO> listaDependiente) { bool boolSession = true; bool boolError = false; string strError = string.Empty; const string usuarioUpdate = "alan200531"; if (Session["TokenSesion"] == null || Session["ip"] == null || Session["user"] == null) { boolSession = false; boolError = true; strError = "Debe iniciar sesion para poder ingresar a la pagina"; return(Json(new { Session = boolSession, Resul = listaDependiente, Error = boolError, MensajeError = strError }, JsonRequestBehavior.AllowGet)); } ServiceReference.VescServiceClient vescServicio = new ServiceReference.VescServiceClient(); ServiceReference.EditEmpleadoRequestDTO editDependienteRequest = new ServiceReference.EditEmpleadoRequestDTO(); List <ServiceReference.EmpleadoDTO> listaDependienteEdit = new List <ServiceReference.EmpleadoDTO>(); dependiente.usuarioUpdate = usuarioUpdate; listaDependienteEdit.Add(dependiente); editDependienteRequest.ListaEmpleado = listaDependienteEdit.ToArray(); editDependienteRequest.tokenSesion = (Guid)Session["TokenSesion"]; editDependienteRequest.ip = Session["ip"].ToString(); ServiceReference.EditEmpleadoResponseDTO editDependienteResponse = new ServiceReference.EditEmpleadoResponseDTO(); editDependienteResponse = vescServicio.EditEmpleado(editDependienteRequest); if (!editDependienteResponse.Success) { boolError = true; strError = editDependienteResponse.Mensaje; } return(Json(new { Session = boolSession, Resul = listaDependiente, Error = boolError, MensajeError = strError }, JsonRequestBehavior.AllowGet)); }
public JsonResult AddDependiente(ServiceReference.EmpleadoDTO dependiente, List <ServiceReference.EmpleadoDTO> listaDependiente) { bool boolSession = true; bool boolError = false; string strError = string.Empty; const int idPlan = 1; const int idClub = 1; const int idTipoPago = 1; const string usuarioInsert = "alan200531"; if (Session["TokenSesion"] == null || Session["ip"] == null || Session["user"] == null) { boolSession = false; boolError = true; strError = "Debe iniciar sesion para poder ingresar a la pagina"; return(Json(new { Session = boolSession, Resul = listaDependiente, Error = boolError, MensajeError = strError }, JsonRequestBehavior.AllowGet)); } int idEmpresa = (int)Session["idEmpresa"]; int idRazonSocial = (int)Session["idRazonSocial"]; long idEmpleadoPadre = (long)Session["idEmpleadoPadre"]; ServiceReference.VescServiceClient vescServicio = new ServiceReference.VescServiceClient(); ServiceReference.AltaEmpleadoRequestDTO altaDependienteRequest = new ServiceReference.AltaEmpleadoRequestDTO(); List <ServiceReference.EmpleadoDTO> listaDependienteAlta = new List <ServiceReference.EmpleadoDTO>(); dependiente.idEmpresa = idEmpresa; dependiente.idEmpresaInfFiscal = idRazonSocial; dependiente.idEmpleadoPadre = idEmpleadoPadre; dependiente.idPlan = idPlan; dependiente.idClub = idClub; dependiente.idTipoPago = idTipoPago; dependiente.usuarioInsert = usuarioInsert; listaDependienteAlta.Add(dependiente); altaDependienteRequest.ListaEmpleado = listaDependienteAlta.ToArray(); altaDependienteRequest.tokenSesion = (Guid)Session["TokenSesion"]; altaDependienteRequest.ip = Session["ip"].ToString(); ServiceReference.AltaEmpleadoResponseDTO altaDependienteResponse = new ServiceReference.AltaEmpleadoResponseDTO(); altaDependienteResponse = vescServicio.AltaEmpleado(altaDependienteRequest); if (altaDependienteResponse.Success) { listaDependiente.Add(dependiente); } else { boolError = true; strError = altaDependienteResponse.Mensaje; } return(Json(new { Session = boolSession, Resul = listaDependiente, Error = boolError, MensajeError = strError }, JsonRequestBehavior.AllowGet)); }