Пример #1
0
        private void Test(bool[] rowsToKeep)
        {
            int count = rowsToKeep.Length;

            // Build an identity column
            NumberColumn <int> column = new NumberColumn <int>(-1);

            for (int i = 0; i < rowsToKeep.Length; ++i)
            {
                column[i] = i;
            }

            // Build a RowUpdater and fake mapping to temp to check those results
            TableStub  table   = new TableStub();
            RowUpdater updater = new RowUpdater(table, table);

            int[] rowsToTemp = Enumerable.Range(10, count).ToArray();

            // Request Garbage Collection
            GarbageCollector.Collect <int>(column, null, rowsToKeep, updater, rowsToTemp);

            // Verify correct values were kept
            StringBuilder expected      = new StringBuilder();
            int           expectedCount = 0;

            for (int i = 0; i < count; ++i)
            {
                if (rowsToKeep[i])
                {
                    expectedCount++;

                    if (expected.Length > 0)
                    {
                        expected.Append(", ");
                    }
                    expected.Append(i);
                }
            }

            Assert.Equal(expectedCount, column.Count);
            Assert.Equal(expected.ToString(), String.Join(", ", column.OrderBy((i) => i)));

            // Verify rows removed are reported in the correct indices in temp or swapped in original column
            RowStub stub = new RowStub(table, 0);

            for (int i = 0; i < count; ++i)
            {
                stub.Index = i;
                updater.Update(stub);

                if (!rowsToKeep[i])
                {
                    Assert.Equal(10 + i, stub.Index);
                }
                else
                {
                    Assert.Equal(i, column[stub.Index]);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Raises the PaintCell event
        /// </summary>
        /// <param name="e">A PaintCellEventArgs that contains the event data</param>
        public override void OnPaintCell(PaintCellEventArgs e)
        {
            if (e.Table.ColumnModel.Columns[e.Column] is NumberColumn)
            {
                NumberColumn column = (NumberColumn)e.Table.ColumnModel.Columns[e.Column];

                this.ShowUpDownButtons = column.ShowUpDownButtons;
                this.UpDownAlign       = column.UpDownAlign;
                this.Maximum           = column.Maximum;
                this.Minimum           = column.Minimum;

                // if the table is editing this cell and the editor is a
                // NumberCellEditor then we should display the updown buttons
                if (e.Table.IsEditing && e.Table.EditingCell == e.CellPos && e.Table.EditingCellEditor is NumberCellEditor)
                {
                    this.ShowUpDownButtons = true;
                }
            }
            else
            {
                this.ShowUpDownButtons = false;
                this.UpDownAlign       = LeftRightAlignment.Right;
                this.Maximum           = 100;
                this.Minimum           = 0;
            }

            base.OnPaintCell(e);
        }
Пример #3
0
        /// <summary>
        /// Creates a column model for a player
        /// </summary>
        /// <param name="fields">The visible columns</param>
        public static ColumnModel CreateColumnModel(PlayerFields fields)
        {
            ImageColumn  visibleColumn                  = CreateImageColumn(string.Empty, 20, VillageGridExRes.Player_VisibleTooltip);
            TextColumn   playerNameColumn               = CreateTextColumn(VillageGridExRes.Name, 85, VillageGridExRes.Player_NameTooltip);
            TextColumn   playerTribeColumn              = CreateTextColumn(VillageGridExRes.Tribe, 60, VillageGridExRes.Player_TribeTooltip);
            NumberColumn playerPointsColumn             = CreateNumberColumn(VillageGridExRes.Points, 72, VillageGridExRes.Player_PointsTooltip);
            NumberColumn playerVillagesColumn           = CreateNumberColumn(VillageGridExRes.Villages, 60, VillageGridExRes.Player_VillagesTooltip);
            TextColumn   playerVillagesDifferenceColumn = CreateTextColumn(VillageGridExRes.Difference, 60, VillageGridExRes.Player_VillagesDiffTooltip);
            TextColumn   playerTribeDifferenceColumn    = CreateTextColumn(VillageGridExRes.TribeOld, 65, VillageGridExRes.Player_TribeOldTooltip);
            NumberColumn playerPointsDifferenceColumn   = CreateNumberColumn(VillageGridExRes.Difference, 55, VillageGridExRes.Player_PointsDiffTooltip);

            playerNameColumn.Visible               = (fields & PlayerFields.Name) != 0;
            playerPointsColumn.Visible             = (fields & PlayerFields.Points) != 0;
            playerPointsDifferenceColumn.Visible   = (fields & PlayerFields.PointsDifference) != 0;
            playerTribeColumn.Visible              = (fields & PlayerFields.Tribe) != 0;
            playerTribeDifferenceColumn.Visible    = (fields & PlayerFields.TribeDifference) != 0;
            playerVillagesColumn.Visible           = (fields & PlayerFields.Villages) != 0;
            playerVillagesDifferenceColumn.Visible = (fields & PlayerFields.VillagesDifference) != 0;

            return(new ColumnModel(new Column[] {
                visibleColumn,
                playerNameColumn,
                playerTribeDifferenceColumn,
                playerTribeColumn,
                playerPointsColumn,
                playerPointsDifferenceColumn,
                playerVillagesColumn,
                playerVillagesDifferenceColumn
            }));
        }
Пример #4
0
        private void DoFiltering()
        {
            Table table = this.table;       // The Table control on a form - already initialised

            table.Clear();
            table.BeginUpdate();
            table.EnableWordWrap = true;    // If false, then Cell.WordWrap is ignored
            table.EnableFilters  = true;

            NumberColumn col0 = new NumberColumn("#", 20);
            NumberColumn col1 = new NumberColumn("Height", 50);
            TextColumn   col2 = new TextColumn("Name", 80);

            col2.Filterable = true;
            TextColumn     col3 = new TextColumn("Surname", 80);
            DateTimeColumn col4 = new DateTimeColumn("Birthday", 120);
            TextColumn     col5 = new TextColumn("Comments", 100);

            table.ColumnModel = new ColumnModel(new Column[] { col0, col1, col2, col3, col4, col5 });

            TableModel model = new TableModel();

            AddRow(model, 1, 1.52, "Mark", "Hobbs", "23/1/1978", "likes apples");
            AddRow(model, 2, 1.76, "Dave", "Duke", "2/5/1977", "keeps fish");
            AddRow(model, 3, 1.64, "Holly", "Prench", "14/8/1979", "singer");
            AddRow(model, 4, 1.53, "Mark", "Hobbs", "23/1/1984", "plays football");
            AddRow(model, 5, 1.64, "Dave", "Hobbs", "19/1/1980", "vegetarian");

            this.table.TableModel = model;

            this.table.EndUpdate();
        }
Пример #5
0
        public void NumberColumn_Basics()
        {
            NumberColumnTest <sbyte>(-10, 100, (i) => (sbyte)(i % sbyte.MaxValue));
            NumberColumnTest <byte>(250, 100, (i) => (byte)(i % byte.MaxValue));

            NumberColumnTest <short>(-20, 100, (i) => (short)(i % short.MaxValue));
            NumberColumnTest <ushort>(ushort.MaxValue, 100, (i) => (ushort)(i % ushort.MaxValue));

            NumberColumnTest <int>(int.MinValue, 100, (i) => i);
            NumberColumnTest <uint>(uint.MaxValue, 100, (i) => (uint)i);

            NumberColumnTest <long>(int.MinValue, 100, (i) => i);
            NumberColumnTest <ulong>(0, 100, (i) => (ulong)i);

            NumberColumnTest <float>(-5.5f, 124.5f, (i) => 0.5f * i);
            NumberColumnTest <double>(-5.5f, 124.5f, (i) => 0.5f * i);

            NumberColumn <int> column = new NumberColumn <int>(0);
            int sum = 0;

            column.ForEach((slice) => sum += slice.Sum());
            Assert.Equal(0, sum);

            int expectedSum = 0;

            for (int i = 0; i < 100; ++i)
            {
                column[i]    = 2 * i;
                expectedSum += 2 * i;
            }

            sum = 0;
            column.ForEach((slice) => sum += slice.Sum());
            Assert.Equal(expectedSum, sum);
        }
        /// <summary>
        /// 设定/初始化一列。
        /// </summary>
        public void setPanelColumn(string sPanelID, ColumnModel mo, bool sort, int flex = 0, bool visiable = true)
        {
            int rfType = mo.WordType;
            var list   = this.GetCmp <GridPanel>(sPanelID);

            if ((rfType == CosDataBase.STRING_TYPE) ||
                (rfType == CosDataBase.INT_TYPE) ||
                (rfType == CosDataBase.SMALLINT_TYPE) ||
                (rfType == CosDataBase.LONGINT_TYPE) ||
                (rfType == CosDataBase.STRINGL_TYPE) ||
                (rfType == CosDataBase.SELSTR_TYPE) ||
                (rfType == CosDataBase.DATETIME_TYPE) ||
                (rfType == CosDataBase.DATE_TYPE) ||
                (rfType == CosDataBase.TIME_TYPE) ||
                (rfType == CosDataBase.BOOLEAN_TYPE) ||
                (rfType == CosDataBase.JOIN_TYPE) ||
                (rfType == CosDataBase.PARENTNAME_TYPE))
            {
                Column col = new Column();
                col.Text      = mo.WordName;
                col.DataIndex = mo.WordValue;
                col.Width     = mo.ColumnWidth;
                col.Sortable  = sort;
                //col.Visible = visiable;
                col.Hidden = !visiable;
                col.Flex   = flex;
                list.AddColumn(col);
            }
            else if (rfType == CosDataBase.FLOAT_TYPE)
            {
                NumberColumn col = new NumberColumn();
                col.Text      = mo.WordName;
                col.DataIndex = mo.WordValue;
                string s = "0.";
                for (int j = 0; j < AppSettingValues.FLOATDECIMAL; j++)
                {
                    s = s + "0";
                }
                col.Format   = s;
                col.Width    = mo.ColumnWidth;
                col.Sortable = sort;
                col.Visible  = visiable;
                col.Flex     = flex;
                list.AddColumn(col);
            }
            else if (rfType == CosDataBase.BOOLEANBOX_TYPE)
            {
                CheckColumn col = new CheckColumn();
                col.Text      = mo.WordName;
                col.DataIndex = mo.WordValue;
                col.Width     = 40;
                col.Sortable  = sort;
                col.Visible   = visiable;
                col.Flex      = flex;
                list.AddColumn(col);
            }
        }
Пример #7
0
        protected override void InitGridColumn()
        {
            //GridPanel1.ColumnModel.Columns.Clear();
            ColumnCollection columns = GridPanel1.ColumnModel.Columns;
            ColumnBase       col     = new RowNumbererColumn();

            //columns.Add(col);
            col = new NumberColumn()
            {
                Header = "排序", DataIndex = "orderID", Width = 50, Fixed = true
            };
            (col as NumberColumn).Format = "0";
            col.Editor.Add(new NumberField());
            columns.Add(col);
            col = new Column()
            {
                Header = "代码", DataIndex = "ProgCode", Width = 80, Fixed = true
            };
            col.Editor.Add(new TextField());
            columns.Add(col);
            col = new Column()
            {
                Header = "名称", DataIndex = "ProgName"
            };
            col.Editor.Add(new TextField());
            columns.Add(col);
            col = new Column()
            {
                Header = "页面", DataIndex = "ProgClass"
            };
            col.Editor.Add(new TextField());
            columns.Add(col);
            col = new Column()
            {
                Header = "小图标", DataIndex = "ProgIcon1", Width = 50, Fixed = true
            };
            col.Editor.Add(new TextField());
            columns.Add(col);
            col = new Column()
            {
                Header = "大图标", DataIndex = "ProgIcon2", Width = 50, Fixed = true
            };
            col.Editor.Add(new TextField());
            columns.Add(col);
            col = new Column()
            {
                Header = "分类", DataIndex = "IsCore", Width = 40, Fixed = true
            };
            col.Editor.Add(new TextField());
            columns.Add(col);
            col = new Column()
            {
                Header = "组", DataIndex = "IsGroup", Width = 30, Fixed = true
            };
            col.Editor.Add(new TextField());
            columns.Add(col);
        }
Пример #8
0
        private void Initialize_table()
        {
            this.table1.BeginUpdate();
            NumberColumn column0 = new NumberColumn("#", 20);
            TextColumn   column1 = new TextColumn("File Name", 100);

            column0.Alignment = ColumnAlignment.Center;
            column1.Alignment = ColumnAlignment.Center;
            this.columnModel1.Columns.AddRange(new Column[] { column0, column1 });

            this.table1.EndUpdate();
        }
Пример #9
0
        /// <summary>
        /// Creates a column model for a village
        /// </summary>
        /// <param name="fields">The visible columns</param>
        public static ColumnModel CreateColumnModel(VillageFields fields)
        {
            ImageColumn  visibleColumn                 = CreateImageColumn(string.Empty, 20, VillageGridExRes.VisibleTooltip);
            ImageColumn  villageImageColumn            = CreateImageColumn(string.Empty, 20, VillageGridExRes.TypeTooltip);
            TextColumn   villageCoordColumn            = CreateTextColumn(VillageGridExRes.Location, 50, VillageGridExRes.LocationTooltip);
            TextColumn   villageNameColumn             = CreateTextColumn(VillageGridExRes.Name, 114, VillageGridExRes.NameTooltip);
            NumberColumn villagePointsColumn           = CreateNumberColumn(VillageGridExRes.Points, 55, VillageGridExRes.PointsTooltip);
            NumberColumn villagePointsDifferenceColumn = CreateNumberColumn(VillageGridExRes.Difference, 45, VillageGridExRes.PointsDifferenceTooltip);

            TextColumn   villagePlayerColumn             = CreateTextColumn(VillageGridExRes.Player, 85, VillageGridExRes.PlayerNameTooltip);
            TextColumn   villagePlayerDifferenceColumn   = CreateTextColumn(VillageGridExRes.PlayerOld, 85, VillageGridExRes.PlayerDifferenceTooltip);
            NumberColumn villagePlayerPoints             = CreateNumberColumn(VillageGridExRes.Points, 65, VillageGridExRes.PlayerPointsTooltip);
            NumberColumn villagePlayerPointsDifference   = CreateNumberColumn(VillageGridExRes.Difference, 55, VillageGridExRes.PlayerPointsDiffTooltip);
            NumberColumn villageVillagesColumn           = CreateNumberColumn(VillageGridExRes.Villages, 60, VillageGridExRes.VillagesTooltip);
            TextColumn   villageVillagesDifferenceColumn = CreateTextColumn(VillageGridExRes.Difference, 45, VillageGridExRes.VillagesDiffTooltip);
            TextColumn   villageTribeColumn     = CreateTextColumn(VillageGridExRes.Tribe, 50, VillageGridExRes.TribeTagTooltip);
            NumberColumn villageTribeRankColumn = CreateNumberColumn(VillageGridExRes.Rank, 50, VillageGridExRes.TribeRankTooltip);

            villageImageColumn.Visible              = (fields & VillageFields.Type) != 0;
            villageNameColumn.Visible               = (fields & VillageFields.Name) != 0;
            villagePlayerColumn.Visible             = (fields & VillageFields.Player) != 0;
            villagePlayerDifferenceColumn.Visible   = (fields & VillageFields.PlayerDifference) != 0;
            villagePlayerPoints.Visible             = (fields & VillageFields.PlayerPoints) != 0;
            villagePlayerPointsDifference.Visible   = (fields & VillageFields.PlayerPointsDifference) != 0;
            villagePointsColumn.Visible             = (fields & VillageFields.Points) != 0;
            villagePointsDifferenceColumn.Visible   = (fields & VillageFields.PointsDifference) != 0;
            villageTribeColumn.Visible              = (fields & VillageFields.Tribe) != 0;
            villageTribeRankColumn.Visible          = (fields & VillageFields.TribeRank) != 0;
            villageVillagesColumn.Visible           = (fields & VillageFields.PlayerVillages) != 0;
            villageVillagesDifferenceColumn.Visible = (fields & VillageFields.PlayerVillagesDifference) != 0;

            return(new ColumnModel(new Column[] {
                visibleColumn,
                villageImageColumn,
                villageCoordColumn,
                villageNameColumn,
                villagePointsColumn,
                villagePointsDifferenceColumn,
                villagePlayerDifferenceColumn,
                villagePlayerColumn,
                villagePlayerPoints,
                villagePlayerPointsDifference,
                villageVillagesColumn,
                villageVillagesDifferenceColumn,
                villageTribeColumn,
                villageTribeRankColumn
            }));
        }
Пример #10
0
        /// <summary>
        /// Creates a numeric column
        /// </summary>
        private static NumberColumn CreateNumberColumn(string header, int width, string toolTipText = null)
        {
            var col = new NumberColumn(header, width)
            {
                Editable  = false,
                Alignment = ColumnAlignment.Right,
                Format    = "#,0"
            };

            if (!string.IsNullOrWhiteSpace(toolTipText))
            {
                col.ToolTipText = toolTipText;
            }

            return(col);
        }
Пример #11
0
        /// <summary>
        /// 初始化表格
        /// </summary>
        private void InitTable()
        {
            this.tableFiles.ColumnModel     = this.columnModel;
            this.tableFiles.TableModel      = this.tableModel;
            this.tableFiles.CellMouseDown  += TableFiles_CellMouseDown;
            this.tableFiles.CellMouseEnter += TableFiles_CellMouseEnter;
            this.tableFiles.CellMouseLeave += TableFiles_CellMouseLeave;
            ImageColumn fileNameColumn = new ImageColumn("文件名", 240)
            {
                DrawText = true
            };
            TextColumn fileSizeColumn = new TextColumn("文件大小", 90)
            {
                Editable = false
            };
            NumberColumn pageStartColumn = new NumberColumn("起始页", 60)
            {
                Editable          = true,
                Minimum           = 1,
                Maximum           = 2000,
                ShowUpDownButtons = true
            };
            NumberColumn pageEndColumn = new NumberColumn("结束页", 60)
            {
                Editable          = true,
                Minimum           = 1,
                Maximum           = 2000,
                ShowUpDownButtons = true
            };
            ProgressBarColumn progressColumn = new ProgressBarColumn("状态", 100);
            ImageColumn       deleteColumn   = new ImageColumn("移除", 35)
            {
                DrawText = false
            };
            TextColumn filePathColumn = new TextColumn("文件路径", null, 0, false);

            this.columnModel.Columns.AddRange(new Column[] { fileNameColumn,
                                                             fileSizeColumn,
                                                             pageStartColumn,
                                                             pageEndColumn,
                                                             progressColumn,
                                                             deleteColumn, filePathColumn });
        }
Пример #12
0
        private void DoSorting(bool withMulti)
        {
            Table table = this.table;       // The Table control on a form - already initialised

            table.Clear();
            table.BeginUpdate();
            table.EnableWordWrap = true;    // If false, then Cell.WordWrap is ignored

            NumberColumn   col0 = new NumberColumn("#", 20);
            NumberColumn   col1 = new NumberColumn("Height", 50);
            TextColumn     col2 = new TextColumn("Name", 80);
            TextColumn     col3 = new TextColumn("Surname", 80);
            DateTimeColumn col4 = new DateTimeColumn("Birthday", 120);
            TextColumn     col5 = new TextColumn("Comments", 100);

            table.ColumnModel = new ColumnModel(new Column[] { col0, col1, col2, col3, col4, col5 });

            if (withMulti)
            {
                // Surname, Name, Height (descending)
                SortColumnCollection sort = new SortColumnCollection();
                sort.Add(new SortColumn(3, SortOrder.Ascending));   // Surname
                sort.Add(new SortColumn(2, SortOrder.Ascending));   // Name
                sort.Add(new SortColumn(1, SortOrder.Descending));  // Height
                table.ColumnModel.SecondarySortOrders = sort;
            }

            TableModel model = new TableModel();

            AddSortingRow(model, 1, 1.52, "Mark", "Hobbs", "23/1/1978", "likes apples");
            AddSortingRow(model, 2, 1.76, "Dave", "Duke", "2/5/1977", "keeps fish");
            AddSortingRow(model, 3, 1.64, "Holly", "Prench", "14/8/1979", "singer");
            AddSortingRow(model, 4, 1.53, "Mark", "Hobbs", "23/1/1984", "plays football");
            AddSortingRow(model, 5, 1.64, "Dave", "Hobbs", "19/1/1980", "vegetarian");

            this.table.TableModel = model;

            this.table.EndUpdate();
        }
Пример #13
0
        /// <summary>
        /// Creates a column model for a tribe
        /// </summary>
        /// <param name="fields">The visible columns</param>
        public static ColumnModel CreateColumnModel(TribeFields fields)
        {
            ImageColumn  visibleColumn                 = CreateImageColumn(string.Empty, 20, VillageGridExRes.Tribe_VisibleTooltip);
            NumberColumn tribeRankColumn               = CreateNumberColumn(VillageGridExRes.Rank, 40, VillageGridExRes.Tribe_RankTooltip);
            TextColumn   tribeTagColumn                = CreateTextColumn(VillageGridExRes.TribeTag, 50, VillageGridExRes.Tribe_TagTooltip);
            NumberColumn tribePlayersColumn            = CreateNumberColumn(VillageGridExRes.Players, 55, VillageGridExRes.Tribe_PlayersTooltip);
            TextColumn   tribePlayersDifferenceColumn  = CreateTextColumn(VillageGridExRes.Difference, 50, VillageGridExRes.Tribe_PlayersDiffTooltip);
            NumberColumn tribePointsColumn             = CreateNumberColumn(VillageGridExRes.Points, 75, VillageGridExRes.Tribe_PointsTooltip);
            NumberColumn tribePointsDifferenceColumn   = CreateNumberColumn(VillageGridExRes.Difference, 70, VillageGridExRes.Tribe_PointsDiffTooltip);
            NumberColumn tribeVillagesColumn           = CreateNumberColumn(VillageGridExRes.Villages, 55, VillageGridExRes.Tribe_VillagesTooltip);
            NumberColumn tribeVillagesDifferenceColumn = CreateNumberColumn(VillageGridExRes.Difference, 55, VillageGridExRes.Tribe_VillagesDiffTooltip);
            TextColumn   tribeNameColumn               = CreateTextColumn(VillageGridExRes.Name, 130, VillageGridExRes.Tribe_NameTooltip);

            tribeRankColumn.Visible               = (fields & TribeFields.Rank) != 0;
            tribeTagColumn.Visible                = (fields & TribeFields.Tag) != 0;
            tribeNameColumn.Visible               = (fields & TribeFields.Name) != 0;
            tribePlayersColumn.Visible            = (fields & TribeFields.Players) != 0;
            tribePlayersDifferenceColumn.Visible  = (fields & TribeFields.PlayersDifference) != 0;
            tribePointsColumn.Visible             = (fields & TribeFields.Points) != 0;
            tribePointsDifferenceColumn.Visible   = (fields & TribeFields.PointsDifference) != 0;
            tribeVillagesColumn.Visible           = (fields & TribeFields.Villages) != 0;
            tribeVillagesDifferenceColumn.Visible = (fields & TribeFields.VillagesDifference) != 0;

            return(new ColumnModel(new Column[] {
                visibleColumn,
                tribeRankColumn,
                tribeTagColumn,
                tribePlayersColumn,
                tribePlayersDifferenceColumn,
                tribePointsColumn,
                tribePointsDifferenceColumn,
                tribeVillagesColumn,
                tribeVillagesDifferenceColumn,
                tribeNameColumn
            }));
        }
Пример #14
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     XPTable.Models.Row row1 = new XPTable.Models.Row();
     System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmListLeaveSchedule));
     this.cboDepartment     = new System.Windows.Forms.ComboBox();
     this.label1            = new System.Windows.Forms.Label();
     this.dtpTo             = new System.Windows.Forms.DateTimePicker();
     this.dtpFrom           = new System.Windows.Forms.DateTimePicker();
     this.label3            = new System.Windows.Forms.Label();
     this.label2            = new System.Windows.Forms.Label();
     this.dtgcCardID        = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dtgcEmployeeName  = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dtgcDepartment    = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dtgcLeaveLocation = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dtgcWorkInfo      = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dtgcStartLeave    = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dtgcEndLeave      = new System.Windows.Forms.DataGridTextBoxColumn();
     this.tableModel1       = new XPTable.Models.TableModel();
     this.columnModel1      = new XPTable.Models.ColumnModel();
     this.cSTT             = new XPTable.Models.NumberColumn();
     this.chDepartment     = new XPTable.Models.TextColumn();
     this.chCardID         = new XPTable.Models.TextColumn();
     this.chEmployeeName   = new XPTable.Models.TextColumn();
     this.chStartLeave     = new XPTable.Models.TextColumn();
     this.EndLeave         = new XPTable.Models.TextColumn();
     this.chLeaveLocation  = new XPTable.Models.TextColumn();
     this.chWorkInfo       = new XPTable.Models.TextColumn();
     this.lvwLeaveSchedule = new XPTable.Models.Table();
     this.groupBox1        = new System.Windows.Forms.GroupBox();
     this.groupBox2        = new System.Windows.Forms.GroupBox();
     this.btnEdit          = new System.Windows.Forms.Button();
     this.btnDelete        = new System.Windows.Forms.Button();
     this.btnAdd           = new System.Windows.Forms.Button();
     this.btnView          = new System.Windows.Forms.Button();
     this.btnClose         = new System.Windows.Forms.Button();
     this.btnExcel         = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.lvwLeaveSchedule)).BeginInit();
     this.groupBox1.SuspendLayout();
     this.groupBox2.SuspendLayout();
     this.SuspendLayout();
     //
     // cboDepartment
     //
     this.cboDepartment.Anchor        = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.cboDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.cboDepartment.Location      = new System.Drawing.Point(472, 16);
     this.cboDepartment.Name          = "cboDepartment";
     this.cboDepartment.Size          = new System.Drawing.Size(224, 21);
     this.cboDepartment.TabIndex      = 24;
     //
     // label1
     //
     this.label1.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.label1.Location  = new System.Drawing.Point(408, 16);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(64, 23);
     this.label1.TabIndex  = 23;
     this.label1.Text      = "Bộ phận";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // dtpTo
     //
     this.dtpTo.CustomFormat = "dd/MM/yyyy    ";
     this.dtpTo.Format       = System.Windows.Forms.DateTimePickerFormat.Custom;
     this.dtpTo.Location     = new System.Drawing.Point(224, 16);
     this.dtpTo.Name         = "dtpTo";
     this.dtpTo.Size         = new System.Drawing.Size(88, 20);
     this.dtpTo.TabIndex     = 20;
     this.dtpTo.CloseUp     += new System.EventHandler(this.dtpTo_CloseUp);
     //
     // dtpFrom
     //
     this.dtpFrom.CustomFormat = "dd/MM/yyyy    ";
     this.dtpFrom.Format       = System.Windows.Forms.DateTimePickerFormat.Custom;
     this.dtpFrom.Location     = new System.Drawing.Point(64, 16);
     this.dtpFrom.Name         = "dtpFrom";
     this.dtpFrom.Size         = new System.Drawing.Size(88, 20);
     this.dtpFrom.TabIndex     = 19;
     this.dtpFrom.CloseUp     += new System.EventHandler(this.dtpFrom_CloseUp);
     //
     // label3
     //
     this.label3.Location  = new System.Drawing.Point(160, 16);
     this.label3.Name      = "label3";
     this.label3.Size      = new System.Drawing.Size(64, 24);
     this.label3.TabIndex  = 22;
     this.label3.Text      = "Đến ngày";
     this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label2
     //
     this.label2.Location  = new System.Drawing.Point(8, 16);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(56, 24);
     this.label2.TabIndex  = 21;
     this.label2.Text      = "Từ ngày";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // dtgcCardID
     //
     this.dtgcCardID.Format      = "";
     this.dtgcCardID.FormatInfo  = null;
     this.dtgcCardID.HeaderText  = "Mã thẻ";
     this.dtgcCardID.MappingName = "CardID";
     this.dtgcCardID.Width       = 75;
     //
     // dtgcEmployeeName
     //
     this.dtgcEmployeeName.Format      = "";
     this.dtgcEmployeeName.FormatInfo  = null;
     this.dtgcEmployeeName.HeaderText  = "Tên nhân viên";
     this.dtgcEmployeeName.MappingName = "EmployeeName";
     this.dtgcEmployeeName.Width       = 120;
     //
     // dtgcDepartment
     //
     this.dtgcDepartment.Format      = "";
     this.dtgcDepartment.FormatInfo  = null;
     this.dtgcDepartment.HeaderText  = "Phòng";
     this.dtgcDepartment.MappingName = "DepartmentName";
     this.dtgcDepartment.Width       = 80;
     //
     // dtgcLeaveLocation
     //
     this.dtgcLeaveLocation.Format      = "";
     this.dtgcLeaveLocation.FormatInfo  = null;
     this.dtgcLeaveLocation.HeaderText  = "Nơi công tác";
     this.dtgcLeaveLocation.MappingName = "LeaveLocation";
     this.dtgcLeaveLocation.Width       = 75;
     //
     // dtgcWorkInfo
     //
     this.dtgcWorkInfo.Format      = "";
     this.dtgcWorkInfo.FormatInfo  = null;
     this.dtgcWorkInfo.HeaderText  = "Công việc";
     this.dtgcWorkInfo.MappingName = "WorkInfo";
     this.dtgcWorkInfo.Width       = 150;
     //
     // dtgcStartLeave
     //
     this.dtgcStartLeave.Format      = "";
     this.dtgcStartLeave.FormatInfo  = null;
     this.dtgcStartLeave.HeaderText  = "Ngày đi";
     this.dtgcStartLeave.MappingName = "StartLeave";
     this.dtgcStartLeave.Width       = 75;
     //
     // dtgcEndLeave
     //
     this.dtgcEndLeave.Format      = "";
     this.dtgcEndLeave.FormatInfo  = null;
     this.dtgcEndLeave.HeaderText  = "Ngày về";
     this.dtgcEndLeave.MappingName = "EndLeave";
     this.dtgcEndLeave.Width       = 75;
     //
     // tableModel1
     //
     this.tableModel1.Rows.AddRange(new XPTable.Models.Row[] {
         row1
     });
     //
     // columnModel1
     //
     this.columnModel1.Columns.AddRange(new XPTable.Models.Column[] {
         this.cSTT,
         this.chDepartment,
         this.chCardID,
         this.chEmployeeName,
         this.chStartLeave,
         this.EndLeave,
         this.chLeaveLocation,
         this.chWorkInfo
     });
     //
     // cSTT
     //
     this.cSTT.Editable = false;
     this.cSTT.Text     = "STT";
     this.cSTT.Width    = 40;
     //
     // chDepartment
     //
     this.chDepartment.Editable = false;
     this.chDepartment.Text     = "Bộ phận";
     this.chDepartment.Width    = 100;
     //
     // chCardID
     //
     this.chCardID.Editable = false;
     this.chCardID.Text     = "Mã thẻ";
     this.chCardID.Width    = 60;
     //
     // chEmployeeName
     //
     this.chEmployeeName.Editable = false;
     this.chEmployeeName.Text     = "Tên nhân viên";
     this.chEmployeeName.Width    = 130;
     //
     // chStartLeave
     //
     this.chStartLeave.Editable = false;
     this.chStartLeave.Text     = "Bắt đầu";
     //
     // EndLeave
     //
     this.EndLeave.Editable = false;
     this.EndLeave.Text     = "Kết thúc";
     //
     // chLeaveLocation
     //
     this.chLeaveLocation.Editable = false;
     this.chLeaveLocation.Text     = "Nơi công tác";
     this.chLeaveLocation.Width    = 90;
     //
     // chWorkInfo
     //
     this.chWorkInfo.Editable = false;
     this.chWorkInfo.Text     = "Nội dung công việc";
     this.chWorkInfo.Width    = 140;
     //
     // lvwLeaveSchedule
     //
     this.lvwLeaveSchedule.AlternatingRowColor = System.Drawing.Color.FromArgb(((System.Byte)(230)), ((System.Byte)(237)), ((System.Byte)(245)));
     this.lvwLeaveSchedule.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                           | System.Windows.Forms.AnchorStyles.Left)
                                                                          | System.Windows.Forms.AnchorStyles.Right)));
     this.lvwLeaveSchedule.BackColor                   = System.Drawing.Color.FromArgb(((System.Byte)(237)), ((System.Byte)(242)), ((System.Byte)(249)));
     this.lvwLeaveSchedule.ColumnModel                 = this.columnModel1;
     this.lvwLeaveSchedule.EnableToolTips              = true;
     this.lvwLeaveSchedule.ForeColor                   = System.Drawing.Color.FromArgb(((System.Byte)(14)), ((System.Byte)(66)), ((System.Byte)(121)));
     this.lvwLeaveSchedule.FullRowSelect               = true;
     this.lvwLeaveSchedule.GridColor                   = System.Drawing.SystemColors.ControlDark;
     this.lvwLeaveSchedule.GridLines                   = XPTable.Models.GridLines.Both;
     this.lvwLeaveSchedule.GridLineStyle               = XPTable.Models.GridLineStyle.Dot;
     this.lvwLeaveSchedule.HeaderFont                  = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
     this.lvwLeaveSchedule.Location                    = new System.Drawing.Point(8, 16);
     this.lvwLeaveSchedule.Name                        = "lvwLeaveSchedule";
     this.lvwLeaveSchedule.NoItemsText                 = WorkingContext.LangManager.GetString("XPtable");
     this.lvwLeaveSchedule.SelectionBackColor          = System.Drawing.Color.FromArgb(((System.Byte)(169)), ((System.Byte)(183)), ((System.Byte)(201)));
     this.lvwLeaveSchedule.SelectionForeColor          = System.Drawing.Color.FromArgb(((System.Byte)(14)), ((System.Byte)(66)), ((System.Byte)(121)));
     this.lvwLeaveSchedule.SelectionStyle              = XPTable.Models.SelectionStyle.Grid;
     this.lvwLeaveSchedule.Size                        = new System.Drawing.Size(688, 400);
     this.lvwLeaveSchedule.SortedColumnBackColor       = System.Drawing.Color.Transparent;
     this.lvwLeaveSchedule.TabIndex                    = 30;
     this.lvwLeaveSchedule.TableModel                  = this.tableModel1;
     this.lvwLeaveSchedule.UnfocusedSelectionBackColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(210)), ((System.Byte)(221)));
     this.lvwLeaveSchedule.UnfocusedSelectionForeColor = System.Drawing.Color.FromArgb(((System.Byte)(14)), ((System.Byte)(66)), ((System.Byte)(121)));
     this.lvwLeaveSchedule.SelectionChanged           += new XPTable.Events.SelectionEventHandler(this.lvwLeaveSchedule_SelectionChanged);
     this.lvwLeaveSchedule.MouseDown                  += new System.Windows.Forms.MouseEventHandler(this.lvwLeaveSchedule_MouseDown);
     //
     // groupBox1
     //
     this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.groupBox1.Controls.Add(this.lvwLeaveSchedule);
     this.groupBox1.Location = new System.Drawing.Point(8, 48);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(704, 424);
     this.groupBox1.TabIndex = 31;
     this.groupBox1.TabStop  = false;
     //
     // groupBox2
     //
     this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.groupBox2.Controls.Add(this.dtpTo);
     this.groupBox2.Controls.Add(this.dtpFrom);
     this.groupBox2.Controls.Add(this.label3);
     this.groupBox2.Controls.Add(this.label2);
     this.groupBox2.Controls.Add(this.label1);
     this.groupBox2.Controls.Add(this.cboDepartment);
     this.groupBox2.Location = new System.Drawing.Point(8, 0);
     this.groupBox2.Name     = "groupBox2";
     this.groupBox2.Size     = new System.Drawing.Size(704, 48);
     this.groupBox2.TabIndex = 32;
     this.groupBox2.TabStop  = false;
     //
     // btnEdit
     //
     this.btnEdit.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnEdit.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnEdit.Location  = new System.Drawing.Point(472, 480);
     this.btnEdit.Name      = "btnEdit";
     this.btnEdit.TabIndex  = 36;
     this.btnEdit.Text      = "Sửa";
     this.btnEdit.Click    += new System.EventHandler(this.btnEdit_Click);
     //
     // btnDelete
     //
     this.btnDelete.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnDelete.Location  = new System.Drawing.Point(552, 480);
     this.btnDelete.Name      = "btnDelete";
     this.btnDelete.TabIndex  = 37;
     this.btnDelete.Text      = "Xóa";
     this.btnDelete.Click    += new System.EventHandler(this.btnDelete_Click);
     //
     // btnAdd
     //
     this.btnAdd.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnAdd.Location  = new System.Drawing.Point(392, 480);
     this.btnAdd.Name      = "btnAdd";
     this.btnAdd.TabIndex  = 35;
     this.btnAdd.Text      = "Thêm";
     this.btnAdd.Click    += new System.EventHandler(this.btnAdd_Click);
     //
     // btnView
     //
     this.btnView.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.btnView.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnView.Location  = new System.Drawing.Point(8, 480);
     this.btnView.Name      = "btnView";
     this.btnView.TabIndex  = 33;
     this.btnView.Text      = "Xem";
     this.btnView.Click    += new System.EventHandler(this.btnView_Click);
     //
     // btnClose
     //
     this.btnClose.Anchor       = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.btnClose.FlatStyle    = System.Windows.Forms.FlatStyle.System;
     this.btnClose.Location     = new System.Drawing.Point(632, 480);
     this.btnClose.Name         = "btnClose";
     this.btnClose.TabIndex     = 34;
     this.btnClose.Text         = "Đóng";
     this.btnClose.Click       += new System.EventHandler(this.btnClose_Click);
     //
     // btnExcel
     //
     this.btnExcel.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnExcel.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnExcel.Location  = new System.Drawing.Point(272, 480);
     this.btnExcel.Name      = "btnExcel";
     this.btnExcel.Size      = new System.Drawing.Size(112, 23);
     this.btnExcel.TabIndex  = 38;
     this.btnExcel.Text      = "Xuất Excel";
     this.btnExcel.Click    += new System.EventHandler(this.btnExcel_Click);
     //
     // frmListLeaveSchedule
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(720, 510);
     this.Controls.Add(this.btnExcel);
     this.Controls.Add(this.btnEdit);
     this.Controls.Add(this.btnDelete);
     this.Controls.Add(this.btnAdd);
     this.Controls.Add(this.btnView);
     this.Controls.Add(this.btnClose);
     this.Controls.Add(this.groupBox2);
     this.Controls.Add(this.groupBox1);
     this.Icon        = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name        = "frmListLeaveSchedule";
     this.Text        = "Danh sách nhân viên đi công tác";
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.Load       += new System.EventHandler(this.ListLeaveSchedule_Load);
     ((System.ComponentModel.ISupportInitialize)(this.lvwLeaveSchedule)).EndInit();
     this.groupBox1.ResumeLayout(false);
     this.groupBox2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Пример #15
