代码拉取完成,页面将自动刷新
特别说明:
如果Issue
没有严格按照模板编写且未提供测试源码下载或 Git 测试仓库地址,则视为无效Issue
。
提交Issue
前请先用Gitee最新代码再次进行测试,旧版本的有些问题已经随着更新已经解决无需再提交。
请先给项目点击Star支持本项目!!!
SunnyUI.Net V3.1.3
使用Show方法展示窗体时,窗体中的UITextBox的Text属性无效。换为ShowDialog才有效。
private void sb_add_Click(object sender, System.EventArgs e)
{
FEditNotice editNotice = new FEditNotice();
editNotice.Show();
}
public partial class FEditNotice : UIEditForm
{
Notice notice = new Notice();
bool isEditMode = false;//默认为添加模式
public FEditNotice()
{
InitializeComponent();
}
public FEditNotice(Notice notice)
{
InitializeComponent();
isEditMode = true;
this.notice = notice;
this.txtTitle.Text = notice.title;
this.txtContent.Text = notice.content;
this.btnOK.Text = "修改";
}
protected override bool CheckData()
{
return CheckEmpty(txtTitle, "请输入标题")
&& CheckEmpty(txtContent, "请输入正文");
}
private void FEdit_Load(object sender, System.EventArgs e)
{
}
private void btnOK_Click_1(object sender, System.EventArgs e)
{
if(IsOK)
{
notice.title = this.txtTitle.Text;
notice.content = this.txtContent.Text;
notice.author_id = 1;
notice.time = DateTime.Now;
if (isEditMode)
{
int row = Notice.Update(notice);
ShowSuccessTip("修改成功");
}
else
{
Notice.Insert(notice);
ShowSuccessTip("发布成功");
}
Close();
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
if(isEditMode)
{
ShowSuccessTip("已取消修改");
}
else
{
ShowSuccessTip("已取消发布");
}
}
}
Show也可以像ShowDialog一样