public void InitializeObject(string itemCode, string baseItemCode) { string xml = string.Empty; B1Base.DAO.ItemDI itemBaseDI = new B1Base.DAO.ItemDI(); itemBaseDI.InitializeObject(baseItemCode); try { xml = itemBaseDI.GetXmlForDI(); } finally { itemBaseDI.FinalizeObject(); } xml = xml.Replace(baseItemCode, itemCode); _businessObject = (Items)Controller.ConnectionController.Instance.Company.GetBusinessObject(BoObjectTypes.oItems); _bean = new ItemsBean(); if (!_businessObject.GetByKey(itemCode)) { _newObject = true; _businessObject.ItemCode = itemCode; } _businessObject.UpdateFromXML(xml); _businessObject.Series = 3; }
public void CopyFrom(string baseItemCode) { string xml = string.Empty; B1Base.DAO.ItemDI itemBaseDI = new B1Base.DAO.ItemDI(); itemBaseDI.InitializeObject(baseItemCode); try { xml = itemBaseDI.GetXmlForDI(); } finally { itemBaseDI.FinalizeObject(); } xml = xml.Replace(baseItemCode, _businessObject.ItemCode); _businessObject.UpdateFromXML(xml); _businessObject.Series = 3; }