コード例 #1
0
        /// <summary>
        /// Get the details of the current DashboardRemark in the view model by ID
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns></returns>
        public JsonResult GetDashboardRemarkDetails(int id)
        {
            using (var bal = new DashboardRemarkBal())
            {
                //Call the AddDashboardRemark Method to Add / Update current DashboardRemark
                var current = bal.GetDashboardRemarkByID(id);

                //Pass the ActionResult with the current DashboardRemarkViewModel object as model to PartialView DashboardRemarkAddEdit
                return(Json(current));
            }
        }
コード例 #2
0
        /// <summary>
        /// Delete the current DashboardRemark based on the DashboardRemark ID passed in the DashboardRemarkModel
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <returns></returns>
        public ActionResult DeleteDashboardRemark(int id)
        {
            using (var bal = new DashboardRemarkBal())
            {
                //Get DashboardRemark model object by current DashboardRemark ID
                var model = bal.GetDashboardRemarkByID(id);
                var list  = new List <DashboardRemarkCustomModel>();
                //Check If DashboardRemark model is not null
                if (model != null)
                {
                    model.IsActive = false;

                    //Update Operation of current DashboardRemark
                    list = bal.SaveDashboardRemark(model);
                    //return deleted ID of current DashboardRemark as Json Result to the Ajax Call.
                }
                return(PartialView(PartialViews.DashboardRemarkList, list));
            }

            //Pass the ActionResult with List of DashboardRemarkViewModel object to Partial View DashboardRemarkList
        }