private void Spanish_RB_CheckedChanged(object sender, EventArgs e) { if (Spanish_RB.Checked) { PrincipalBase.SetLocale("es-ES"); } }
private void English_RB_CheckedChanged(object sender, EventArgs e) { if (English_RB.Checked) { PrincipalBase.SetLocale("en"); } }
private void Predeterminado_RB_CheckedChanged(object sender, EventArgs e) { if (Predeterminado_RB.Checked) { PrincipalBase.SetLocale("system"); } }
public override Empresa Save() { // Por la posible doble interfaz Root/Child if (IsChild) { throw new iQException(moleQule.Library.Resources.Messages.CHILD_SAVE_NOT_ALLOWED); } if (IsDeleted && !CanDeleteObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } else if (IsNew && !CanAddObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } else if (!CanEditObject()) { throw new System.Security.SecurityException( moleQule.Library.Resources.Messages.USER_NOT_ALLOWED); } // Guardamos si es nuevo pq tras el Save la propiedad IsNew es false // y necesitamos saber si es un Insert para crear el eschema de usuarios // tras guardar la empresa Boolean isNew = IsNew; try { ValidationRules.CheckRules(); base.Save(); _contactos.Update(this); Transaction().Commit(); BeginTransaction(); // Si es una inserciĆ³n de una nueva empresa tenemos que crear // el mapa de permisos de los usuarios if (isNew) { PrincipalBase.NewSchema(this.Oid); } return(this); } catch (Exception ex) { if (Transaction() != null) { Transaction().Rollback(); } iQExceptionHandler.TreatException(ex); return(this); } }
static void Main() { PrincipalBase.SetLocale(CultureInfo.CurrentCulture.Name); AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(UnhandledException); System.Windows.Forms.Application.ThreadException += new ThreadExceptionEventHandler(ThreadException); System.Windows.Forms.Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); System.Windows.Forms.Application.Run(new MainForm()); }
static void Main(string[] args) { try { if (args.Length == 0) { // Maquina Cliente Config.CreateUser(PrincipalBase.UserName, PrincipalBase.Password); } else { //Maquina Servidor Config.CreateUser(PrincipalBase.UserName, PrincipalBase.Password); Config.ShareFolder(args[0], PrincipalBase.UserName, PrincipalBase.GetServerName()); Config.LocalFolderPermissions(args[0], PrincipalBase.UserName, Environment.MachineName); } } catch (Exception ex) { string msg = string.Empty; msg = ex.Message; msg += ex.InnerException != null ? ex.InnerException.Message : string.Empty; Console.WriteLine(msg); TimeSpan before = DateTime.Now.TimeOfDay; TimeSpan now; int seconds = 0; do { now = DateTime.Now.TimeOfDay; seconds = ((TimeSpan)(now - before)).Seconds; }while (seconds < 2); } }
/// <summary> /// Marca en la tabla el schema por defecto /// </summary> public override void MarkDefaultSchema() { List.SetPrincipal(PrincipalBase.GetDefaultSchema()); Datos.ResetBindings(false); }