public void SavePackage(int Id, string Title, string Configurable, string InheritPrice, string InheritCost, string Manufacturer, string Partcode, string DescriptionTemplate, string Availability, string ProductLines) { Package p = new Package(Id); p.Title = Title; p.Configurable = (Configurable == "on"); p.InheritPrice = (InheritPrice == "on"); p.InheritCost = (InheritCost == "on"); p.Manufacturer = Manufacturer; p.Partcode = Partcode; p.DescriptionTemplate = DescriptionTemplate; p.Availability = Availability; p.Save(); p.ClearProductLines(); foreach (string productLineId in ProductLines.Split(',')) { if (!String.IsNullOrEmpty(productLineId)) p.AttachProductLine(Convert.ToInt32(productLineId)); } }