예제 #1
0
 private void Spanish_RB_CheckedChanged(object sender, EventArgs e)
 {
     if (Spanish_RB.Checked)
     {
         PrincipalBase.SetLocale("es-ES");
     }
 }
예제 #2
0
 private void English_RB_CheckedChanged(object sender, EventArgs e)
 {
     if (English_RB.Checked)
     {
         PrincipalBase.SetLocale("en");
     }
 }
예제 #3
0
 private void Predeterminado_RB_CheckedChanged(object sender, EventArgs e)
 {
     if (Predeterminado_RB.Checked)
     {
         PrincipalBase.SetLocale("system");
     }
 }
예제 #4
0
        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);
            }
        }
예제 #5
0
        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());
        }
예제 #6
0
        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);
            }
        }
예제 #7
0
 /// <summary>
 /// Marca en la tabla el schema por defecto
 /// </summary>
 public override void MarkDefaultSchema()
 {
     List.SetPrincipal(PrincipalBase.GetDefaultSchema());
     Datos.ResetBindings(false);
 }