C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » WCF »

Wcf - property assignment issue


Posted Date: 06 Jul 2009      Posted By: pratik mehta      Member Level: Bronze     Points: 1   Responses: 0



public int Add(BWS.DB.DAL.ProductMaster product, string strColorSizeIds)
{
try
{

ProductDataDataContext objDataContext = new ProductDataDataContext();
if (strColorSizeIds.Length > 0)
{
string[] strArrayColorSize = strColorSizeIds.Split('_');
for (int i = 0; i < strArrayColorSize.Length; i++)
{
product.ChildProducts.Add(new ChildProducts()
{
BarCode = product.BarCode,
CanInventorize = product.CanInventorize,
ColorId = Convert.ToInt32(strArrayColorSize[i].Split(',')[1]),
SizeId = Convert.ToInt32(strArrayColorSize[i].Split(',')[0]),
CompanyId = product.CompanyId,
Description = product.Description,
haveColorSizeMatrix = false,
id = 0,
ImageUrl = product.ImageUrl,
isSerialNoReq = product.isSerialNoReq,
MinInventoryLevel = product.MinInventoryLevel,
ParentProdId = product.id,
ProductClassId = product.ProductClassId,
ProductCode = "0",
ProductFamilyId = product.ProductFamilyId,
ProductSuppliersCostGrids = product.ProductSuppliersCostGrids ,
SellingPrice = product.SellingPrice,
IsActive = product.IsActive
});
}
}
objDataContext.ProductMasters.InsertOnSubmit(product);
objDataContext.SubmitChanges();

return 1;

}
catch
{
return -1;
}
}

ProductSuppliersCostGrids is my class in same datacontext and I set the relationship it to the productmaster class.

My problem is when I used above code( ProductSuppliersCostGrids = product.ProductSuppliersCostGrids) to insert the same suppliers list to childproducts, It's only added to first child product, not even in the main product and other child products..

Why?





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Post Reply
You must Sign In to post a response.
Next : Newbie to wcf need few basic question answered
Previous : I am getting error when i create my wcf apllication. it runs fine for the first time?
Return to Discussion Forum
Post New Message
Category: WCF

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use