Exemple #1
0
        /// <summary>
        /// Delete the current ModuleAccess based on the ModuleAccess ID passed in the ModuleAccessModel
        /// </summary>
        /// <param name="moduleAccessId">The module access identifier.</param>
        /// <returns></returns>
        public ActionResult DeleteModuleAccess(int moduleAccessId)
        {
            using (var moduleAccessBal = new ModuleAccessBal())
            {
                //Get ModuleAccess model object by current ModuleAccess ID
                var currentModuleAccess = moduleAccessBal.GetModuleAccessByID(Convert.ToInt32(moduleAccessId));

                //Check If ModuleAccess model is not null
                if (currentModuleAccess != null)
                {
                    currentModuleAccess.IsDeleted   = true;
                    currentModuleAccess.DeletedBy   = Helpers.GetLoggedInUserId();
                    currentModuleAccess.DeletedDate = Helpers.GetInvariantCultureDateTime();

                    //Update Operation of current ModuleAccess
                    var result = moduleAccessBal.DeleteEntry(currentModuleAccess);

                    //return deleted ID of current ModuleAccess as Json Result to the Ajax Call.
                    return(Json(result));
                }
            }

            //Return the Json result as Action Result back JSON Call Success
            return(Json(null));
        }
Exemple #2
0
        /// <summary>
        /// Get the details of the current ModuleAccess in the view model by ID
        /// </summary>
        /// <param name="moduleAccessId">The module access identifier.</param>
        /// <returns></returns>
        public ActionResult GetModuleAccess(int moduleAccessId)
        {
            using (var moduleAccessBal = new ModuleAccessBal())
            {
                //Call the AddModuleAccess Method to Add / Update current ModuleAccess
                var currentModuleAccess = moduleAccessBal.GetModuleAccessByID(Convert.ToInt32(moduleAccessId));

                //If the view is shown in ViewMode only, then ViewBag.ViewOnly is set to true otherwise false.
                //ViewBag.ViewOnly = !string.IsNullOrEmpty(model.ViewOnly);

                //Pass the ActionResult with the current ModuleAccessViewModel object as model to PartialView ModuleAccessAddEdit
                return(PartialView(PartialViews.ModuleAccessAddEdit, currentModuleAccess));
            }
        }