namespace FitoStore
{
public partial class FitoStore : Form
{
private Dyqan dyqan = new Dyqan();
public FitoStore()
{
InitializeComponent();
SetupData();
}
private void SetupData()
{
dyqan.Shitesit.Add(new Shites { Emeri = "Kujtim", Mbiemeri = "Arishta" });
dyqan.Shitesit.Add(new Shites { Emeri = "Zaim", Mbiemeri = "Sherbela" });
dyqan.Produkte.Add(new Produkt {Lloji = "Dap",Kilogram ="25",Cmimi="2.500"});
dyqan.Produkte.Add(new Produkt {Lloji = "Nitrat",Kilogram="50",Cmimi="2.500"});
}
}
}
答案 0 :(得分:0)
尝试
dyqan.Shitesit.Add(new Shites { Emeri = "Kujtim", Mbiemeri = "Arishta" });
dyqan.Shitesit.Add(new Shites { Emeri = "Zaim", Mbiemeri = "Sherbela" });
dyqan.Produkte.Add(new Produkt {Lloji = "Dap",Kilogram =25M,Cmimi=2.500M});
dyqan.Produkte.Add(new Produkt {Lloji = "Nitrat",Kilogram=50M,Cmimi=2.500M});
其中25M means小数值为25。
我也把它做到Cmimi
,因为它看起来应该是小数。您可能需要根据其中的类型进行更改。