/// <summary>
 /// Create Stationery Retrieval Form By Requisition
 /// </summary>
 /// <param name="stationeryRetrievalFormByRequisition">StationeryRetrievalFormByRequisition object</param>
 public void CreateStationeryRetrievalFormByRequisition(StationeryRetrievalFormByRequisition stationeryRetrievalFormByRequisition)
 {
     try
     {
         context.AddToStationeryRetrievalFormByRequisitions(stationeryRetrievalFormByRequisition);
         context.SaveChanges();
     }
     catch (Exception)
     {
         throw;
     }
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the StationeryRetrievalFormByRequisitions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToStationeryRetrievalFormByRequisitions(StationeryRetrievalFormByRequisition stationeryRetrievalFormByRequisition)
 {
     base.AddObject("StationeryRetrievalFormByRequisitions", stationeryRetrievalFormByRequisition);
 }
 /// <summary>
 /// Create a new StationeryRetrievalFormByRequisition object.
 /// </summary>
 /// <param name="stationeryRetrievalFormByRequisitionID">Initial value of the StationeryRetrievalFormByRequisitionID property.</param>
 /// <param name="requisitionID">Initial value of the RequisitionID property.</param>
 /// <param name="stationeryRetrievalFormItemByDeptID">Initial value of the StationeryRetrievalFormItemByDeptID property.</param>
 public static StationeryRetrievalFormByRequisition CreateStationeryRetrievalFormByRequisition(global::System.Int32 stationeryRetrievalFormByRequisitionID, global::System.Int32 requisitionID, global::System.Int32 stationeryRetrievalFormItemByDeptID)
 {
     StationeryRetrievalFormByRequisition stationeryRetrievalFormByRequisition = new StationeryRetrievalFormByRequisition();
     stationeryRetrievalFormByRequisition.StationeryRetrievalFormByRequisitionID = stationeryRetrievalFormByRequisitionID;
     stationeryRetrievalFormByRequisition.RequisitionID = requisitionID;
     stationeryRetrievalFormByRequisition.StationeryRetrievalFormItemByDeptID = stationeryRetrievalFormItemByDeptID;
     return stationeryRetrievalFormByRequisition;
 }
        /// <summary>
        /// Update Stationery Retrieval Form By Requisition
        /// </summary>
        /// <param name="stationeryRetrievalFormByRequisition">StationeryRetrievalFormByRequisition object</param>
        public void UpdateStationeryRetrievalFormByRequisition(StationeryRetrievalFormByRequisition stationeryRetrievalFormByRequisition)
        {
            try
            {
                var temp = (from x in context.StationeryRetrievalFormByRequisitions
                            where x.StationeryRetrievalFormByRequisitionID == stationeryRetrievalFormByRequisition.StationeryRetrievalFormByRequisitionID
                            select x).FirstOrDefault<StationeryRetrievalFormByRequisition>();

                temp.RequisitionID = stationeryRetrievalFormByRequisition.RequisitionID;
                temp.StationeryRetrievalFormItemByDeptID = stationeryRetrievalFormByRequisition.StationeryRetrievalFormItemByDeptID;

                context.SaveChanges();
            }
            catch (Exception)
            {
                throw;
            }
        }
        /// <summary>
        /// Get Stationery Retrieval FormByRequistion by primary key
        /// </summary>
        /// <param name="stationeryRetrievalFormByRequisition">StationeryRetrievalFormByRequisition object</param>
        /// <returns>StationeryRetrievalFormByRequisition object</returns>
        public StationeryRetrievalFormByRequisition GetStationeryRetrievalFormByRequisitionByID(StationeryRetrievalFormByRequisition stationeryRetrievalFormByRequisition)
        {
            try
            {
                return GetAllStationeryRetrievalFormByRequisitions()
                    .Where(x => x.StationeryRetrievalFormByRequisitionID == stationeryRetrievalFormByRequisition.StationeryRetrievalFormByRequisitionID)
                    .FirstOrDefault<StationeryRetrievalFormByRequisition>();
            }
            catch (Exception)
            {

                throw;
            }
        }