0
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmListRegRestEmployee));
     this.label1          = new System.Windows.Forms.Label();
     this.dtpStartRest    = new System.Windows.Forms.DateTimePicker();
     this.dtpEndRest      = new System.Windows.Forms.DateTimePicker();
     this.label2          = new System.Windows.Forms.Label();
     this.label3          = new System.Windows.Forms.Label();
     this.cboDepartment   = new System.Windows.Forms.ComboBox();
     this.groupBox1       = new System.Windows.Forms.GroupBox();
     this.lvwRestEmployee = new XPTable.Models.Table();
     this.columnModel1    = new XPTable.Models.ColumnModel();
     this.cSTT            = new XPTable.Models.NumberColumn();
     this.cDepartmentName = new XPTable.Models.TextColumn();
     this.cCardID         = new XPTable.Models.TextColumn();
     this.cEmployeeName   = new XPTable.Models.TextColumn();
     this.cDayName        = new XPTable.Models.TextColumn();
     this.cStartDate      = new XPTable.Models.TextColumn();
     this.cEndDate        = new XPTable.Models.TextColumn();
     this.txtThoiGianNghi = new XPTable.Models.TextColumn();
     this.cRestReason     = new XPTable.Models.TextColumn();
     this.tableModel1     = new XPTable.Models.TableModel();
     this.btnDelete       = new System.Windows.Forms.Button();
     this.btnModify       = new System.Windows.Forms.Button();
     this.btnClose        = new System.Windows.Forms.Button();
     this.btnAdd          = new System.Windows.Forms.Button();
     this.dgsEmployeeName = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dgsCardID       = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dgsDepartment   = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dtgDayName      = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dgsRestReason   = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dtgStartRest    = new System.Windows.Forms.DataGridTextBoxColumn();
     this.dgsEndRest      = new System.Windows.Forms.DataGridTextBoxColumn();
     this.groupBox2       = new System.Windows.Forms.GroupBox();
     this.btnExcel        = new System.Windows.Forms.Button();
     this.groupBox1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.lvwRestEmployee)).BeginInit();
     this.groupBox2.SuspendLayout();
     this.SuspendLayout();
     //
     // label1
     //
     this.label1.Location  = new System.Drawing.Point(8, 16);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(48, 23);
     this.label1.TabIndex  = 0;
     this.label1.Text      = "Từ ngày";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // dtpStartRest
     //
     this.dtpStartRest.CustomFormat = "dd/MM/yyyy    ";
     this.dtpStartRest.Format       = System.Windows.Forms.DateTimePickerFormat.Custom;
     this.dtpStartRest.Location     = new System.Drawing.Point(56, 16);
     this.dtpStartRest.Name         = "dtpStartRest";
     this.dtpStartRest.Size         = new System.Drawing.Size(112, 20);
     this.dtpStartRest.TabIndex     = 1;
     this.dtpStartRest.CloseUp     += new System.EventHandler(this.dtpStartRest_CloseUp);
     //
     // dtpEndRest
     //
     this.dtpEndRest.CustomFormat = "dd/MM/yyyy   ";
     this.dtpEndRest.Format       = System.Windows.Forms.DateTimePickerFormat.Custom;
     this.dtpEndRest.Location     = new System.Drawing.Point(240, 16);
     this.dtpEndRest.Name         = "dtpEndRest";
     this.dtpEndRest.Size         = new System.Drawing.Size(112, 20);
     this.dtpEndRest.TabIndex     = 3;
     this.dtpEndRest.CloseUp     += new System.EventHandler(this.dtpEndRest_CloseUp);
     //
     // label2
     //
     this.label2.Location  = new System.Drawing.Point(184, 16);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(64, 23);
     this.label2.TabIndex  = 2;
     this.label2.Text      = "Đến ngày";
     this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // label3
     //
     this.label3.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.label3.Location  = new System.Drawing.Point(492, 16);
     this.label3.Name      = "label3";
     this.label3.Size      = new System.Drawing.Size(80, 23);
     this.label3.TabIndex  = 4;
     this.label3.Text      = "Tên bộ phận";
     this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // cboDepartment
     //
     this.cboDepartment.Anchor        = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.cboDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.cboDepartment.Location      = new System.Drawing.Point(572, 16);
     this.cboDepartment.Name          = "cboDepartment";
     this.cboDepartment.Size          = new System.Drawing.Size(208, 21);
     this.cboDepartment.TabIndex      = 5;
     //
     // groupBox1
     //
     this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.groupBox1.Controls.Add(this.lvwRestEmployee);
     this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.groupBox1.Location  = new System.Drawing.Point(8, 48);
     this.groupBox1.Name      = "groupBox1";
     this.groupBox1.Size      = new System.Drawing.Size(788, 492);
     this.groupBox1.TabIndex  = 6;
     this.groupBox1.TabStop   = false;
     this.groupBox1.Text      = "Danh sách nhân viên nghỉ";
     //
     // lvwRestEmployee
     //
     this.lvwRestEmployee.AlternatingRowColor = System.Drawing.Color.FromArgb(((int)(((byte)(230)))), ((int)(((byte)(237)))), ((int)(((byte)(245)))));
     this.lvwRestEmployee.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                          | System.Windows.Forms.AnchorStyles.Left)
                                                                         | System.Windows.Forms.AnchorStyles.Right)));
     this.lvwRestEmployee.BackColor                   = System.Drawing.Color.FromArgb(((int)(((byte)(237)))), ((int)(((byte)(242)))), ((int)(((byte)(249)))));
     this.lvwRestEmployee.ColumnModel                 = this.columnModel1;
     this.lvwRestEmployee.EnableToolTips              = true;
     this.lvwRestEmployee.ForeColor                   = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(66)))), ((int)(((byte)(121)))));
     this.lvwRestEmployee.FullRowSelect               = true;
     this.lvwRestEmployee.GridColor                   = System.Drawing.SystemColors.ControlDark;
     this.lvwRestEmployee.GridLines                   = XPTable.Models.GridLines.Both;
     this.lvwRestEmployee.GridLineStyle               = XPTable.Models.GridLineStyle.Dot;
     this.lvwRestEmployee.HeaderFont                  = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
     this.lvwRestEmployee.Location                    = new System.Drawing.Point(8, 16);
     this.lvwRestEmployee.Name                        = "lvwRestEmployee";
     this.lvwRestEmployee.SelectionBackColor          = System.Drawing.Color.FromArgb(((int)(((byte)(169)))), ((int)(((byte)(183)))), ((int)(((byte)(201)))));
     this.lvwRestEmployee.SelectionForeColor          = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(66)))), ((int)(((byte)(121)))));
     this.lvwRestEmployee.SelectionStyle              = XPTable.Models.SelectionStyle.Grid;
     this.lvwRestEmployee.Size                        = new System.Drawing.Size(772, 460);
     this.lvwRestEmployee.SortedColumnBackColor       = System.Drawing.Color.Transparent;
     this.lvwRestEmployee.TabIndex                    = 11;
     this.lvwRestEmployee.TableModel                  = this.tableModel1;
     this.lvwRestEmployee.UnfocusedSelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(201)))), ((int)(((byte)(210)))), ((int)(((byte)(221)))));
     this.lvwRestEmployee.UnfocusedSelectionForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(14)))), ((int)(((byte)(66)))), ((int)(((byte)(121)))));
     this.lvwRestEmployee.MouseDown                  += new System.Windows.Forms.MouseEventHandler(this.lvwRestEmployee_MouseDown);
     this.lvwRestEmployee.SelectionChanged           += new XPTable.Events.SelectionEventHandler(this.lvwRestEmployee_SelectionChanged);
     //
     // columnModel1
     //
     this.columnModel1.Columns.AddRange(new XPTable.Models.Column[] {
         this.cSTT,
         this.cDepartmentName,
         this.cCardID,
         this.cEmployeeName,
         this.cDayName,
         this.cStartDate,
         this.cEndDate,
         this.txtThoiGianNghi,
         this.cRestReason
     });
     //
     // cSTT
     //
     this.cSTT.Editable = false;
     this.cSTT.Maximum  = new decimal(new int[] {
         10000,
         0,
         0,
         0
     });
     this.cSTT.Text  = "STT";
     this.cSTT.Width = 40;
     //
     // cDepartmentName
     //
     this.cDepartmentName.Editable = false;
     this.cDepartmentName.Text     = "Tên bộ phận";
     this.cDepartmentName.Width    = 100;
     //
     // cCardID
     //
     this.cCardID.Editable = false;
     this.cCardID.Text     = "Mã thẻ";
     this.cCardID.Width    = 60;
     //
     // cEmployeeName
     //
     this.cEmployeeName.Editable = false;
     this.cEmployeeName.Text     = "Tên nhân viên";
     this.cEmployeeName.Width    = 130;
     //
     // cDayName
     //
     this.cDayName.Editable = false;
     this.cDayName.Text     = "Kiểu ngày nghỉ";
     this.cDayName.Width    = 110;
     //
     // cStartDate
     //
     this.cStartDate.Editable = false;
     this.cStartDate.Text     = "Ngày bắt đầu";
     this.cStartDate.Width    = 90;
     //
     // cEndDate
     //
     this.cEndDate.Editable = false;
     this.cEndDate.Text     = "Ngày kết thúc";
     this.cEndDate.Width    = 90;
     //
     // txtThoiGianNghi
     //
     this.txtThoiGianNghi.Editable = false;
     this.txtThoiGianNghi.Text     = "Thời gian nghỉ";
     this.txtThoiGianNghi.Width    = 100;
     //
     // cRestReason
     //
     this.cRestReason.Editable = false;
     this.cRestReason.Text     = "Lý do nghỉ";
     this.cRestReason.Width    = 150;
     //
     // btnDelete
     //
     this.btnDelete.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnDelete.Location  = new System.Drawing.Point(636, 548);
     this.btnDelete.Name      = "btnDelete";
     this.btnDelete.Size      = new System.Drawing.Size(75, 23);
     this.btnDelete.TabIndex  = 11;
     this.btnDelete.Text      = "Xóa";
     this.btnDelete.Click    += new System.EventHandler(this.btnDelete_Click);
     //
     // btnModify
     //
     this.btnModify.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnModify.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnModify.Location  = new System.Drawing.Point(556, 548);
     this.btnModify.Name      = "btnModify";
     this.btnModify.Size      = new System.Drawing.Size(75, 23);
     this.btnModify.TabIndex  = 10;
     this.btnModify.Text      = "Sửa";
     this.btnModify.Click    += new System.EventHandler(this.btnModify_Click);
     //
     // btnClose
     //
     this.btnClose.Anchor       = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.btnClose.FlatStyle    = System.Windows.Forms.FlatStyle.System;
     this.btnClose.Location     = new System.Drawing.Point(716, 548);
     this.btnClose.Name         = "btnClose";
     this.btnClose.Size         = new System.Drawing.Size(75, 23);
     this.btnClose.TabIndex     = 9;
     this.btnClose.Text         = "Đóng";
     this.btnClose.Click       += new System.EventHandler(this.btnClose_Click);
     //
     // btnAdd
     //
     this.btnAdd.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnAdd.Location  = new System.Drawing.Point(476, 548);
     this.btnAdd.Name      = "btnAdd";
     this.btnAdd.Size      = new System.Drawing.Size(75, 23);
     this.btnAdd.TabIndex  = 7;
     this.btnAdd.Text      = "Thêm";
     this.btnAdd.Click    += new System.EventHandler(this.btnAdd_Click);
     //
     // dgsEmployeeName
     //
     //this.dgsEmployeeName.Format = global::EVSoft.HRMS.Common.Lang.LangResource_vi_VN.string1;
     this.dgsEmployeeName.FormatInfo  = null;
     this.dgsEmployeeName.HeaderText  = "Tên nhân viên";
     this.dgsEmployeeName.MappingName = "EmployeeName";
     this.dgsEmployeeName.Width       = 120;
     //
     // dgsCardID
     //
     //this.dgsCardID.Format = global::EVSoft.HRMS.Common.Lang.LangResource_vi_VN.string1;
     this.dgsCardID.FormatInfo  = null;
     this.dgsCardID.HeaderText  = "Mã nhân viên";
     this.dgsCardID.MappingName = "CardID";
     this.dgsCardID.Width       = 75;
     //
     // dgsDepartment
     //
     //this.dgsDepartment.Format = global::EVSoft.HRMS.Common.Lang.LangResource_vi_VN.string1;
     this.dgsDepartment.FormatInfo  = null;
     this.dgsDepartment.HeaderText  = "Phòng";
     this.dgsDepartment.MappingName = "DepartmentName";
     this.dgsDepartment.Width       = 80;
     //
     // dtgDayName
     //
     //this.dtgDayName.Format = global::EVSoft.HRMS.Common.Lang.LangResource_vi_VN.string1;
     this.dtgDayName.FormatInfo  = null;
     this.dtgDayName.HeaderText  = "Kiểu ngày";
     this.dtgDayName.MappingName = "DayName";
     this.dtgDayName.Width       = 90;
     //
     // dgsRestReason
     //
     //this.dgsRestReason.Format = global::EVSoft.HRMS.Common.Lang.LangResource_vi_VN.string1;
     this.dgsRestReason.FormatInfo  = null;
     this.dgsRestReason.HeaderText  = "Lý do nghỉ";
     this.dgsRestReason.MappingName = "RestReason";
     this.dgsRestReason.Width       = 120;
     //
     // dtgStartRest
     //
     this.dtgStartRest.Format      = "dd/MM/yyyy    ";
     this.dtgStartRest.FormatInfo  = null;
     this.dtgStartRest.HeaderText  = "Bắt đầu";
     this.dtgStartRest.MappingName = "StartRest";
     this.dtgStartRest.Width       = 75;
     //
     // dgsEndRest
     //
     this.dgsEndRest.Format      = "dd/MM/yyyy    ";
     this.dgsEndRest.FormatInfo  = null;
     this.dgsEndRest.HeaderText  = "Kết thúc";
     this.dgsEndRest.MappingName = "EndRest";
     this.dgsEndRest.Width       = 75;
     //
     // groupBox2
     //
     this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.groupBox2.Controls.Add(this.label1);
     this.groupBox2.Controls.Add(this.dtpStartRest);
     this.groupBox2.Controls.Add(this.dtpEndRest);
     this.groupBox2.Controls.Add(this.label2);
     this.groupBox2.Controls.Add(this.label3);
     this.groupBox2.Controls.Add(this.cboDepartment);
     this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.groupBox2.Location  = new System.Drawing.Point(8, 0);
     this.groupBox2.Name      = "groupBox2";
     this.groupBox2.Size      = new System.Drawing.Size(788, 48);
     this.groupBox2.TabIndex  = 12;
     this.groupBox2.TabStop   = false;
     //
     // btnExcel
     //
     this.btnExcel.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnExcel.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnExcel.Location  = new System.Drawing.Point(352, 548);
     this.btnExcel.Name      = "btnExcel";
     this.btnExcel.Size      = new System.Drawing.Size(112, 23);
     this.btnExcel.TabIndex  = 13;
     this.btnExcel.Text      = "Xuất Excel";
     this.btnExcel.Click    += new System.EventHandler(this.btnExcel_Click);
     //
     // frmListRegRestEmployee
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.CancelButton      = this.btnClose;
     this.ClientSize        = new System.Drawing.Size(804, 578);
     this.Controls.Add(this.btnExcel);
     this.Controls.Add(this.groupBox1);
     this.Controls.Add(this.btnDelete);
     this.Controls.Add(this.btnModify);
     this.Controls.Add(this.btnAdd);
     this.Controls.Add(this.btnClose);
     this.Controls.Add(this.groupBox2);
     this.Icon        = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.Name        = "frmListRegRestEmployee";
     this.Text        = "Danh sách nhân viên nghỉ";
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.Load       += new System.EventHandler(this.frmListRegRestEmployee_Load);
     this.groupBox1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.lvwRestEmployee)).EndInit();
     this.groupBox2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
        private void Initialize_Table()
        {
            this.table.BeginUpdate();

            NumberColumn   column0  = new NumberColumn("#", 50);
            TextColumn     column1  = new TextColumn("IMEI", 160);
            TextColumn     column2  = new TextColumn("PHONE", 160);
            ColorColumn    column3  = new ColorColumn("Jan", 23);
            ColorColumn    column4  = new ColorColumn("Feb", 23);
            ColorColumn    column5  = new ColorColumn("Mar", 23);
            ColorColumn    column6  = new ColorColumn("Apr", 23);
            ColorColumn    column7  = new ColorColumn("May", 23);
            ColorColumn    column8  = new ColorColumn("Jun", 23);
            ColorColumn    column9  = new ColorColumn("Jul", 23);
            ColorColumn    column10 = new ColorColumn("Aug", 23);
            ColorColumn    column11 = new ColorColumn("Sep", 23);
            ColorColumn    column12 = new ColorColumn("Oct", 23);
            ColorColumn    column13 = new ColorColumn("Nov", 23);
            ColorColumn    column14 = new ColorColumn("Dec", 23);
            TextColumn     column15 = new TextColumn("BLOCKED", 130);
            CheckBoxColumn column16 = new CheckBoxColumn("SIM BLOCK", 130);

            column0.Alignment  = ColumnAlignment.Center;
            column1.Alignment  = ColumnAlignment.Center;
            column2.Alignment  = ColumnAlignment.Center;
            column3.Alignment  = ColumnAlignment.Center;
            column4.Alignment  = ColumnAlignment.Center;
            column5.Alignment  = ColumnAlignment.Center;
            column6.Alignment  = ColumnAlignment.Center;
            column7.Alignment  = ColumnAlignment.Center;
            column8.Alignment  = ColumnAlignment.Center;
            column9.Alignment  = ColumnAlignment.Center;
            column10.Alignment = ColumnAlignment.Center;
            column11.Alignment = ColumnAlignment.Center;
            column12.Alignment = ColumnAlignment.Center;
            column13.Alignment = ColumnAlignment.Center;
            column14.Alignment = ColumnAlignment.Center;
            column15.Alignment = ColumnAlignment.Center;
            column16.Alignment = ColumnAlignment.Center;

            column3.ShowColorName       = false;
            column3.ShowDropDownButton  = false;
            column3.Sortable            = false;
            column4.ShowColorName       = false;
            column4.ShowDropDownButton  = false;
            column4.Sortable            = false;
            column5.ShowColorName       = false;
            column5.ShowDropDownButton  = false;
            column5.Sortable            = false;
            column6.ShowColorName       = false;
            column6.ShowDropDownButton  = false;
            column6.Sortable            = false;
            column7.ShowColorName       = false;
            column7.ShowDropDownButton  = false;
            column7.Sortable            = false;
            column8.ShowColorName       = false;
            column8.ShowDropDownButton  = false;
            column8.Sortable            = false;
            column9.ShowColorName       = false;
            column9.ShowDropDownButton  = false;
            column9.Sortable            = false;
            column10.ShowColorName      = false;
            column10.ShowDropDownButton = false;
            column10.Sortable           = false;
            column11.ShowColorName      = false;
            column11.ShowDropDownButton = false;
            column11.Sortable           = false;
            column12.ShowColorName      = false;
            column12.ShowDropDownButton = false;
            column12.Sortable           = false;
            column13.ShowColorName      = false;
            column13.ShowDropDownButton = false;
            column13.Sortable           = false;
            column14.ShowColorName      = false;
            column14.ShowDropDownButton = false;
            column14.Sortable           = false;
            this.columnModel.Columns.AddRange(new Column[] { column0, column1, column2, column3, column4, column5, column6, column7, column8, column9, column10, column11, column12, column13, column14, column15, column16 });

            this.table.EndUpdate();
        }
