Пример #1
0
        public IActionResult CaseSessionDoc_ExpiredInfo(ExpiredInfoVM model)
        {
            if (!CheckAccess(service, SourceTypeSelectVM.CaseSessionDoc, model.Id, AuditConstants.Operations.Delete))
            {
                return(Redirect_Denied());
            }

            var expireObject = service.GetById <CaseSessionDoc>(model.Id);

            if (expireObject.SessionDocStateId != NomenclatureConstants.SessionDocState.Presented)
            {
                return(Json(new { result = false, message = "Може да премахнете документ, само със статус: представен." }));
            }

            if (service.SaveExpireInfo <CaseSessionDoc>(model))
            {
                SetAuditContextDelete(service, SourceTypeSelectVM.CaseSessionDoc, model.Id);
                SetSuccessMessage(MessageConstant.Values.CaseSessionExpireOK);
                return(Json(new { result = true, redirectUrl = Url.Action("Preview", "CaseSession", new { id = expireObject.CaseSessionId }) }));
            }
            else
            {
                return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
            }
        }
Пример #2
0
        public IActionResult CaseCrime_ExpiredInfo(ExpiredInfoVM model)
        {
            if (!CheckAccess(service, SourceTypeSelectVM.CaseCrime, model.Id, AuditConstants.Operations.Delete))
            {
                return(Redirect_Denied());
            }

            var expireObject = service.GetById <CaseCrime>(model.Id);

            if (eisppService.HaveEventForCrime(model.Id))
            {
                return(Json(new { result = false, message = "Може да премахнете престъпление, само ако не е изпратено към ЕИСПП." }));
            }

            if (service.SaveExpireInfo <CaseCrime>(model))
            {
                SetAuditContextDelete(service, SourceTypeSelectVM.CaseCrime, model.Id);
                SetSuccessMessage(MessageConstant.Values.CaseCrimeExpireOK);
                return(Json(new { result = true, redirectUrl = Url.Action("IndexCaseCrime", "CasePersonSentence", new { caseId = expireObject.CaseId }) }));
            }
            else
            {
                return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
            }
        }
        public IActionResult CaseSession_ExpiredInfo(ExpiredInfoVM model)
        {
            if (!CheckAccess(service, SourceTypeSelectVM.CaseSession, model.Id, AuditConstants.Operations.Delete))
            {
                return(Redirect_Denied());
            }
            if (!service.IsCanExpired(model.Id))
            {
                return(Json(new { result = false, message = "По заседанието има създадени и/или добавени документи." }));
            }
            if (string.IsNullOrEmpty(model.DescriptionExpired))
            {
                return(Json(new { result = false, message = "Няма въведена причина за изтриване." }));
            }

            var expireObject = service.GetById <CaseSession>(model.Id);

            if (service.CaseSession_ExpiredInfo(model))
            {
                SetAuditContextDelete(service, SourceTypeSelectVM.CaseSession, model.Id);
                SetSuccessMessage(MessageConstant.Values.CaseSessionExpireOK);
                return(Json(new { result = true, redirectUrl = Url.Action("CasePreview", "Case", new { id = expireObject.CaseId }) }));
            }
            else
            {
                return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
            }
        }
Пример #4
0
        public IActionResult CaseEvidence_ExpiredInfo(ExpiredInfoVM model)
        {
            if (!CheckAccess(service, SourceTypeSelectVM.CaseEvidence, model.Id, AuditConstants.Operations.Delete))
            {
                return(Redirect_Denied());
            }

            if (service.IsExistMovment(model.Id))
            {
                return(Json(new { result = false, message = "Има движение по това веществено доказателство." }));
            }

            var expireObject = service.GetById <CaseEvidence>(model.Id);

            if (service.SaveExpireInfo <CaseEvidence>(model))
            {
                SetAuditContextDelete(service, SourceTypeSelectVM.CaseEvidence, model.Id);
                SetSuccessMessage(MessageConstant.Values.CaseSessionExpireOK);
                return(Json(new { result = true, redirectUrl = Url.Action("CasePreview", "Case", new { id = expireObject.CaseId }) }));
            }
            else
            {
                return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
            }
        }
