/// <summary>
 /// Deprecated Method for adding a new object to the StationeryRetrievalFormItemByDepts EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStationeryRetrievalFormItemByDepts(StationeryRetrievalFormItemByDept stationeryRetrievalFormItemByDept)
 {
     base.AddObject("StationeryRetrievalFormItemByDepts", stationeryRetrievalFormItemByDept);
 }
 /// <summary>
 /// Create a new StationeryRetrievalFormItemByDept object.
 /// </summary>
 /// <param name="stationeryRetrievalFormItemByDeptID">Initial value of the StationeryRetrievalFormItemByDeptID property.</param>
 public static StationeryRetrievalFormItemByDept CreateStationeryRetrievalFormItemByDept(global::System.Int32 stationeryRetrievalFormItemByDeptID)
 {
     StationeryRetrievalFormItemByDept stationeryRetrievalFormItemByDept = new StationeryRetrievalFormItemByDept();
     stationeryRetrievalFormItemByDept.StationeryRetrievalFormItemByDeptID = stationeryRetrievalFormItemByDeptID;
     return stationeryRetrievalFormItemByDept;
 }
        /// <summary>
        /// Get Stationery Retrieval FormItemByDept by primary key
        /// </summary>
        /// <param name="stationeryRetrievalFormItemByDept">StationeryRetrievalFormItemByDept object</param>
        /// <returns>StationeryRetrievalFormItemByDept object</returns>
        public StationeryRetrievalFormItemByDept GetStationeryRetrievalFormItemByDeptByID(StationeryRetrievalFormItemByDept stationeryRetrievalFormItemByDept)
        {
            try
            {
                return GetAllStationeryRetrievalFormItemByDept()
                    .Where(x => x.StationeryRetrievalFormItemByDeptID == stationeryRetrievalFormItemByDept.StationeryRetrievalFormItemByDeptID)
                    .FirstOrDefault<StationeryRetrievalFormItemByDept>();
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// Update Stationery Retrieval FormItemByDept
        /// </summary>
        /// <param name="stationeryRetrievalFormItemByDept">stationeryRetrievalFormItemByDept object</param>
        public void UpdateStationeryRetrievalFormItemByDept(StationeryRetrievalFormItemByDept stationeryRetrievalFormItemByDept)
        {
            try
            {
                var temp = (from x in context.StationeryRetrievalFormItemByDepts
                            where x.StationeryRetrievalFormItemByDeptID == stationeryRetrievalFormItemByDept.StationeryRetrievalFormItemByDeptID
                            select x).FirstOrDefault<StationeryRetrievalFormItemByDept>();

                temp.QuantityActual = stationeryRetrievalFormItemByDept.QuantityActual;
                context.SaveChanges();
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// Create a new Stationery Retrieval FormItemByDept
        /// </summary>
        /// <param name="stationeryRetrievalFormItemByDept">stationeryRetrievalFormItemByDept object</param>
        public void CreateStationeryRetrievalFormItemByDept(StationeryRetrievalFormItemByDept stationeryRetrievalFormItemByDept)
        {
            try
            {
                context.AddToStationeryRetrievalFormItemByDepts(stationeryRetrievalFormItemByDept);
                context.SaveChanges();
            }
            catch (Exception)
            {

                throw;
            }
        }