Ejemplo n.º 1
0
        public TimeSheetGridView()
        {
            string[] sa = this.GetType().Assembly.GetManifestResourceNames();

            foreach (string s in sa)
            {
                System.Diagnostics.Trace.WriteLine(s);
            }

            this.SetStyle(ControlStyles.UserPaint
                          | ControlStyles.AllPaintingInWmPaint
                          | ControlStyles.OptimizedDoubleBuffer, true);

            #region Default grid view

            this.AutoSize                = true;
            this.AutoGenerateColumns     = false;
            this.AllowUserToOrderColumns = false;
            this.AllowUserToAddRows      = false;
            this.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
            this.RowTemplate.Height  = MIN_CELL_HEIGHT;
            this.ColumnHeadersHeight = MIN_HEADER_HEIGHT;

            #endregion Default grid view

            // Init FromDate and ToDate
            _fromDate = DateTime.Now;
            _toDate   = DateTime.Now;

            // Header Format
            _headerDateFormat = "ddd, dd/MM/yyyy";

            // Default Color
            DefaultColor();

            // Check position for Tooltip
            _positionShowToolTip = ContentAlignment.TopRight;

            // Init PopupToolTip
            popupToolTip = new PopupControl.Popup(commentToolTip = new CommentToolTip());
        }
Ejemplo n.º 2
0
        public void Initialize()
        {
            if (LoadTime == new DateTime(1900, 1, 1))
            {
                try
                {
                    Conx.Open();
                    Conx.Close();
                }
                catch (Exception)
                {
                    if (Conx.State == ConnectionState.Open)
                    {
                        Conx.Close();
                    }
                    MessageBox.Show("Fallo Conexion a la Base de Datos", "Base de Datos", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                BD = Conx.Database;

                Loader = new BackgroundWorker();
                Loader.WorkerReportsProgress      = true;
                Loader.WorkerSupportsCancellation = true;
                Loader.ProgressChanged           += Loader_ProgressChanged;
                Loader.RunWorkerCompleted        += Loader_RunWorkerCompleted;
                Loader.DoWork += Loader_DoWork;

                //Inicio de Carga
                ISenseRect                   = new PopupControl.Popup(LoadDialog = new LoadingInfo());
                ISenseRect.AutoClose         = false;
                ISenseRect.FocusOnOpen       = false;
                ISenseRect.Opacity           = 0.65;
                ISenseRect.ShowingAnimation  = PopupControl.PopupAnimations.TopToBottom | PopupControl.PopupAnimations.Slide;
                ISenseRect.HidingAnimation   = PopupControl.PopupAnimations.Blend;
                ISenseRect.AnimationDuration = 100;
                LoadDialog.SetInfo(BD, "Abriendo Conexion a BD");
                ISenseRect.Show(new System.Drawing.Point(200, 200));

                Loader.RunWorkerAsync();
            }
        }
Ejemplo n.º 3
0
        internal void Initialize(Point Location, bool FullLoad = false)
        {
            try
            {
                Connection.Open();
                Connection.Close();
            }
            catch (Exception ex)
            {
                if (Connection.State == ConnectionState.Open)
                    Connection.Close();
                MessageBox.Show("Error on database connection: " + ex.Message, "Database connection", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            Loader = new BackgroundWorker();
            Loader.WorkerReportsProgress = true;
            Loader.WorkerSupportsCancellation = true;
            Loader.ProgressChanged += Loader_ProgressChanged;
            if (!FullLoad)
            {
                Loader.DoWork += Loader_DoWork;
                Loader.RunWorkerCompleted += Loader_RunWorkerCompleted;
            }
            else
            {
                Loader.DoWork += Loader_DoWork2;
                Loader.RunWorkerCompleted += Loader_RunWorkerCompleted2;
            }

            //Inicio de Carga
            ISenseRect = new PopupControl.Popup(LoadDialog = new LoadingInfo());
            ISenseRect.AutoClose = false;
            ISenseRect.FocusOnOpen = false;
            ISenseRect.Opacity = 0.65;
            ISenseRect.ShowingAnimation = PopupControl.PopupAnimations.TopToBottom | PopupControl.PopupAnimations.Slide;
            ISenseRect.HidingAnimation = PopupControl.PopupAnimations.Blend;
            ISenseRect.AnimationDuration = 100;
            LoadDialog.SetInfo(this.Server, "Connecting to database...");
            ISenseRect.Show(Location);

            Loader.RunWorkerAsync();
        }