Пример #17
0
 private void InitializeComponent()
 {
     this.groupBox1          = new System.Windows.Forms.GroupBox();
     this.lvwOverTime        = new XPTable.Models.Table();
     this.columnModel1       = new XPTable.Models.ColumnModel();
     this.cSTT               = new XPTable.Models.NumberColumn();
     this.chDepartment       = new XPTable.Models.TextColumn();
     this.chCardID           = new XPTable.Models.TextColumn();
     this.chEmployeeName     = new XPTable.Models.TextColumn();
     this.chStartOverTime    = new XPTable.Models.TextColumn();
     this.chLength           = new XPTable.Models.TextColumn();
     this.chWorkingDay       = new XPTable.Models.TextColumn();
     this.cDinnerAmount      = new XPTable.Models.NumberColumn();
     this.chWorkOverTimeInfo = new XPTable.Models.TextColumn();
     this.tableModel1        = new XPTable.Models.TableModel();
     this.btnDelete          = new System.Windows.Forms.Button();
     this.btnClose           = new System.Windows.Forms.Button();
     this.btnView            = new System.Windows.Forms.Button();
     this.btnUpdate          = new System.Windows.Forms.Button();
     this.btnAdd             = new System.Windows.Forms.Button();
     this.label1             = new System.Windows.Forms.Label();
     this.dtpWorkingDay      = new System.Windows.Forms.DateTimePicker();
     this.lblDepartment      = new System.Windows.Forms.Label();
     this.cboDepartment      = new System.Windows.Forms.ComboBox();
     this.groupBox2          = new System.Windows.Forms.GroupBox();
     this.btnExcel           = new System.Windows.Forms.Button();
     this.groupBox1.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.lvwOverTime)).BeginInit();
     this.groupBox2.SuspendLayout();
     this.SuspendLayout();
     //
     // groupBox1
     //
     this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.groupBox1.Controls.Add(this.lvwOverTime);
     this.groupBox1.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.groupBox1.Location  = new System.Drawing.Point(8, 48);
     this.groupBox1.Name      = "groupBox1";
     this.groupBox1.Size      = new System.Drawing.Size(696, 432);
     this.groupBox1.TabIndex  = 1;
     this.groupBox1.TabStop   = false;
     this.groupBox1.Text      = "Danh sách";
     //
     // lvwOverTime
     //
     this.lvwOverTime.AlternatingRowColor = System.Drawing.Color.FromArgb(((System.Byte)(230)), ((System.Byte)(237)), ((System.Byte)(245)));
     this.lvwOverTime.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                      | System.Windows.Forms.AnchorStyles.Left)
                                                                     | System.Windows.Forms.AnchorStyles.Right)));
     this.lvwOverTime.BackColor                   = System.Drawing.Color.FromArgb(((System.Byte)(237)), ((System.Byte)(242)), ((System.Byte)(249)));
     this.lvwOverTime.ColumnModel                 = this.columnModel1;
     this.lvwOverTime.EnableToolTips              = true;
     this.lvwOverTime.ForeColor                   = System.Drawing.Color.FromArgb(((System.Byte)(14)), ((System.Byte)(66)), ((System.Byte)(121)));
     this.lvwOverTime.FullRowSelect               = true;
     this.lvwOverTime.GridColor                   = System.Drawing.SystemColors.ControlDark;
     this.lvwOverTime.GridLines                   = XPTable.Models.GridLines.Both;
     this.lvwOverTime.GridLineStyle               = XPTable.Models.GridLineStyle.Dot;
     this.lvwOverTime.HeaderFont                  = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold);
     this.lvwOverTime.Location                    = new System.Drawing.Point(8, 16);
     this.lvwOverTime.MultiSelect                 = true;
     this.lvwOverTime.Name                        = "lvwOverTime";
     this.lvwOverTime.NoItemsText                 = WorkingContext.LangManager.GetString("XPtable");
     this.lvwOverTime.SelectionBackColor          = System.Drawing.Color.FromArgb(((System.Byte)(169)), ((System.Byte)(183)), ((System.Byte)(201)));
     this.lvwOverTime.SelectionForeColor          = System.Drawing.Color.FromArgb(((System.Byte)(14)), ((System.Byte)(66)), ((System.Byte)(121)));
     this.lvwOverTime.SelectionStyle              = XPTable.Models.SelectionStyle.Grid;
     this.lvwOverTime.Size                        = new System.Drawing.Size(680, 408);
     this.lvwOverTime.SortedColumnBackColor       = System.Drawing.Color.Transparent;
     this.lvwOverTime.TabIndex                    = 12;
     this.lvwOverTime.TableModel                  = this.tableModel1;
     this.lvwOverTime.UnfocusedSelectionBackColor = System.Drawing.Color.FromArgb(((System.Byte)(201)), ((System.Byte)(210)), ((System.Byte)(221)));
     this.lvwOverTime.UnfocusedSelectionForeColor = System.Drawing.Color.FromArgb(((System.Byte)(14)), ((System.Byte)(66)), ((System.Byte)(121)));
     this.lvwOverTime.SelectionChanged           += new XPTable.Events.SelectionEventHandler(this.lvwOverTime_SelectionChanged);
     this.lvwOverTime.MouseDown                  += new System.Windows.Forms.MouseEventHandler(this.lvwOverTime_MouseDown);
     //
     // columnModel1
     //
     this.columnModel1.Columns.AddRange(new XPTable.Models.Column[] {
         this.cSTT,
         this.chDepartment,
         this.chCardID,
         this.chEmployeeName,
         this.chStartOverTime,
         this.chLength,
         this.chWorkingDay,
         this.cDinnerAmount,
         this.chWorkOverTimeInfo
     });
     //
     // cSTT
     //
     this.cSTT.Editable = false;
     this.cSTT.Maximum  = new System.Decimal(new int[] {
         10000,
         0,
         0,
         0
     });
     this.cSTT.Text  = "STT";
     this.cSTT.Width = 40;
     //
     // chDepartment
     //
     this.chDepartment.Editable = false;
     this.chDepartment.Text     = "Bộ phận";
     this.chDepartment.Width    = 100;
     //
     // chCardID
     //
     this.chCardID.Editable = false;
     this.chCardID.Text     = "Mã thẻ";
     this.chCardID.Width    = 55;
     //
     // chEmployeeName
     //
     this.chEmployeeName.Editable = false;
     this.chEmployeeName.Text     = "Tên nhân viên";
     this.chEmployeeName.Width    = 130;
     //
     // chStartOverTime
     //
     this.chStartOverTime.Editable = false;
     this.chStartOverTime.Text     = "Bắt đầu";
     this.chStartOverTime.Width    = 70;
     //
     // chLength
     //
     this.chLength.Editable = false;
     this.chLength.Text     = "Thời gian";
     this.chLength.Width    = 70;
     //
     // chWorkingDay
     //
     this.chWorkingDay.Editable = false;
     this.chWorkingDay.Text     = "Ngày làm thêm";
     this.chWorkingDay.Width    = 100;
     //
     // cDinnerAmount
     //
     this.cDinnerAmount.Alignment = XPTable.Models.ColumnAlignment.Right;
     this.cDinnerAmount.Editable  = false;
     this.cDinnerAmount.Format    = "#,##0;(#,##0);-";
     this.cDinnerAmount.Maximum   = new System.Decimal(new int[] {
         100000,
         0,
         0,
         0
     });
     this.cDinnerAmount.Text = "Ăn thêm";
     //
     // chWorkOverTimeInfo
     //
     this.chWorkOverTimeInfo.Editable = false;
     this.chWorkOverTimeInfo.Text     = "Thông tin làm thêm";
     this.chWorkOverTimeInfo.Width    = 150;
     //
     // btnDelete
     //
     this.btnDelete.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnDelete.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnDelete.Location  = new System.Drawing.Point(552, 488);
     this.btnDelete.Name      = "btnDelete";
     this.btnDelete.TabIndex  = 5;
     this.btnDelete.Text      = "Xóa";
     this.btnDelete.Click    += new System.EventHandler(this.btnDelete_Click);
     //
     // btnClose
     //
     this.btnClose.Anchor       = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     this.btnClose.FlatStyle    = System.Windows.Forms.FlatStyle.System;
     this.btnClose.Location     = new System.Drawing.Point(632, 488);
     this.btnClose.Name         = "btnClose";
     this.btnClose.TabIndex     = 4;
     this.btnClose.Text         = "Đóng";
     this.btnClose.Click       += new System.EventHandler(this.button4_Click);
     //
     // btnView
     //
     this.btnView.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
     this.btnView.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnView.Location  = new System.Drawing.Point(8, 488);
     this.btnView.Name      = "btnView";
     this.btnView.TabIndex  = 3;
     this.btnView.Text      = "Xem";
     this.btnView.Click    += new System.EventHandler(this.btnView_Click);
     //
     // btnUpdate
     //
     this.btnUpdate.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnUpdate.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnUpdate.Location  = new System.Drawing.Point(472, 488);
     this.btnUpdate.Name      = "btnUpdate";
     this.btnUpdate.TabIndex  = 2;
     this.btnUpdate.Text      = "Sửa";
     this.btnUpdate.Click    += new System.EventHandler(this.btnUpdate_Click);
     //
     // btnAdd
     //
     this.btnAdd.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnAdd.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnAdd.Location  = new System.Drawing.Point(392, 488);
     this.btnAdd.Name      = "btnAdd";
     this.btnAdd.TabIndex  = 1;
     this.btnAdd.Text      = "Thêm ";
     this.btnAdd.Click    += new System.EventHandler(this.btnAdd_Click);
     //
     // label1
     //
     this.label1.Location  = new System.Drawing.Point(8, 16);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(88, 24);
     this.label1.TabIndex  = 2;
     this.label1.Text      = "Ngày làm thêm";
     this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // dtpWorkingDay
     //
     this.dtpWorkingDay.CustomFormat = "dd/MM/yyyy    ";
     this.dtpWorkingDay.Format       = System.Windows.Forms.DateTimePickerFormat.Custom;
     this.dtpWorkingDay.Location     = new System.Drawing.Point(96, 16);
     this.dtpWorkingDay.Name         = "dtpWorkingDay";
     this.dtpWorkingDay.Size         = new System.Drawing.Size(88, 20);
     this.dtpWorkingDay.TabIndex     = 3;
     //
     // lblDepartment
     //
     this.lblDepartment.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.lblDepartment.Location  = new System.Drawing.Point(400, 16);
     this.lblDepartment.Name      = "lblDepartment";
     this.lblDepartment.Size      = new System.Drawing.Size(64, 23);
     this.lblDepartment.TabIndex  = 6;
     this.lblDepartment.Text      = "Bộ phận";
     this.lblDepartment.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
     //
     // cboDepartment
     //
     this.cboDepartment.Anchor        = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.cboDepartment.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
     this.cboDepartment.Location      = new System.Drawing.Point(464, 16);
     this.cboDepartment.Name          = "cboDepartment";
     this.cboDepartment.Size          = new System.Drawing.Size(224, 21);
     this.cboDepartment.TabIndex      = 7;
     //
     // groupBox2
     //
     this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                   | System.Windows.Forms.AnchorStyles.Right)));
     this.groupBox2.Controls.Add(this.label1);
     this.groupBox2.Controls.Add(this.dtpWorkingDay);
     this.groupBox2.Controls.Add(this.lblDepartment);
     this.groupBox2.Controls.Add(this.cboDepartment);
     this.groupBox2.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.groupBox2.Location  = new System.Drawing.Point(8, 0);
     this.groupBox2.Name      = "groupBox2";
     this.groupBox2.Size      = new System.Drawing.Size(696, 48);
     this.groupBox2.TabIndex  = 8;
     this.groupBox2.TabStop   = false;
     //
     // btnExcel
     //
     this.btnExcel.Anchor    = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.btnExcel.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.btnExcel.Location  = new System.Drawing.Point(264, 488);
     this.btnExcel.Name      = "btnExcel";
     this.btnExcel.Size      = new System.Drawing.Size(120, 23);
     this.btnExcel.TabIndex  = 9;
     this.btnExcel.Text      = "Xuất Excel";
     this.btnExcel.Click    += new System.EventHandler(this.ExportExcel_Click);
     //
     // frmListRegOverTime
     //
     this.AcceptButton      = this.btnView;
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.CancelButton      = this.btnClose;
     this.ClientSize        = new System.Drawing.Size(712, 518);
     this.Controls.Add(this.groupBox2);
     this.Controls.Add(this.groupBox1);
     this.Controls.Add(this.btnAdd);
     this.Controls.Add(this.btnUpdate);
     this.Controls.Add(this.btnView);
     this.Controls.Add(this.btnExcel);
     this.Controls.Add(this.btnDelete);
     this.Controls.Add(this.btnClose);
     this.Name        = "frmListRegOverTime";
     this.Text        = "Danh sách nhân viên làm thêm giờ";
     this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
     this.Load       += new System.EventHandler(this.frmListRegOverTime_Load);
     this.groupBox1.ResumeLayout(false);
     ((System.ComponentModel.ISupportInitialize)(this.lvwOverTime)).EndInit();
     this.groupBox2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Пример #18
