Exemple #1
0
 private void cbLoja_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (cbLoja.SelectedItem != null)
     {
         TList_CfgECommerce lCfg = CamadaNegocio.Diversos.TCN_CfgECommerce.Buscar((cbLoja.SelectedItem as TRegistro_LojaVirtual).Cd_empresa, null);
         if (lCfg.Count > 0)
         {
             rCfg = lCfg[0];
         }
     }
 }
Exemple #2
0
        public static string Excluir(TRegistro_CfgECommerce val, BancoDados.TObjetoBanco banco)
        {
            bool             st_transacao = false;
            TCD_CfgECommerce qtb_cfg      = new TCD_CfgECommerce();

            try
            {
                if (banco == null)
                {
                    st_transacao = qtb_cfg.CriarBanco_Dados(true);
                }
                else
                {
                    qtb_cfg.Banco_Dados = banco;
                }
                qtb_cfg.Excluir(val);
                if (st_transacao)
                {
                    qtb_cfg.Banco_Dados.Commit_Tran();
                }
                return("OK");
            }
            catch (Exception ex)
            {
                if (st_transacao)
                {
                    qtb_cfg.Banco_Dados.RollBack_Tran();
                }
                throw new Exception("Erro excluir config.: " + ex.Message.Trim());
            }
            finally
            {
                if (st_transacao)
                {
                    qtb_cfg.deletarBanco_Dados();
                }
            }
        }