超级店铺管理功能
This commit is contained in:
1 parent
d3e404ac2a
commit
fe2d2883db
91 files changed
+4295
-587
No files matched your search
@@ -0,0 +1,91 @@
|
||||
using NaiBa.Util.Extension;
|
||||
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;
|
||||
|
||||
namespace TemuKJD.UserControls
|
||||
{
|
||||
public partial class UcSplitPage : UserControl
|
||||
{
|
||||
int totalPage = 1;
|
||||
public int TotalPage
|
||||
{
|
||||
get { return totalPage; }
|
||||
set
|
||||
{
|
||||
if (TotalPage != value && value > 0)
|
||||
{
|
||||
totalPage = value;
|
||||
if (InvokeRequired)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
this.lblTotal.Text = "共" + totalPage + "页";
|
||||
}));
|
||||
}
|
||||
else
|
||||
this.lblTotal.Text = "共" + totalPage + "页";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int currentPage = 1;
|
||||
public int CurrentPage
|
||||
{
|
||||
get { return currentPage; }
|
||||
set
|
||||
{
|
||||
if (currentPage != value)
|
||||
{
|
||||
currentPage = value;
|
||||
if (InvokeRequired)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
this.lblPage.Text = "" + currentPage;
|
||||
}));
|
||||
}
|
||||
else
|
||||
this.lblPage.Text = "" + currentPage;
|
||||
OnPageChange(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public event Action<object> PageChange;
|
||||
protected virtual void OnPageChange(object sender)
|
||||
{
|
||||
this.PageChange?.Invoke(sender);
|
||||
}
|
||||
|
||||
public UcSplitPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void pnlJump_Click(object sender, EventArgs e)
|
||||
{
|
||||
int page = this.txtJumpPage.Text.ParseToInt();
|
||||
this.CurrentPage = Math.Max(1, page);
|
||||
|
||||
}
|
||||
|
||||
private void btnPrev_Click(object sender, EventArgs e)
|
||||
{
|
||||
int page = this.CurrentPage - 1;
|
||||
this.CurrentPage = Math.Max(1, page);
|
||||
}
|
||||
|
||||
private void btnNext_Click(object sender, EventArgs e)
|
||||
{
|
||||
int page = this.CurrentPage + 1;
|
||||
this.CurrentPage = Math.Min(totalPage, page);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user