Пример #5
0
        public IActionResult ExpireFile(ExpiredInfoVM model)
        {
            if (!string.IsNullOrEmpty(model.StringId))
            {
                var fileInfo = cdnService.Select(0, null, model.StringId).FirstOrDefault();
                model.Id = fileInfo.MongoFileId;
                if (epepService.SaveExpireInfo <MongoFile>(model))
                {
                    LogFileOperation(fileInfo.SourceType, fileInfo.SourceId, $"Премахване на файл {fileInfo.FileName}:{fileInfo.Title}", OperationTypes.Patch);

                    return(Json(new { result = true, fileContainer = model.FileContainerName }));
                }
                else
                {
                    return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
                }
            }
            else
            {
                return(Json(new { result = false, message = "Няма избран файл." }));
            }
            //var actModel = service.GetById<CaseSessionAct>(model.Id);
            //if (service.SaveExpireInfo<CaseSessionAct>(model))
            //{
            //    taskService.ExpireAllUnfinishedTasks(SourceTypeSelectVM.CaseSessionAct, model.Id);
            //    SetAuditContextDelete(service, SourceTypeSelectVM.CaseSessionAct, model.Id);
            //    SetSuccessMessage(MessageConstant.Values.ActExpireOK);
            //    return Json(new { result = true, redirectUrl = Url.Action("Preview", "CaseSession", new { id = actModel.CaseSessionId }) });
            //}
            //else
            //{
            //    return Json(new { result = false, message = MessageConstant.Values.SaveFailed });
            //}
        }
Пример #6
0
 public IActionResult DeliveryAreaAddress_ExpiredInfo(ExpiredInfoVM model)
 {
     if (service.SaveExpireInfo <DeliveryAreaAddress>(model))
     {
         SetSuccessMessage(MessageConstant.Values.DeliveryAreaAddressExpireOK);
         return(Json(new { result = true, redirectUrl = model.ReturnUrl }));
     }
     else
     {
         return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
     }
 }
Пример #7
0
 public IActionResult DeliveryArea_ExpiredInfo(ExpiredInfoVM model)
 {
     if (service.SaveExpireInfo <DeliveryArea>(model))
     {
         SetSuccessMessage(MessageConstant.Values.CaseNotificationExpireOK);
         return(Json(new { result = true, redirectUrl = model.ReturnUrl })); // Url.Action("CaseNotification", new { id = model.Id }) });
     }
     else
     {
         return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
     }
 }
Пример #8
0
        public IActionResult ExpiredInfo(int id, long longId, string submitUrl, string returnUrl)
        {
            var model = new ExpiredInfoVM()
            {
                Id              = id,
                LongId          = longId,
                ExpireSubmitUrl = submitUrl,
                ReturnUrl       = returnUrl
            };

            return(PartialView(model));
        }
 public IActionResult  DeliveryItem_ExpiredInfo(ExpiredInfoVM model)
 {
     if (service.SaveExpireInfo <DeliveryItem>(model))
     {
         SetAuditContextDelete(service, SourceTypeSelectVM.CaseNotification, model.Id);
         SetSuccessMessage(MessageConstant.Values.CaseNotificationExpireOK);
         return(Json(new { result = true, redirectUrl = model.ReturnUrl }));
     }
     else
     {
         return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
     }
 }
Пример #10
0
 public IActionResult ExpiredInfo(ExpiredInfoVM model)
 {
     if (deliveryAccountService.SaveExpireInfoPlus(model))
     {
         SetSuccessMessage(MessageConstant.Values.DeliveryAccountExpireOK);
         var account = deliveryAccountService.GetById <DeliveryAccount>(model.ReturnUrl);
         return(Json(new { result = true, redirectUrl = Url.Action("Index", new { userId = account.MobileUserId }) }));
     }
     else
     {
         return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
     }
 }
Пример #11
0
        public IActionResult ElementTypeRule_ExpiredInfo(ExpiredInfoVM model)
        {
            var expireObject = service.GetById <CaseLoadElementTypeRule>(model.Id);

            if (service.ElementTypeRule_Expired(model))
            {
                SetSuccessMessage(MessageConstant.Values.CaseSessionExpireOK);
                return(Json(new { result = true, redirectUrl = Url.Action("EditElementType", "CaseLoadIndex", new { id = expireObject.CaseLoadElementTypeId }) }));
            }
            else
            {
                return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
            }
        }
Пример #12
0
        public IActionResult ExpiredInfo(int id, long longId, string stringId, string fileContainer, string submitUrl, string returnUrl, bool otherBool)
        {
            var model = new ExpiredInfoVM()
            {
                Id                = id,
                LongId            = longId,
                StringId          = stringId,
                ExpireSubmitUrl   = submitUrl,
                FileContainerName = fileContainer,
                ReturnUrl         = returnUrl,
                OtherBool         = otherBool
            };

            return(PartialView(model));
        }
