/// <summary> /// update booktitle based in id /// </summary> /// <param name="booktitle"></param> public static void UpdateItem(ItemTable item) { db4oManager.WithContainer(container => { // The office object that is passed to this procedure is not connected to // the db4o container so we first have to do that. List <ItemTable> _list = (from ItemTable i in container where i.TitleID == item.TitleID && i.OrderNumber == item.OrderNumber select i).ToList(); if (_list != null) { // Then we should pass the properties from the updated object to the // selected one. // TODO: Maybe we could make a reflection procedure for this? _list[0].OrderNumber = item.OrderNumber; _list[0].Title = item.Title; _list[0].Copies = item.Copies; _list[0].Isbn = item.Isbn; _list[0].Impression = item.Impression; _list[0].PONumber = item.PONumber; _list[0].OtherRef = item.OtherRef; _list[0].TotalValue = item.TotalValue; _list[0].SSRNo = item.SSRNo; _list[0].SSRDate = item.SSRDate; _list[0].PerCopy = item.PerCopy; container.Store(_list[0]); } }); }
//end select title /// <summary> /// returns titleid if save is successful /// </summary> /// <param name="booktitle"></param> /// <returns></returns> public static int InsertItem(ItemTable item) { db4oManager.WithContainer(container => { container.Store(item); }); return(item.TitleID); }
public void Update(int TitleID, int?OrderNumber, string Title, string Isbn, string SSRNo, DateTime?SSRDate, string Impression, string PONumber, string OtherRef, int?Copies, DateTime?CopiesLastUpdated, string ItemDesc, int?Packages, int?PackageID, int?Weight, int?Volume, double?PerCopy, decimal?TotalValue, byte[] Ts) { ItemTable item = new ItemTable(); item.MarkOld(); item.IsLoaded = true; item.TitleID = TitleID; item.OrderNumber = OrderNumber; item.Title = Title; item.Isbn = Isbn; item.SSRNo = SSRNo; item.SSRDate = SSRDate; item.Impression = Impression; item.PONumber = PONumber; item.OtherRef = OtherRef; item.Copies = Copies; item.CopiesLastUpdated = CopiesLastUpdated; item.ItemDesc = ItemDesc; item.Packages = Packages; item.PackageID = PackageID; item.Weight = Weight; item.Volume = Volume; item.PerCopy = PerCopy; item.TotalValue = TotalValue; item.Ts = Ts; item.Save(UserName); }
public bool Destroy(object TitleID) { return(ItemTable.Destroy(TitleID) == 1); }
public bool Delete(object TitleID) { return(ItemTable.Delete(TitleID) == 1); }