/// <summary> /// Obtiene de la bases de datos aspnet y tabla aspnet_Applications el Guid de la Aplicacion /// </summary> /// <param name="applicationName">Nombre de la aplicacion. Coincide con CompanyId en la arquitectura</param> /// <param name="cnnstringName"></param> /// <returns></returns> public static Guid GetApplication(string applicationName, string cnnstringName) { Guid wApplicationNameId = new Guid(); try { using (Fwk.Security.RuleProviderDataContext dc = new Fwk.Security.RuleProviderDataContext(System.Configuration.ConfigurationManager.ConnectionStrings[cnnstringName].ConnectionString)) { aspnet_Application app = dc.aspnet_Applications.Where(p => p.LoweredApplicationName.Equals(applicationName.ToLower())).FirstOrDefault <aspnet_Application>(); if (app != null) { wApplicationNameId = app.ApplicationId; } else { TechnicalException te = new TechnicalException(String.Format(Fwk.Security.Properties.Resource.ApplicationName_NotExist, applicationName, cnnstringName)); ExceptionHelper.SetTechnicalException <FwkMembership>(te); te.ErrorId = "4002"; throw te; } } return(wApplicationNameId); } catch (TechnicalException tx) { throw tx; } catch (Exception ex) { TechnicalException te = new TechnicalException(Fwk.Security.Properties.Resource.MembershipSecurityGenericError, ex); ExceptionHelper.SetTechnicalException <FwkMembership>(te); te.ErrorId = "4000"; throw te; } }
partial void Deleteaspnet_Application(aspnet_Application instance);
partial void Updateaspnet_Application(aspnet_Application instance);
partial void Insertaspnet_Application(aspnet_Application instance);