}//---------------- /// <summary> /// Metodo que obtiene el id de la unidad /// </summary> /// <param name="guid">se pasa el id de la unidad para comprar</param> /// <returns>se retorna el id de la unidad</returns> public string ObtenerUnidad(string guid) { try { string gid = ""; ZthFetchXml365.zthFetch fetch = new ZthFetchXml365.zthFetch("uomschedule", ref servicio); fetch.AgregarEntidadLinkJoin("uomschedule", "uom", (zthFetch.TipoRelacionEntidadLink) 1, "uomscheduleid", "uomscheduleid"); //se capturan los datos de la entidad licencia csp fetch.AgregarCampoRetorno("uom", "uomid", ZthFetchXml365.zthFetch.TipoRetorno.Key); fetch.AgregarFiltroPlano("uomschedule", ZthFetchXml365.zthFetch.TipoFiltro.and, "uomscheduleid", ZthFetchXml365.zthFetch.TipoComparacionFiltro.Igual, guid); DataTable Dato = new DataTable(); Dato = fetch.GeneraTblconFetchResult(false); if (Dato.Rows.Count > 0) { foreach (DataRow dataRow in Dato.Rows) { gid = dataRow["uomid"].ToString(); } return(gid); } else { return(gid = null); } } catch (Exception ex) { ZthMetodosVarios.Metodos.GuardarLog(ruta, "Error al obtener la unidad: " + ex.Message.ToString()); return(null); } } //---------------