继续完善table

This commit is contained in:
czz_y
2024-08-31 23:29:18 +08:00
parent 3d7611e546
commit 9b0ea239b7
9 changed files with 223 additions and 141 deletions
+8 -1
View File
@@ -13,9 +13,12 @@ namespace AntdUIDemo.Views.Table
{
public partial class UserEdit : UserControl
{
private AntdUI.Window window;
private User user;
public UserEdit(User _user)
public bool submit;
public UserEdit(AntdUI.Window _window, User _user)
{
this.window = _window;
user = _user;
InitializeComponent();
//设置默认值
@@ -32,6 +35,7 @@ namespace AntdUIDemo.Views.Table
private void Button_cancel_Click(object sender, EventArgs e)
{
submit = false;
this.Dispose();
}
@@ -42,10 +46,13 @@ namespace AntdUIDemo.Views.Table
if (String.IsNullOrEmpty(input_name.Text))
{
input_name.Status = AntdUI.TType.Error;
AntdUI.Message.warn(window, "姓名不能为空!", autoClose: 3);
return;
}
user.Name = input_name.Text;
user.Address = input_addr.Text;
user.Age = (int)input_age.Value;
submit = true;
this.Dispose();
}