English 中文(简体)
重新设计现有的全球倡议,同时保持大部分功能[封闭]
原标题:Re-purposing an existing GUI, while keeping most of the same functionality [closed]

我正在开发一个用户管理系统,在该系统中,我要重新使用Edit用户表格中的全球数据系统,该表刚刚改变一些功能。

For example, in my Add Users, the User ID is set to the next available ID, and the Username, password, confirm password, and group are left blank. There is an Add User button that performs validation on the above mentioned fields, and the title of the form is "Add User"

对Edit用户来说,所有需要改变的办法是填写正在编辑的用户的数据(从我的数据GridView中找到数据R并不是一个问题),并将“Edit用户”纽顿改为“Edit用户”,同时进行同样的验证,并将表格的标题改为“Edit用户”。

这样做是否可行? 如果说这种使用是什么,那么我可以更有效地看待吗?

最佳回答

这绝对是可能的,它已经做了所有的时间。 当你以你的形式来补充时,你通常会这样做:

using (AddUserForm form = new AddUserForm())
{
  form.ShowDialog();
}

如果您想把用户:为一片:

using (AddUserForm form = new AddUserForm(user))
{
  form.ShowDialog();
}

通知说,你有两座建筑商。 在“AddUserForm”的法典中(你应真正称“ModificationUserForm”或“用户Form”),如果用户无效,则你可做“Add”(),如果“更新”不作废。

例构者:

public AddUserForm()
{
  this._user = new User();
}

public AddUserForm(User user)
{
  this._user = user;
}

然后节省:

private void SaveUser()
{
  if (this._userId == 0)
  {
    MyDal.AddUser(this._user);
    return;
  }

  MyDal.UpdateUser(this._user);
}

我是在没有“视力”演播室的情况下这样做的,因此,我没有承诺汇编:

问题回答

暂无回答




相关问题
Bring window to foreground after Mutex fails

I was wondering if someone can tell me what would be the best way to bring my application to the foreground if a mutex was not able to be created for a new instance. E.g.: Application X is running ...

How to start WinForm app minimized to tray?

I ve successfully created an app that minimizes to the tray using a NotifyIcon. When the form is manually closed it is successfully hidden from the desktop, taskbar, and alt-tab. The problem occurs ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

Handle DataTable.DataRow cell change event

I have a DataTable that has several DataColumns and DataRow. Now i would like to handle an event when cell of this DataRow is changed. How to do this in c#?

Apparent Memory Leak in DataGridView

How do you force a DataGridView to release its reference to a bound DataSet? We have a rather large dataset being displayed in a DataGridView and noticed that resources were not being freed after the ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

WPF-XAML window in Winforms Application

I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application. Could you explain me how this is done.

热门标签