123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using Tofly.Core.Stereotype;
- using Tofly.CoreUI.Win.Form.Forms;
- namespace Tofly.SearchUI.Win
- {
-
-
-
- [Component(IsSingleton = "false", Name = "FormSelectRow")]
- public partial class FormSelectRow : FormClass, ISelectRowForm
- {
- public FormSelectRow()
- {
- InitializeComponent();
- this.Load += FormSelectRow_Load;
- }
- #region ISelectRowForm 接口
- public int PageSize
- {
- get;set;
- }
- public int RowCount
- {
- get;set;
- }
- public int SelectPageIndex
- {
- get;set;
- }
- #endregion
- private void FormSelectRow_Load(object sender, EventArgs e)
- {
- comboBoxRows.DropDownStyle = ComboBoxStyle.DropDownList;
- if (RowCount == 0 || PageSize == 0) return;
- int _pageCount = RowCount/PageSize + 1;
- for (int i = 0; i < _pageCount; i++)
- {
- string _showText = string.Format("{0}-{1}", i*PageSize, (i + 1)*PageSize);
- comboBoxRows.Items.Add(_showText);
- }
- }
- private void buttonOK_Click(object sender, EventArgs e)
- {
- if (comboBoxRows.SelectedIndex < 0) return;
- SelectPageIndex = comboBoxRows.SelectedIndex;
- DialogResult = CoreUI.Control.DialogResult.OK;
- this.Close();
- }
- private void buttonCancel_Click(object sender, EventArgs e)
- {
- DialogResult = CoreUI.Control.DialogResult.Cancel;
- this.Close();
- }
- }
- }
|