ورود

View Full Version : سوال: مشکل این کد کجاست؟



soniarose
شنبه 13 شهریور 1389, 18:30 عصر
سلام من میخوام برای ایجاد سبد خرید کلاس cartItemو shopingcart رو در کلاس shoping قرار بدم و نام فضا رو wrox.comerce قرار بدم ولی در قسمت تعیین نام فضا خطا میگیره لطفا کمک کنید


publicclassshoping
{
public shoping()
{namespace Wrox.Commerce
{
[Serializable]
publicclassCartItem
{
privateint _productID;
privatestring _productName;
privatestring _productImageUrl;
privateint _quantity;
privatedouble _price;
privatedouble _lineTotal;
publicvoid New()
{
}
publicvoid New(int ProductID, string ProductName,
string ProductImageUrl, int Quantity, double Price)
{
_productID = ProductID;
_productName = ProductName;
_productImageUrl = ProductImageUrl;
_quantity = Quantity;
_price = Price;
_lineTotal = Quantity * Price;
}
publicint ProductID
{
get
{
return _productID;
}
set
{
_productID = value;
}
}
publicstring ProductName
{
get
{
return _productName;
}
set
{
_productName = value;
}
}
publicstring ProductImageUrl
{
get
{
return _productImageUrl;
}
set
{
_productImageUrl = value;
}
}
publicint Quantity
{
get
{
return _quantity;
}
set
{
_quantity = value;
}
}
publicdouble Price
{
get
{
return _price;
}
set
{
_price = value;
}
}
publicdouble LineTotal
{
get
{
return _quantity * _price;
}
}
}
}
//
// TODO: Add constructor logic here
//
}
}

raziee
شنبه 13 شهریور 1389, 19:32 عصر
publicclassshoping
{
public shoping()
{namespace Wrox.Commerce
{

namespace باید قبل از تعیین کلاس قرار بگیره.

namespace Wrox.Commerce
{
publicclassshoping
{
public shoping()
{
[Serializable]
publicclassCartItem
{
privateint _productID;
privatestring _productName;
privatestring _productImageUrl;
privateint _quantity;
privatedouble _price;
privatedouble _lineTotal;
publicvoid New()
{
}
publicvoid New(int ProductID, string ProductName,
string ProductImageUrl, int Quantity, double Price)
{
_productID = ProductID;
_productName = ProductName;
_productImageUrl = ProductImageUrl;
_quantity = Quantity;
_price = Price;
_lineTotal = Quantity * Price;
}
publicint ProductID
{
get
{
return _productID;
}
set
{
_productID = value;
}
}
publicstring ProductName
{
get
{
return _productName;
}
set
{
_productName = value;
}
}
publicstring ProductImageUrl
{
get
{
return _productImageUrl;
}
set
{
_productImageUrl = value;
}
}
publicint Quantity
{
get
{
return _quantity;
}
set
{
_quantity = value;
}
}
publicdouble Price
{
get
{
return _price;
}
set
{
_price = value;
}
}
publicdouble LineTotal
{
get
{
return _quantity * _price;
}
}
}
}
//
// TODO: Add constructor logic here
//
}
}

soniarose
شنبه 13 شهریور 1389, 23:04 عصر
بازم قسمت [Serializable] خطا میده

salehbagheri
یک شنبه 14 شهریور 1389, 04:28 صبح
بازم قسمت [Serializable] خطا میده

آقا شما که از با تجربه های انجمنی! خطا میده یعنی چی؟

فکر کنم بیش از هزاران بار به این قسم پرسش ها گفته شده که به جای اتلاف وقت کاربران متن خطا، تصویری از خطا و ... رو قرار بدید.

از این پس تمامی تاپیک هایی به این شکل بی درنگ حذف خواهند شد.