0
        private void InitModel()
        {
            if (this.ItemType != null)
            {
                Model          item       = new Model();
                PropertyInfo[] infoArray2 = this.ItemType.GetProperties();
                GridFilters    filters    = new GridFilters();
                filters.MenuFilterText = "搜索";
                filters.ID             = "filters" + ID;
                for (int i = 0; i < infoArray2.Length; i++)
                {
                    Func <ColumnBase, bool> predicate = null;
                    PropertyInfo            property  = infoArray2[i];
                    ModelField field = new ModelField
                    {
                        Name = property.Name
                    };
                    #region  射字段类型
                    string fullName = property.PropertyType.FullName;
                    if (fullName.Contains("System.Int"))
                    {
                        var enumDataTypeAttr = AttributeHelper.GetAttribute <EnumDataTypeAttribute>(property);
                        if (enumDataTypeAttr == null)
                        {
                            field.Type = ModelFieldType.Int;
                        }
                    }
                    else if (fullName.Contains("System.DateTime"))
                    {
                        field.Type = ModelFieldType.Date;
                    }
                    else if (fullName.Contains("System.Single"))
                    {
                        field.Type = ModelFieldType.Float;
                    }
                    else if (fullName.Contains("System.Boolean"))
                    {
                        field.Type = ModelFieldType.Boolean;
                    }
                    else if (fullName.Contains("System.String"))
                    {
                        field.Type = ModelFieldType.String;
                    }
                    else if (!property.PropertyType.IsPrimitive)
                    {
                        field.Type = ModelFieldType.Object;
                    }
                    else
                    {
                        field.Type = ModelFieldType.Auto;
                    }
                    #endregion
                    item.Fields.Add(field);

                    if (predicate == null)
                    {
                        predicate = x => x.DataIndex == property.Name;
                    }
                    ColumnBase column = this.ColumnModel.Columns.FirstOrDefault <ColumnBase>(predicate);
                    if (column == null)
                    {
                        ColumnBase base2;
                        DataGridColumnAttribute displayAttr = AttributeHelper.GetAttribute <DataGridColumnAttribute>(property);
                        FilterAttribute         filterAttr  = AttributeHelper.GetAttribute <FilterAttribute>(property);
                        bool       simpleFilterable         = filterAttr != null && filterAttr.Enabled && filterAttr.FilterType == null;
                        GridFilter filter = null;
                        #region  射列类型
                        if (fullName.Contains("System.Int") ||
                            fullName.Contains("System.Single") ||
                            fullName.Contains("System.Decimal") ||
                            fullName.Contains("System.Double"))
                        {
                            NumberColumn column1 = new NumberColumn
                            {
                                Format = this.GetFormat(displayAttr, "0")
                            };
                            base2 = column1;
                            if (simpleFilterable && filterAttr.FilterType == null)
                            {
                                filter = new NumericFilter();
                            }
                        }
                        else if (fullName.Contains("System.DateTime"))
                        {
                            DateColumn column2 = new DateColumn
                            {
                                Format = this.GetFormat(displayAttr, "Y-m-d")
                            };
                            base2 = column2;
                            if (simpleFilterable)
                            {
                                filter = new DateFilter()
                                {
                                    AfterText  = "在这之后",
                                    BeforeText = "在这之前",
                                    OnText     = "在这天"
                                };
                            }
                        }
                        else if (fullName.Contains("System.Boolean"))
                        {
                            string[]      strArray = this.GetFormat(displayAttr, "是|否").Split(new char[] { '|' });
                            BooleanColumn column4  = new BooleanColumn
                            {
                                TrueText  = strArray[0],
                                FalseText = strArray[1]
                            };
                            base2 = column4;
                            if (simpleFilterable)
                            {
                                filter = new BooleanFilter()
                                {
                                    NoText  = strArray[1],
                                    YesText = strArray[0]
                                };
                            }
                        }
                        else if (fullName.Contains("System.String"))
                        {
                            base2 = new Column();
                            if (simpleFilterable)
                            {
                                filter = new StringFilter();
                            }
                        }
                        else if (!property.PropertyType.IsPrimitive)
                        {
                            base2 = new Column();
                            if (simpleFilterable)
                            {
                                filter = new StringFilter();
                            }
                        }
                        else
                        {
                            base2 = new Column();
                            if (simpleFilterable)
                            {
                                filter = new StringFilter();
                            }
                        }
                        #endregion
                        #region 生成外键过滤器
                        if (filterAttr != null && filterAttr.Enabled && filterAttr.FilterType != null)
                        {
                            Store store = new Store();
                            store.ID = "filterStore" + property.Name;
                            if (filterAttr.FilterType.IsEnum)
                            {
                                var valueType = filterAttr.FilterType;
                                var values    = Enum.GetValues(valueType);
                                var names     = Enum.GetNames(valueType);
                                List <KeyValueModel> enumDict = new List <KeyValueModel>();
                                for (int it = 0; it < values.Length; it++)
                                {
                                    var fieldInfo = valueType.GetField(names[it]);
                                    var descAttr  = AttributeHelper.GetAttribute <DescriptionAttribute>(fieldInfo);
                                    if (descAttr == null)
                                    {
                                        throw new Exception("枚举必须要有Description");
                                    }
                                    int key = (int)values.GetValue(it);
                                    enumDict.Add(new KeyValueModel()
                                    {
                                        Id   = key,
                                        Name = descAttr.Description
                                    });
                                }
                                Model model = new Model();
                                model.Fields.Add(new ModelField("Id", ModelFieldType.Int));
                                model.Fields.Add(new ModelField("Name", ModelFieldType.String));
                                store.Model.Add(model);
                                store.DataSource = enumDict;
                                store.DataBind();
                                filter = new ListFilter()
                                {
                                    StoreID    = store.ID,
                                    Single     = true,
                                    IDField    = "Id",
                                    LabelField = "Name"
                                };
                            }
                            else
                            {
                                var filterObject = Activator.CreateInstance(filterAttr.FilterType);
                                var filterGen    = filterObject as ForeignFilterBase;
                                if (filterGen == null)
                                {
                                    throw new ArgumentException("FilterAttribute中的FilterType的类型必须为ForeignFilterBase的子类或枚举类型");
                                }
                                store.Model.Add(filterGen.GetModel());
                                store.DataSource = filterGen.GetData();
                                store.DataBind();
                                filter = new ListFilter()
                                {
                                    StoreID    = store.ID,
                                    Single     = true,
                                    IDField    = filterGen.IdField,
                                    LabelField = filterGen.LabelField
                                };
                            }
                            Bin.Add(store);
                        }
                        #endregion
                        base2.Text      = (displayAttr == null) ? property.Name : displayAttr.DisplayName;
                        base2.DataIndex = property.Name;
                        if (displayAttr != null && displayAttr.Width != -1)
                        {
                            base2.Width = displayAttr.Width;
                        }
                        if (displayAttr != null && displayAttr.ValueType != null)
                        {
                            Type valueType = displayAttr.ValueType;
                            var  values    = Enum.GetValues(valueType);
                            var  names     = Enum.GetNames(valueType);
                            Dictionary <int, string> enumDict  = new Dictionary <int, string>();
                            List <string>            valueList = new List <string>();
                            for (int it = 0; it < values.Length; it++)
                            {
                                var fieldInfo = valueType.GetField(names[it]);
                                var descAttr  = AttributeHelper.GetAttribute <DescriptionAttribute>(fieldInfo);
                                int key       = (int)values.GetValue(it);
                                enumDict.Add(key, descAttr.Description);
                                valueList.Add("values[" + key + "]=\"" + (descAttr != null ? descAttr.Description : names[it]) + "\";");
                            }

                            base2.Renderer.Fn = "function(){var values=Array();" + string.Join(string.Empty, valueList) + "return values[arguments[0]];}";
                        }
                        if (filter != null)
                        {
                            filter.DataIndex = property.Name;
                            filters.Filters.Add(filter);
                        }
                        column = base2;
                        this.ColumnModel.Columns.Add(base2);
                    }
                    column.TabIndex = (short)i;
                }
                Features.Add(filters);
                if (this.ColumnModel.Columns.Count >= 10)
                {
                    this.AutoScroll = true;
                }
                var list = ColumnModel.Columns.OrderBy(x => x.TabIndex).ToList();
                ColumnModel.Columns.Clear();
                ColumnModel.Columns.AddRange(list);
                this._store.Model.Add(item);
            }
        }
