Example #1
0
        public void SaveComment(string documentId, string categoryId, bool isError, string comment, string userId)
        {
            var model = GetComments(documentId, categoryId);

            if (model == null)
            {
                model = new FileLinksCategoryCom
                {
                    Id         = Guid.NewGuid(),
                    DocumentId = new Guid(documentId),
                    CategoryId = new Guid(categoryId),
                    DateCreate = DateTime.Now
                };
            }
            model.IsError = isError;
            var record = new FileLinksCategoryComRecord
            {
                CreateDate           = DateTime.Now,
                Note                 = comment,
                FileLinksCategoryCom = model,
                UserId               = new Guid(userId)
            };

            AppContext.FileLinksCategoryComRecords.Add(record);
            AppContext.SaveChanges();
        }
Example #2
0
        public ActionResult ShowDocComment(string documentId, string categoryId)
        {
            var repository = new UploadRepository();
            var model      = repository.GetComments(documentId, categoryId);

            if (model == null)
            {
                model = new FileLinksCategoryCom();
            }
            if (Request.IsAjaxRequest())
            {
                return(PartialView(model));
            }

            return(View(model));
        }
Example #3
0
        public void SetIsNotApplicabled(string documentId, string categoryId, bool isChecked)
        {
            var model = GetComments(documentId, categoryId);

            if (model == null)
            {
                model = new FileLinksCategoryCom
                {
                    Id              = Guid.NewGuid(),
                    DocumentId      = new Guid(documentId),
                    CategoryId      = new Guid(categoryId),
                    DateCreate      = DateTime.Now,
                    IsNotApplicable = isChecked
                };
                AppContext.FileLinksCategoryComs.Add(model);
            }
            else
            {
                model.IsNotApplicable = isChecked;
            }
            AppContext.SaveChanges();
        }