public ActionResult CommentTypeCreate(CommentTypeModel model) { try {//10/10/2019 aakansha ViewBag.FormName = "CommentType"; if (model.Id == 0) { //General Data var data = new CommentType(); data.CreatedOn = model.CreatedOn; data.Deleted = model.Deleted; data.CommentTypeName = model.CommentTypeName; data.IsActive = model.IsActive; data.LastUpdated = model.LastUpdated; _treatmentServices.InsertCommentType(data); AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgAddCommenttype, NotificationMessage.TypeSuccess); return(RedirectToAction("CommentTypeIndex")); } else { var data = _treatmentServices.GetCommentTypeById((int)model.Id); data.CreatedOn = model.CreatedOn; data.Deleted = model.Deleted; data.CommentTypeName = model.CommentTypeName; data.Id = model.Id; data.IsActive = model.IsActive; data.LastUpdated = model.LastUpdated; _treatmentServices.UpdateCommentType(data); AddNotification(NotificationMessage.TitleSuccess, NotificationMessage.msgAddCommenttype, NotificationMessage.TypeSuccess); return(RedirectToAction("CommentTypeIndex")); } } catch { AddNotification(NotificationMessage.TitleError, NotificationMessage.ErrorMsg, NotificationMessage.TypeError); return(View()); } }
// GET: Treatment/Create public ActionResult CommentTypeCreate(int?Id) {//10/10/2019 aakansha ViewBag.FormName = "CommentType"; var model = new CommentTypeModel(); if (Id == 0) { return(View(model)); } else { var data = _treatmentServices.GetCommentTypeById((int)Id); model.CreatedOn = data.CreatedOn; model.Deleted = data.Deleted; model.CommentTypeName = data.CommentTypeName; model.Id = data.Id; model.IsActive = data.IsActive; model.LastUpdated = data.LastUpdated; return(View(model)); } }
protected string PrepareDictionaryAddHtmlStr(Dictionary dic, DictionaryModel model) { model.DictionaryId = dic.Id; if (model.Type != DictionaryType.FirstCommentType) { var list = new List <DictionaryModel>(); list.Add(model); return(base.RenderPartialViewToString("_DictionaryItem", list)); } else { CommentTypeModel commentType = new CommentTypeModel() { BaseCommentType = model.BaseCommentType.Value, FirstCommentTypeName = model.DisplayName, commentId = dic.Id, type = DictionaryType.FirstCommentType, }; var list = new List <CommentTypeModel>(); list.Add(commentType); return(base.RenderPartialViewToString("_DictionaryCommentType", list)); } }