Пример #19
0
        public void BuildGrid()
        {
            Ext.Net.GridView gridView;
            if (String.IsNullOrEmpty(this.columnExpand))
            {
                gridView = new Ext.Net.GridView();
            }
            else
            {
                gridView = new Ext.Net.GridView
                {
                    Configs = { ForceFit = true }
                };
            }

            if (ReadOnly == true)
            {
                foreach (LookupFormatData fmtData in this.dataTemplate)
                {
                    fmtData.ReadOnly = ReadOnly;
                }
            }

            foreach (LookupFormatData fmtData in this.dataTemplate)
            {
                fmtData.ID = fmtData.ID != "" ? fmtData.ID : fmtData.FieldName;
                if (fmtData.EditControl != null)
                {
                    Column colCbo = new Column
                    {
                        ID        = String.Format("{0}ColID", fmtData.ID),
                        DataIndex = fmtData.FieldName,
                        Text      = fmtData.FieldTitle,
                        Width     = fmtData.ColWidth,
                        Hidden    = fmtData.ColWidth == 0
                    };
                    if (String.Equals(fmtData.FieldName, this.columnExpand))
                    {
                        colCbo.Flex = 1;
                    }
                    //Makeup for option string
                    if (fmtData.IsRenderer)
                    {
                        string           funcRenderer = fmtData.FnRenderer;
                        Ext.Net.Renderer rd           = new Renderer {
                            Fn = SCOPE + "." + funcRenderer
                        };
                        colCbo.Renderer = rd;
                    }

                    if (!fmtData.ReadOnly)
                    {
                        colCbo.Editor.Add(fmtData.EditControl);
                    }
                    this.ColumnModel.Columns.Add(colCbo);
                }
                else if (fmtData.EditControl == null)
                {
                    switch (fmtData.Type)
                    {
                    case ModelFieldType.String:
                        #region String
                        Column colText = new Column
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Align     = Alignment.Left
                        };
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colText.Flex = 1;
                        }
                        if (fmtData.IsRenderer)
                        {
                            string           funcRenderer = fmtData.FnRenderer;
                            Ext.Net.Renderer rd           = new Renderer {
                                Fn = SCOPE + "." + funcRenderer
                            };
                            colText.Renderer = rd;
                        }
                        if (!fmtData.ReadOnly == true)
                        {
                            TextField textEditor = new TextField
                            {
                                SelectOnFocus = true,
                                //AllowBlank = false,
                                //BlankText = "Not blank",
                                MsgTarget = MessageTarget.Side
                            };

                            if (fmtData.MaxLength > 0)
                            {
                                textEditor.MaxLength     = fmtData.MaxLength;
                                textEditor.MaxLengthText = String.Format("Chiều dài tối đa là {0} kí tự", textEditor.MaxLength);
                            }
                            if (fmtData.AllowBlank == false)
                            {
                                textEditor.AllowBlank = false;
                                textEditor.BlankText  = String.Format("Trường bắt buộc nhập giá trị");
                            }

                            colText.Editor.Add(textEditor);
                        }

                        this.ColumnModel.Columns.Add(colText);
                        #endregion
                        break;

                    case ModelFieldType.Boolean:
                        #region Boolean
                        CheckColumn colBool = new CheckColumn
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Editable  = false,
                            Align     = Alignment.Center
                        };
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colBool.Flex = 1;
                        }
                        if (!fmtData.ReadOnly == true)
                        {
                            colBool.Editable = true;
                            //TextField cbEditor = new TextField { SelectOnFocus = true };
                            //Ext.Net.Checkbox cbEditor = new Checkbox { Cls = "x-grid-checkheader-editor" };
                            //colBool.Editor.Add(cbEditor);
                        }
                        this.ColumnModel.Columns.Add(colBool);
                        #endregion
                        break;

                    case ModelFieldType.Date:
                        #region Date
                        DateColumn colDate = new DateColumn
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Format    = "dd/MM/yyyy",
                            Align     = Alignment.Center
                        };
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colDate.Flex = 1;
                        }
                        if (!fmtData.ReadOnly == true)
                        {
                            DateField dateEditor = new DateField
                            {
                                ID            = String.Format("{0}_{1}_dateEditor", this.ClientID, fmtData.FieldName),
                                Format        = "dd/MM/yyyy",
                                Vtype         = "daterange",
                                SelectOnFocus = true
                            };
                            colDate.Editor.Add(dateEditor);
                        }
                        //                            colDate.Renderer.Handler = @"if(value == 'Mon Jan 01 1 07:00:00 GMT+0700 (SE Asia Standard Time)')
                        //                                           {return null;}
                        //                                           else{return Ext.Date.format(value, 'd/m/Y');}";
                        this.ColumnModel.Columns.Add(colDate);
                        #endregion
                        break;

                    case ModelFieldType.Float:
                        #region Float
                        NumberColumn colFloat = new NumberColumn
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Format    = "0.00/i",
                            Align     = Alignment.Right,
                        };
                        if (!String.IsNullOrEmpty(fmtData.Format))
                        {
                            colFloat.Format = fmtData.Format;
                        }
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colFloat.Flex = 1;
                        }
                        if (!fmtData.ReadOnly == true)
                        {
                            //phongdd-100
                            //TextField textEdit = new TextField { StyleSpec = "text-align:right;vertical-align:bottom", SelectOnFocus = true };
                            NumberField FloatEditInt = new NumberField
                            {
                                StyleSpec        = "text-align:right;vertical-align:bottom",
                                SelectOnFocus    = true,
                                MinValue         = 0,
                                AllowDecimals    = true,
                                DecimalPrecision = 3
                            };
                            //end phongdd-100
                            colFloat.Editor.Add(FloatEditInt);
                        }
                        this.ColumnModel.Columns.Add(colFloat);
                        #endregion
                        break;

                    case ModelFieldType.Int:
                        #region Number
                        NumberColumn colNumber = new NumberColumn
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Align     = Alignment.Right,
                        };
                        if (!String.IsNullOrEmpty(fmtData.Format))
                        {
                            colNumber.Format = fmtData.Format;
                        }
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colNumber.Flex = 1;
                        }
                        //Bat buoc go dau phay
                        if (!fmtData.ReadOnly == true)
                        {
                            //phongdd-100
                            //TextField textEditInt = new TextField { StyleSpec = "text-align:right;vertical-align:bottom", SelectOnFocus = true };
                            NumberField textEditInt = new NumberField {
                                StyleSpec = "text-align:right;vertical-align:bottom", SelectOnFocus = true, MinValue = 0, AllowDecimals = true
                            };
                            //end phongdd-100
                            colNumber.Editor.Add(textEditInt);
                        }
                        this.ColumnModel.Columns.Add(colNumber);
                        #endregion
                        break;

                    default:
                        #region auto
                        Column colAuto = new Column
                        {
                            ID        = String.Format("{0}ColID", fmtData.ID),
                            DataIndex = fmtData.FieldName,
                            Text      = fmtData.FieldTitle,
                            Width     = fmtData.ColWidth,
                            Hidden    = fmtData.ColWidth == 0,
                            Align     = Alignment.Left
                        };
                        if (String.Equals(fmtData.FieldName, this.columnExpand))
                        {
                            colAuto.Flex = 1;
                        }
                        if (fmtData.ReadOnly == true)
                        {
                            TextField textEditAuto = new TextField {
                                StyleSpec = "text-align:right;vertical-align:bottom", SelectOnFocus = true
                            };
                            colAuto.Editor.Add(textEditAuto);
                        }
                        this.ColumnModel.Columns.Add(colAuto);
                        #endregion
                        break;
                    }
                }
            }
            this.toolTip = new ToolTip
            {
                Delegate   = ".x-grid3-cell",
                TrackMouse = true,
            };
            this.Plugins.Add(new CellEditing {
                ClicksToEdit = 1
            });
            this.ToolTips.Add(toolTip);
            this.SelectionModel.Add(new CellSelectionModel {
            });
            this.View.Add(gridView);
        }
