// Invoices //public void Invoice_Insert(InventoryInfo info) //{ // //check we have some content to store // if (info.InvoiceNumber != string.Empty) // { // DataProvider.Instance().Invoice_Insert(info.InvoiceNumber, info.InvoiceDate, info.SupplierID, info.CreatedByUserID, info.ModuleId, info.PortalId); // } //} public int Invoice_Insert(InventoryInfo info) { // return Convert.ToInt32(DataProvider.Instance().Invoice_Insert(info.InvoiceNumber, info.InvoiceDate, info.SupplierID, info.CreatedByUserID, info.ModuleId, info.PortalId)); //check we have some content to store if (info.InvoiceNumber != string.Empty) { return(Convert.ToInt32(DataProvider.Instance().Invoice_Insert(info.InvoiceNumber, info.InvoiceDate, info.SupplierID, info.CreatedByUserID, info.ModuleId, info.PortalId))); } else { return(0); } }
//public static List<T> DataReaderMapToList<T>(IDataReader dr) //{ // List<T> list = new List<T>(); // T obj = default(T); // while (dr.Read()) // { // obj = Activator.CreateInstance<T>(); // foreach (PropertyInfo prop in obj.GetType().GetProperties()) // { // if (!object.Equals(dr[prop.Name], DBNull.Value)) // { // prop.SetValue(obj, dr[prop.Name], null); // } // } // list.Add(obj); // } // return list; //} #region IPortable Members /// <summary> /// Exports a module to xml /// </summary> /// <param name="ModuleID"></param> /// <returns></returns> //public string ExportModule(int moduleID) //{ // StringBuilder sb = new StringBuilder(); // List<InventoryInfo> infos = GetInventorys(moduleID); // if (infos.Count > 0) // { // sb.Append("<Inventorys>"); // foreach (InventoryInfo info in infos) // { // sb.Append("<Inventory>"); // sb.Append("<content>"); // sb.Append(XmlUtils.XMLEncode(info.ProductName)); // sb.Append("</content>"); // sb.Append("</Inventory>"); // } // sb.Append("</Inventorys>"); // } // return sb.ToString(); //} /// <summary> /// imports a module from an xml file /// </summary> /// <param name="ModuleID"></param> /// <param name="Content"></param> /// <param name="Version"></param> /// <param name="UserID"></param> public void ImportModule(int ModuleID, string Content, string Version, int UserID) { XmlNode infos = DotNetNuke.Common.Globals.GetContent(Content, "Inventorys"); foreach (XmlNode info in infos.SelectNodes("Inventory")) { InventoryInfo InventoryInfo = new InventoryInfo(); InventoryInfo.ModuleId = ModuleID; InventoryInfo.ProductName = info.SelectSingleNode("ProductName").InnerText; InventoryInfo.CreatedByUserID = UserID; // AddInventory(InventoryInfo); } }