/// <summary> /// Verificar si el NumeroIdentificacion ya Existe /// </summary> /// <param name="cliente">Mandamos la clase con los datos dentro</param> /// <param name="servicio">Conexion del CRM</param> /// <returns></returns> public string BuscarPlantillaCotizacion(string nombrePlantilla, IOrganizationService servicio) { try { string guidPlantilla = ""; zthFetch busquedaFetch = new zthFetch("documenttemplate", ref servicio); busquedaFetch.AgregarCampoRetorno("documenttemplate", "documenttemplateid", (zthFetch.TipoRetorno.Key));//devuelvo el vendedor busquedaFetch.AgregarFiltroPlano("documenttemplate", (zthFetch.TipoFiltro.and), "name", (zthFetch.TipoComparacionFiltro.Igual), nombrePlantilla); DataTable dataTable2 = busquedaFetch.GeneraTblconFetchResult(); if (dataTable2.Rows.Count > 0) { guidPlantilla = Cls_Generales.validaDBnullValue(RuntimeHelpers.GetObjectValue(dataTable2.Rows[0]["documenttemplateid"])); return(guidPlantilla); } else { return(string.Empty); } } catch (Exception ex) { return(string.Empty); } }
public static string validaDBnullValue(object valor) { if (Cls_Generales.isnullItemdtt(RuntimeHelpers.GetObjectValue(valor)) || valor == DBNull.Value) { return(""); } return(valor.ToString()); }