我有以下表格,它给了我无法将类型 void 隐式转换为 HomeInventory2.Domain.CreateInventory 的错误...
我的表格
namespace HomeInventory2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void submitButton_Click(object sender, EventArgs e)
{
CreateInventory create = new CreateInventory();
create.ItemAmount = textBoxAmount.Text;
create.ItemCategory = textBoxCategories.Text;
create.ItemProperties = textBoxValue.Text;
create.ItemValue = textBoxValue.Text;
InventoryMngr invtryMngr = new InventoryMngr();
CreateInventory creating = invtryMngr.Create(create);
}
}
}
以及它引用的 createinventory 文件
namespace HomeInventory2.Domain
{
[Serializable]
public class CreateInventory
{
private string itemCategory;
public String ItemCategory
{
set { itemCategory = value; }
get { return itemCategory; }
}
private string itemProperties;
public String ItemProperties
{
set { itemProperties = value; }
get { return itemProperties; }
}
private string itemAmount;
public String ItemAmount
{
set { itemAmount = value; }
get { return itemAmount; }
}
private string itemValue;
public String ItemValue
{
set { itemValue = value; }
get { return itemValue; }
}
}
}