Пример #20
0
        private void LoadTable()
        {
            // get the sample images resource
            System.Reflection.Assembly myAssembly;
            myAssembly = this.GetType().Assembly;
            //ResourceManager myManager = new ResourceManager("MediaPlayerStyle.Images", myAssembly);

            this.table.BeginUpdate();



            TextColumn CustomerIDColumn = new TextColumn();

            CustomerIDColumn.Text        = "Product ID";
            CustomerIDColumn.ToolTipText = "";
            CustomerIDColumn.Width       = 85;
            CustomerIDColumn.Editable    = false;

            TextColumn NameColumn = new TextColumn();

            NameColumn.Text        = "Description";
            NameColumn.ToolTipText = "";
            NameColumn.Width       = 220;
            NameColumn.Editable    = false;


            NumberColumn dateColumn = new NumberColumn();

            dateColumn.Text        = "Assigned";
            dateColumn.ToolTipText = "";
            dateColumn.Width       = 80;
            dateColumn.Editable    = false;
            dateColumn.Alignment   = ColumnAlignment.Right;
            dateColumn.Format      = "###.##";


            TextColumn dateColumn1 = new TextColumn();

            dateColumn1.Text        = "Available";
            dateColumn1.ToolTipText = "";
            dateColumn1.Width       = 80;
            dateColumn1.Editable    = false;



            TextColumn UserIDColumn = new TextColumn();

            UserIDColumn.Text        = "Total";
            UserIDColumn.ToolTipText = "";
            UserIDColumn.Width       = 80;
            UserIDColumn.Editable    = false;
            //UserIDColumn.Editor = GetActiveUsers();

            /*
             * CheckBoxColumn protectedColumn = new CheckBoxColumn();
             * protectedColumn.Alignment = XPTable.Models.ColumnAlignment.Center;
             * protectedColumn.DrawText = false;
             * protectedColumn.Text = "Completed";
             * protectedColumn.ToolTipText = "Completed Call";
             * protectedColumn.Width = 80;
             * protectedColumn.Editable = false;
             */
            this.table.ColumnModel = new ColumnModel(new Column[] { CustomerIDColumn,
                                                                    NameColumn,
                                                                    dateColumn,
                                                                    dateColumn1,
                                                                    UserIDColumn });



            this.table.HeaderRenderer = new XPTable.Renderers.GradientHeaderRenderer();

            this.table.FullRowSelect = true;

            this.table.EndUpdate();
        }
