当前位置: 首页>>代码示例>>C#>>正文


C# GUID.ToString方法代码示例

本文整理汇总了C#中GUID.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# GUID.ToString方法的具体用法?C# GUID.ToString怎么用?C# GUID.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GUID的用法示例。


在下文中一共展示了GUID.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

        /// <summary>
        /// Retorna o objeto identificado pelo GUID passado como parametro
        /// </summary>
        /// <param name="guid">Identificador do registro </param>
        /// <param name="viewOnly">Carrega apenas os dados de base.</param>
        /// <returns>Retorna o objeto carregado do tipo ILancamento </returns>
        public static ILancamento Create(GUID guid, bool viewOnly = true)
        {
            Connection connection = null;
            ILancamento result = null;

            try
            {
                connection = DbContext.CreateConnection();
                Tipo tipo = Tipo.CupomFiscal;
                Unimake.Data.Generic.DataReader dr =
                    connection.ExecuteReader(string.Format(@"SELECT
                                                                GUID                  AS p_GUID               ,
                                                                EGUID                 AS p_EGUID              ,
                                                                DataHoraCadastro      AS p_DataHoraCadastro   ,
                                                                GUIDUsuarioCadastro   AS p_GUIDUsuarioCadastro,
                                                                GUIDempresa           AS p_GUIDempresa        ,
                                                                Excluido              AS p_Excluido           ,
                                                                Tipo                  AS p_Tipo               ,
                                                                Status                AS p_Status             ,
                                                                Descricao             AS p_Descricao          ,
                                                                StatusEnvio           AS p_StatusEnvio        ,
                                                                StatusBaixa           AS p_StatusBaixa
                                                             FROM fat_lan WHERE fat_Lan.GUID='{0}'",
                                             guid.ToString()));

                if (dr.Read())
                {
                    tipo = dr.GetValue<Tipo>("p_Tipo");

                    if (viewOnly)
                    {
                        result = Create(tipo) as ILancamento;
                        DbContext.Populate(result, dr);
                        result.Status = dr.GetValue<Status>("p_Status");
                        result.Descricao = dr.GetValue<string>("p_Descricao");
                        result.StatusEnvio = dr.GetValue<StatusEnvio>("p_StatusEnvio");
                        result.StatusBaixa = dr.GetValue<StatusBaixa>("p_StatusBaixa");
                    }
                    else
                    {
                        result = Create(guid, tipo) as ILancamento;
                    }
                }
            }
            finally
            {
                connection.Close();
            }

            return result;
        }
开发者ID:njmube,项目名称:openposbr,代码行数:57,代码来源:LancamentoBase.CreateHelper.cs

示例2: CreateNewSaveKey

	// ================================================================================================================

	public void CreateNewSaveKey()
	{
		id = GUID.Create();
		saveKey = id.ToString();
	}
开发者ID:fvivaudo,项目名称:Rush01,代码行数:7,代码来源:UniqueMonoBehaviour.cs

示例3: Awake

	public virtual void Awake()
	{
		id = GUID.Create(id);
		saveKey = id.ToString();
	}
开发者ID:fvivaudo,项目名称:Rush01,代码行数:5,代码来源:UniqueMonoBehaviour.cs

示例4: Create

        public static new IPagarReceber Create(GUID guid, bool viewOnly = true)
        {
            Connection connection = null;
            IPagarReceber result = null;

            try
            {
                connection = DbContext.CreateConnection();
                Tipo tipo = Tipo.ContasReceber;
                Unimake.Data.Generic.DataReader dr =
                    connection.ExecuteReader(string.Format(@"SELECT fat_Lan.GUID AS p_GUID,
                                                                   fat_Lan.EGUID AS p_EGUID,
                                                                   fat_Lan.DataHoraCadastro AS p_DataHoraCadastro,
                                                                   fat_Lan.GUIDUsuarioCadastro AS p_GUIDUsuarioCadastro,
                                                                   fat_Lan.GUIDempresa AS p_GUIDempresa,
                                                                   fat_Lan.Excluido AS p_Excluido,
                                                                   fat_Lan.Tipo AS p_Tipo,
                                                                   fat_Lan.Descricao AS p_Descricao,
                                                                   fat_Lan.StatusEnvio AS p_StatusEnvio,
                                                                   fat_Lan.StatusBaixa AS p_StatusBaixa,
                                                                   fin_LanCCRP.Status AS p_Status,
                                                                   fin_LanCCRP.Parcela AS p_Parcela,
                                                                   fin_LanCCRP.Juros AS p_Juros,
                                                                   fin_LanCCRP.TipoParcela AS p_TipoParcela,
                                                                   fin_LanCCRP.ValorNominalBaixado AS p_ValorNominalBaixado,
                                                                   fin_LanCCRP.ValorRestante AS p_ValorRestante,
                                                                   fin_LanCCRP.Status AS p_Status,
                                                                   fin_LanCC.Valor AS p_Valor,
                                                                   fin_LanCC.DataMovimento AS p_DataMovimento,
                                                                   fin_LanCC.Historico AS p_Historico
                                                             FROM fat_lan
                                                                   INNER JOIN fin_LanCC ON fin_LanCC.GUIDLan = fat_Lan.GUID
                                                                   INNER JOIN fin_LanCCRP ON fin_LanCCRP.GUIDLanCC = fin_LanCC.GUIDLan
                                                             WHERE fat_Lan.GUID='{0}'",
                                             guid.ToString()));

                if (dr.Read())
                {
                    tipo = dr.GetValue<Tipo>("p_Tipo");

                    if (viewOnly)
                    {
                        result = Create(tipo) as IPagarReceber;
                        DbContext.Populate(result, dr);
                        result.Status = dr.GetValue<Enuns.Financeiro.StatusPagarReceber>("p_Status");
                        result.Descricao = dr.GetValue<string>("p_Descricao");
                        result.StatusEnvio = dr.GetValue<StatusEnvio>("p_StatusEnvio");
                        result.StatusBaixa = dr.GetValue<StatusBaixa>("p_StatusBaixa");
                        result.TipoParcela = dr.GetValue<TipoParcela>("p_TipoParcela");
                        result.ValorNominalBaixado = dr.GetValue<double>("p_ValorNominalBaixado");
                        result.ValorRestante = dr.GetValue<double>("p_ValorRestante");
                        result.Valor = dr.GetValue<double>("p_Valor");
                        result.Juros = dr.GetValue<double>("p_Juros");
                        result.Parcela = dr.GetValue<int>("p_Parcela");
                        result.DataVencimento = dr.GetValue<DateTime>("p_DataMovimento");
                        result.Historico = dr.GetValue<string>("p_Historico");
                    }
                    else
                    {
                        result = Create(guid, tipo) as IPagarReceber;
                    }
                }
            }
            finally
            {
                connection.Close();
            }

            return result;
        }
开发者ID:njmube,项目名称:openposbr,代码行数:70,代码来源:PagarReceberBase.CreateHelper.cs


注:本文中的GUID.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。