/// <summary>
 /// Deprecated Method for adding a new object to the StationeryRetrievalFormItems EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStationeryRetrievalFormItems(StationeryRetrievalFormItem stationeryRetrievalFormItem)
 {
     base.AddObject("StationeryRetrievalFormItems", stationeryRetrievalFormItem);
 }
 /// <summary>
 /// Create a new StationeryRetrievalFormItem object.
 /// </summary>
 /// <param name="stationeryRetrievalFormItemID">Initial value of the StationeryRetrievalFormItemID property.</param>
 /// <param name="stationeryRetrievalFormID">Initial value of the StationeryRetrievalFormID property.</param>
 /// <param name="quantityNeeded">Initial value of the QuantityNeeded property.</param>
 public static StationeryRetrievalFormItem CreateStationeryRetrievalFormItem(global::System.Int32 stationeryRetrievalFormItemID, global::System.Int32 stationeryRetrievalFormID, global::System.Int32 quantityNeeded)
 {
     StationeryRetrievalFormItem stationeryRetrievalFormItem = new StationeryRetrievalFormItem();
     stationeryRetrievalFormItem.StationeryRetrievalFormItemID = stationeryRetrievalFormItemID;
     stationeryRetrievalFormItem.StationeryRetrievalFormID = stationeryRetrievalFormID;
     stationeryRetrievalFormItem.QuantityNeeded = quantityNeeded;
     return stationeryRetrievalFormItem;
 }
        /// <summary>
        /// Update the Stationery Retrieval FormItem
        /// </summary>
        /// <param name="stationeryRetrievalFormItem">stationeryRetrievalFormItem object</param>
        public StationeryRetrievalFormItem UpdateStationeryRetrievalFormItem(StationeryRetrievalFormItem stationeryRetrievalFormItem)
        {
            try
            {
                var temp = (from srfi in context.StationeryRetrievalFormItems
                            where srfi.StationeryRetrievalFormItemID == stationeryRetrievalFormItem.StationeryRetrievalFormItemID
                            select srfi).First<StationeryRetrievalFormItem>();

                temp.QuantityRetrieved = stationeryRetrievalFormItem.QuantityRetrieved;

                context.SaveChanges();
                return temp;
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// Create a new Stationery Retrieval FormItem
        /// </summary>
        /// <param name="stationeryRetrievalFormItem">stationeryRetrievalFormItem object</param>
        public void CreateStationeryRetrievalFormItem(StationeryRetrievalFormItem stationeryRetrievalFormItem)
        {
            try
            {
                context.AddToStationeryRetrievalFormItems(stationeryRetrievalFormItem);
                context.SaveChanges();
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// Get Stationery Retrieval FormItem by primary key
        /// </summary>
        /// <param name="stationeryRetrievalFormItem">stationeryRetrievalFormItem object</param>
        /// <returns>List of StationeryRetrievalFormItem objects</returns>
        public StationeryRetrievalFormItem GetStationeryRetrievalFormItemByID(StationeryRetrievalFormItem stationeryRetrievalFormItem)
        {
            try
            {
                return GetAllStationeryRetrievalFormItems().
                    Where(srfi => srfi.StationeryRetrievalFormItemID == stationeryRetrievalFormItem.StationeryRetrievalFormItemID)
                    .FirstOrDefault<StationeryRetrievalFormItem>();
            }
            catch (Exception)
            {

                throw;
            }
        }