/// <summary> /// Add New or Update the DashboardRemark based on if we pass the DashboardRemark ID in the DashboardRemarkViewModel object. /// </summary> /// <param name="model">The model.</param> /// <returns> /// returns the newly added or updated ID of DashboardRemark row /// </returns> public ActionResult SaveDashboardRemark(DashboardRemark model) { var userId = Helpers.GetLoggedInUserId(); var currentDate = Helpers.GetInvariantCultureDateTime(); var list = new List <DashboardRemarkCustomModel>(); //Check if Model is not null if (model != null) { using (var bal = new DashboardRemarkBal()) { model.CorporateId = Helpers.GetSysAdminCorporateID(); model.IsActive = true; if (model.Id == 0) { model.CreatedBy = userId; model.CreatedDate = currentDate; } //Call the AddDashboardRemark Method to Add / Update current DashboardRemark list = bal.SaveDashboardRemark(model); } } //Pass the ActionResult with List of DashboardRemarkViewModel object to Partial View DashboardRemarkList return(PartialView(PartialViews.DashboardRemarkList, list)); }
/// <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 }