Пример #21
0
        public virtual ColumnBase CreateColumn()
        {
            ColumnBase column;

            if (HasChildren)
            {
                column = new Column {
                    Text = Header
                };

                if (ConfigureColumnHandler != null)
                {
                    ConfigureColumnHandler(column);
                }

                return(column);
            }

            var editor = CreateEditor();

            if (CreateColumnHandler != null)
            {
                column = CreateColumnHandler(this);
                if (editor != null)
                {
                    column.Editor.Add(editor);
                }

                if (ConfigureColumnHandler != null)
                {
                    ConfigureColumnHandler(column);
                }

                return(column);
            }

            if (IsTreeColumn)
            {
                column = new TreeColumn
                {
                    DataIndex = ColumnNameIndex,
                    Text      = Header,
                    Width     = new Unit(Width),
                    Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                    Sortable  = !string.IsNullOrEmpty(Sort),
                };
            }
            else
            {
                switch (ModelFieldType)
                {
                case ModelFieldType.Auto:
                    column = new Column
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Width     = new Unit(Width),
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    break;

                case ModelFieldType.String:
                    column = new Column
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Width     = new Unit(Width),
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Wrap      = Wrap ?? true,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    break;

                case ModelFieldType.Int:
                    var intColumn = new NumberColumn
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Width     = new Unit(Width),
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    if (!string.IsNullOrEmpty(Format))
                    {
                        intColumn.Format = GetIntFormat();
                    }
                    intColumn.Align = Alignment.Right;
                    //intColumn.Renderer.Handler = "debugger;return record.raw[metadata.column.dataIndex] == null && !value ? '' : value;";
                    column = intColumn;
                    break;

                case ModelFieldType.Float:
                    var floatColumn = new NumberColumn
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    if (!string.IsNullOrEmpty(Format))
                    {
                        floatColumn.Format = GetFloatFormat();
                    }
                    floatColumn.Align = Alignment.Right;
                    //floatColumn.Renderer.Handler = "debugger;return record.raw[metadata.column.dataIndex] == null && !value ? '' : value;";
                    column = floatColumn;
                    break;

                case ModelFieldType.Boolean:
                    if (EditModeForBool && CanEdit)
                    {
                        column = new CheckColumn
                        {
                            DataIndex     = ColumnNameIndex,
                            Text          = Header,
                            StopSelection = false,
                            Editable      = CanEdit,
                            Width         = new Unit(Width),
                            Flex          = string.IsNullOrEmpty(Width) ? Flex : 0,
                            Hidden        = DefaultHidden,
                            Sortable      = !string.IsNullOrEmpty(Sort),
                        };

                        if (column.Renderer == null)
                        {
                            column.Renderer = new Renderer();
                        }
                        column.Renderer.Handler = string.Format(
                            "if (!record.data.CanEdit) return '<span style=\"font-size:11px\">' + (record.data.{0} ? {1} : {2}) + '</span>'; return (new Ext.ux.CheckColumn()).renderer(record.data.{0});",
                            ColumnNameIndex,
                            JSON.Serialize(TrueText),
                            JSON.Serialize(FalseText));
                    }
                    else
                    {
                        column = new BooleanColumn
                        {
                            DataIndex = ColumnNameIndex,
                            Text      = Header,
                            TrueText  = TrueText,
                            FalseText = FalseText,
                            Width     = new Unit(Width),
                            Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                            Hidden    = DefaultHidden,
                            Sortable  = !string.IsNullOrEmpty(Sort),
                        };
                    }

                    break;

                case ModelFieldType.Date:
                    column = new DateColumn
                    {
                        DataIndex = ColumnNameIndex,
                        Text      = Header,
                        Format    = GetDateFormat(),
                        Width     = new Unit(Width),
                        Flex      = string.IsNullOrEmpty(Width) ? Flex : 0,
                        Hidden    = DefaultHidden,
                        Sortable  = !string.IsNullOrEmpty(Sort),
                    };
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }

                if (SummaryType != null)
                {
                    column.SummaryType     = SummaryType.Value;
                    column.SummaryRenderer = new Renderer {
                        Handler = SummaryRendererHandler
                    };
                    column.CustomSummaryType = CustomSummaryType;
                }
            }

            if (editor != null)
            {
                column.Editor.Add(editor);
            }

            if (!string.IsNullOrEmpty(RendererFunction))
            {
                var handler = RendererFunction.Contains(" ") ?
                              $"function (value, metadata, record, rowIndex, colIndex, store, view) {{\n{RendererFunction}\n}}"
                    : RendererFunction;
                column.Renderer = new Renderer {
                    Handler = handler,
                };
            }

            if (Locked)
            {
                column.Locked = true;
            }

            ConfigureColumnHandler?.Invoke(column);

            return(column);
        }