Пример #13
0
        public bool SaveExpireInfoPlus(ExpiredInfoVM model)
        {
            var saved = repo.GetById <DeliveryAccount>(model.ReturnUrl);

            if (saved != null)
            {
                saved.DateExpired        = DateTime.Now;
                saved.UserExpiredId      = userContext.UserId;
                saved.DescriptionExpired = model.DescriptionExpired;
                repo.Update(saved);
                repo.SaveChanges();
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #14
0
        public IActionResult CaseSessionMeeting_ExpiredInfo(ExpiredInfoVM model)
        {
            if (!CheckAccess(service, SourceTypeSelectVM.CaseSessionMeeting, model.Id, AuditConstants.Operations.Delete))
            {
                return(Redirect_Denied());
            }
            var expireObject = service.GetById <CaseSessionMeeting>(model.Id);

            if (service.SaveExpireInfo <CaseSessionMeeting>(model))
            {
                SetAuditContextDelete(service, SourceTypeSelectVM.CaseSessionMeeting, model.Id);
                SetSuccessMessage(MessageConstant.Values.CaseSessionMeetingExpireOK);
                return(Json(new { result = true, redirectUrl = Url.Action("Preview", "CaseSession", new { id = expireObject.CaseSessionId }) }));
            }
            else
            {
                return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
            }
        }
Пример #15
0
        public IActionResult Assigment_ExpiredInfo(ExpiredInfoVM model)
        {
            var expiredModel = service.GetById <EpepUserAssignment>(model.Id);
            var caseModel    = service.GetById <IOWebApplication.Infrastructure.Data.Models.Cases.Case>(expiredModel.CaseId);

            if (service.SaveExpireInfo <EpepUserAssignment>(model))
            {
                service.AppendEpepUserAssignment(expiredModel, EpepConstants.ServiceMethod.Delete);
                SetAuditContextDelete(service, SourceTypeSelectVM.EpepUserAssignment, model.Id);
                SetSuccessMessage("Достъпът до делото е премахнат успешно.");

                string html = $"Премахнат достъп до дело {caseModel.RegNumber}";
                SaveLogOperation("epep", "epepuser_edit", html, IO.LogOperation.Models.OperationTypes.Delete, expiredModel.EpepUserId);

                return(Json(new { result = true, redirectUrl = Url.Action(nameof(EpepUser_Edit), new { id = expiredModel.EpepUserId }) }));
            }
            else
            {
                return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
            }
        }
Пример #16
0
 public IActionResult CasPersonLink_ExpiredInfo(ExpiredInfoVM model)
 {
     if (!CheckAccess(service, SourceTypeSelectVM.CasePersonLink, model.Id, AuditConstants.Operations.Delete))
     {
         return(Redirect_Denied());
     }
     if (service.HaveCaseNotification(model.Id))
     {
         return(Json(new { result = false, message = "Има активни уведомления с тази връзка" }));
     }
     if (service.SaveExpireInfo <CasePersonLink>(model))
     {
         SetAuditContextDelete(service, SourceTypeSelectVM.CasePersonLink, model.Id);
         SetSuccessMessage(MessageConstant.Values.CasePersonLinkExpireOK);
         return(Json(new { result = true, redirectUrl = model.ReturnUrl }));
     }
     else
     {
         return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
     }
 }
Пример #17
0
 public IActionResult CasePersonPunishment_ExpiredInfo(ExpiredInfoVM model)
 {
     if (!CheckAccess(service, SourceTypeSelectVM.CasePersonSentencePunishment, model.Id, AuditConstants.Operations.Delete))
     {
         return(Json(new { result = false, message = "Нямате права да изтриете наказанието" }));
     }
     if (eisppService.HaveEventForPunishment(model.Id))
     {
         return(Json(new { result = false, message = "Има ЕИСПП събитие за наказанието" }));
     }
     if (service.SaveExpireInfo <CasePersonSentencePunishment>(model))
     {
         SetAuditContextDelete(service, SourceTypeSelectVM.CasePersonSentencePunishment, model.Id);
         SetSuccessMessage(MessageConstant.Values.CasePersonSentencePunishmentExpireOK);
         return(Json(new { result = true, redirectUrl = model.ReturnUrl }));
     }
     else
     {
         return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
     }
 }
Пример #18
0
        public IActionResult CaseSessionActComplain_ExpiredInfo(ExpiredInfoVM model)
        {
            if (!CheckAccess(service, SourceTypeSelectVM.CaseSessionActComplain, model.Id, AuditConstants.Operations.Delete))
            {
                return(Redirect_Denied());
            }
            var expireObject = service.GetById <CaseSessionActComplain>(model.Id);

            if (caseMigrationService.IsExistMigrationWithAct(expireObject.CaseSessionActId))
            {
                return(Json(new { result = false, message = "Акта е изпратен в по-висша инстанция за обжалване." }));
            }

            if (service.SaveExpireInfo <CaseSessionActComplain>(model))
            {
                SetAuditContextDelete(service, SourceTypeSelectVM.CaseSessionActComplain, model.Id);
                SetSuccessMessage(MessageConstant.Values.CaseSessionActComplainExpireOK);
                return(Json(new { result = true, redirectUrl = Url.Action("Index", "CaseSessionActComplain", new { caseSessionActId = expireObject.CaseSessionActId }) }));
            }
            else
            {
                return(Json(new { result = false, message = MessageConstant.Values.SaveFailed }));
            }
        }
Пример #19
0
 bool IBaseService.SaveExpireInfo <T>(ExpiredInfoVM model)
 {
     throw new NotImplementedException();
 }