Beispiel #1
0
        /// <summary>
        /// Action Method to save the changes to the fees made by the user
        /// </summary>
        /// <param name="userInput"> the changes made to the fees by the user</param>
        /// <returns>PartialView or Success Message</returns>
        public ActionResult UpdateFees(HostelChargesViewModel userInput)
        {
            // if model is not valid, do not process furthur
            if (!ModelState.IsValid)
            {
                return(PartialView("_FeeChange", userInput));
            }

            // get previously saved value
            HostelChargesViewModel originalValues = TempData.Peek("originalValues") as HostelChargesViewModel;

            // get the previously saved IDs
            int rentId = (int)TempData.Peek("rentId");
            int fixId  = (int)TempData.Peek("fixId");
            int depId  = (int)TempData.Peek("depId");

            TransactionHelper helper = new TransactionHelper();

            return(Content(helper.ChangeHostelFees(userInput, originalValues, rentId, fixId, depId)));
        }