Ejemplo n.º 1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            Thread.CurrentThread.CurrentCulture   = new CultureInfo("es");
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("es");

            ObjectBase.Container = MEFLoader.Init(new List <ComposablePartCatalog>()
            {
                new AssemblyCatalog(Assembly.GetExecutingAssembly())
            });

            // Current.ShutdownMode = ShutdownMode.OnExplicitShutdown;



            //  new LoginWindow().ShowDialog();
            //new Shell().Show();
            //------> reporte de inventario telerik new Window1().Show();
            //new MainWindow().Show();



            // new Shell().Show();
            // new
            //().Show();

            GlobalModule.bytSUCURSAL = Convert.ToByte(GlobalModule.GetSetting("GrupoGuadiana", "Config", "SucursalID", String.Empty));
            GlobalModule.bytEMPRESA  = Convert.ToByte(GlobalModule.GetSetting("GrupoGuadiana", "Config", "EmpresaID", String.Empty));

            ShellDockDesign NewWindowB = new ShellDockDesign();

            //Current.MainWindow.WindowState = WindowState.Maximized;
            NewWindowB.Show();

            // new ShellDockDesign();
        }
Ejemplo n.º 2
0
        private void DisplayVersion()
        {
            var version = string.Format(" {0}", ((System.Reflection.AssemblyFileVersionAttribute)
                                                     (System.Reflection.Assembly.GetExecutingAssembly().
                                                     GetCustomAttributes(typeof(System.Reflection.AssemblyFileVersionAttribute),
                                                                         false)[0])).Version);

            // var a =  Application.ResourceAssembly.GetCustomAttributes;

            Version v     = Assembly.GetExecutingAssembly().GetName().Version;
            string  About = string.Format(CultureInfo.InvariantCulture, @"YourApp Version {0}.{1}.{2} (r{3})", v.Major, v.Minor, v.Build, v.Revision);

            //        var ver = Windows.ApplicationModel.Package.Current.Id.Version;

            //        var attribute = (AssemblyVersionAttribute)Assembly
            //.GetExecutingAssembly()
            //.GetCustomAttributes(typeof(AssemblyVersionAttribute), true)
            //.Single();
            //        var a =  attribute.Version;


            //System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            //FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(assembly.Location);
            //string version2 = fvi.FileVersion;

            //System.Deployment.Application.ApplicationDeployment ad =
            //     System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
            //version = string.Format("gggc: {0}", ad.CurrentVersion.ToString());

            if (System.Deployment.Application.ApplicationDeployment.IsNetworkDeployed)
            {
                System.Deployment.Application.ApplicationDeployment ad =
                    System.Deployment.Application.ApplicationDeployment.CurrentDeployment;
                version = string.Format(" {0}", ad.CurrentVersion.ToString());
            }
            // Title = "BiG - Grupo Guadiana GC ";

            string strWeek = DateTime.Now.DayOfWeek.ToString();

            CultureInfo ciCurr  = CultureInfo.CurrentCulture;
            int         weekNum = ciCurr.Calendar.GetWeekOfYear(DateTime.Now, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);

            int days     = ciCurr.Calendar.GetDayOfYear(DateTime.Now);
            int leftDays = 0;

            if (ciCurr.Calendar.IsLeapDay(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day))
            {
                leftDays = 366 - days;
            }
            else
            {
                leftDays = 365 - days;
            }
            //return weekNum;

            this.sbiUser.Content     = "Usuario: " + GlobalModule.ActualUserName;
            this.sbiUserName.Content = GlobalModule.ActualName;
            this.sbiDate.Content     = "" + DateTime.Now.ToLongDateString();
            // this.sbiDays.Content = "Semana: " + weekNum.ToString() + "| Dias Transcurridos: " + days.ToString() + " | Quedan: " + leftDays.ToString();
            this.sbiVersion.Content = "Versión: " + version;

            this.sbiIP.Content = "" + GlobalModule.GetLocalIP();

            lblVersion.Content = "versión: " + version;
        }