public IActionResult Add(OpsTransactionModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var existedMessage = transactionService.CheckExist(model);

            if (existedMessage != null)
            {
                return(Ok(new ResultHandle {
                    Status = false, Message = existedMessage
                }));
            }
            model.Hblid = Guid.NewGuid();
            var          hs      = transactionService.Add(model);
            var          message = HandleError.GetMessage(hs, Crud.Insert);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value, Data = model.Id
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult AddNew(AcctSoaModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var hs = acctSOAService.AddSOA(model);

            if (hs.Code == 403)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = stringLocalizer[LanguageSub.DO_NOT_HAVE_PERMISSION].Value
                }));
            }

            var          message = HandleError.GetMessage(hs, Crud.Insert);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value, Data = model
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Add(CatChargeDefaultAccountModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var checkExistMessage = CheckExist(0, model);

            if (checkExistMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = checkExistMessage
                }));
            }

            var catChargeDefaultAccount = mapper.Map <CatChargeDefaultAccountModel>(model);

            catChargeDefaultAccount.UserCreated     = catChargeDefaultAccount.UserModified = currentUser.UserID;
            catChargeDefaultAccount.DatetimeCreated = DateTime.Now;
            catChargeDefaultAccount.Active          = true;
            var          hs      = catChargeDefaultAccountService.Add(catChargeDefaultAccount);
            var          message = HandleError.GetMessage(hs, Crud.Insert);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Delete(string soaNo)
        {
            var isAllowDelete = acctSOAService.CheckDeletePermission(soaNo);

            if (isAllowDelete == false)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = stringLocalizer[LanguageSub.DO_NOT_HAVE_PERMISSION].Value
                }));
            }

            ChangeTrackerHelper.currentUser = currentUser.UserID;
            var hs = acctSOAService.DeleteSOA(soaNo);

            if (hs.Code == 403)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = stringLocalizer[LanguageSub.DO_NOT_HAVE_PERMISSION].Value
                }));
            }

            //Update SOANo = NULL & PaySOANo = NULL for ShipmentSurcharge
            acctSOAService.UpdateSOASurCharge(soaNo);
            var          message = HandleError.GetMessage(hs, Crud.Delete);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Put(CatCurrencyModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var checkExistMessage = CheckExist(model.Id, model);

            if (checkExistMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = checkExistMessage
                }));
            }
            var          hs      = catCurrencyService.Update(model);
            var          message = HandleError.GetMessage(hs, Crud.Update);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 6
0
        public IActionResult Put(short id, CatCommodityEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var checkExistMessage = CheckExist(id, model);

            if (checkExistMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = checkExistMessage
                }));
            }
            var commodity = mapper.Map <CatCommodityModel>(model);

            commodity.Id = id;
            var          hs      = catComonityService.Update(commodity);
            var          message = HandleError.GetMessage(hs, Crud.Update);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Update(OpsTransactionModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var existedMessage = transactionService.CheckExist(model);

            if (existedMessage != null)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = existedMessage
                }));
            }

            var          hs      = transactionService.Update(model);//.Update(model,x=>x.Id==model.Id);
            var          message = HandleError.GetMessage(hs, Crud.Update);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Delete(string settlementNo)
        {
            var isAllowDelete = acctSettlementPaymentService.CheckDeletePermissionBySettlementNo(settlementNo);

            if (isAllowDelete == false)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = stringLocalizer[LanguageSub.DO_NOT_HAVE_PERMISSION].Value
                }));
            }

            ChangeTrackerHelper.currentUser = currentUser.UserID;

            HandleState hs = acctSettlementPaymentService.DeleteSettlementPayment(settlementNo);

            if (hs.Code == 403)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = stringLocalizer[LanguageSub.DO_NOT_HAVE_PERMISSION].Value
                }));
            }

            var          message = HandleError.GetMessage(hs, Crud.Delete);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Add(List <SysUserPermissionEditModel> list)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var checkDupRole = list.GroupBy(x => new { x.OfficeId })
                               .Where(t => t.Count() > 1)
                               .Select(y => y.Key)
                               .ToList();

            if (checkDupRole.Count > 0)
            {
                return(Ok(new ResultHandle {
                    Status = false, Message = stringLocalizer[SystemLanguageSub.MSG_ITEM_DUPLICATE_ROLE_ON_USER, "role"].Value, Data = checkDupRole
                }));
            }

            var          hs      = userPermissionService.Add(list);
            var          message = HandleError.GetMessage(hs, Crud.Insert);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 10
0
        public IActionResult Add(SysGroupModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var existedMessage = CheckExistCode(model.Code, 0);

            if (existedMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = existedMessage
                }));
            }

            var hs      = sysGroupService.Add(model);
            var message = HandleError.GetMessage(hs, Crud.Insert);

            ResultHandle result = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value, Data = model
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 11
0
        public IActionResult Update(SysGroupModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var existedMessage = CheckExistCode(model.Code, model.Id);

            if (existedMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = existedMessage
                }));
            }
            model.UserModified     = currentUser.UserID;
            model.DatetimeModified = DateTime.Now;
            var hs      = sysGroupService.Update(model, x => x.Id == model.Id);
            var message = HandleError.GetMessage(hs, Crud.Update);

            ResultHandle result = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 12
0
        public IActionResult Post(SysOfficeEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var checkExistMessage = CheckExist(Guid.Empty, model);

            if (checkExistMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = checkExistMessage
                }));
            }
            var branch = mapper.Map <SysOfficeModel>(model);

            branch.UserCreated     = branch.UserModified = currentUser.UserID;
            branch.Id              = Guid.NewGuid();
            branch.DatetimeCreated = branch.DatetimeModified = DateTime.Now;
            var          hs      = sysOfficeService.AddOffice(branch);
            var          message = HandleError.GetMessage(hs, Crud.Insert);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value, Data = branch
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 13
0
        public IActionResult Update(CatDepartmentModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            if (catDepartmentService.CheckExistsDeptAccountantInOffice(model))
            {
                return(Ok(new ResultHandle {
                    Status = false, Message = stringLocalizer[SystemLanguageSub.MSG_ITEM__EXISTED_ACCOUNTANT_DEPT_IN_OFFICE].Value, Data = model
                }));
            }

            var hs = catDepartmentService.Update(model);

            var message = HandleError.GetMessage(hs, Crud.Update);

            ResultHandle result = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(Ok(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 14
0
        public IActionResult Add(SysCompanyAddModel company)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var checkExistMessage = CheckExist(company);

            if (checkExistMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = checkExistMessage
                }));
            }
            var hs = sysCompanyService.Add(company);

            var message = HandleError.GetMessage(hs, Crud.Insert);

            ResultHandle result = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value, Data = company
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Delete(int id)
        {
            PermissionRange permissionRange;
            ICurrentUser    _user = PermissionExtention.GetUserMenuPermission(currentUser, Menu.settingEcusConnection);

            permissionRange = PermissionExtention.GetPermissionRange(_user.UserMenuPermission.Delete);
            bool isAllowDelete = ecusConnectionService.CheckAllowPermissionAction(id, permissionRange);

            if (isAllowDelete == false)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = stringLocalizer[LanguageSub.DO_NOT_HAVE_PERMISSION].Value
                }));
            }

            ChangeTrackerHelper.currentUser = currentUser.UserID;
            var          hs      = ecusConnectionService.Delete(x => x.Id == id);
            var          message = HandleError.GetMessage(hs, Crud.Delete);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 16
0
        public IActionResult Update(CatCountryModel catCountry)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var checkExistMessage = CheckExist(catCountry.Id, catCountry);

            if (checkExistMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = checkExistMessage
                }));
            }

            var          hs      = catCountryService.Update(catCountry);
            var          message = HandleError.GetMessage(hs, Crud.Update);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            catCountryService.ClearCache();
            return(Ok(result));
        }
        public IActionResult DeleteMultiple(List <CustomsDeclarationModel> listCustom)
        {
            foreach (var item in listCustom)
            {
                if (item.JobNo != null)
                {
                    return(BadRequest());
                }
            }

            var          hs      = customsDeclarationService.DeleteMultiple(listCustom);
            var          message = HandleError.GetMessage(hs, Crud.Delete);
            ResultHandle result;

            if (hs.Success)
            {
                result = new ResultHandle {
                    Status = hs.Success, Message = stringLocalizer[message].Value
                };
            }
            result = new ResultHandle {
                Status = hs.Success, Message = message
            };
            return(Ok(result));
        }
Ejemplo n.º 18
0
        public IActionResult Update(CsTransactionDetailModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var checkExistMessage = CheckExist(model);

            if (checkExistMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = checkExistMessage
                }));
            }
            CultureInfo  currentCulture = Thread.CurrentThread.CurrentCulture;
            var          hs             = csTransactionDetailService.UpdateTransactionDetail(model);
            var          message        = HandleError.GetMessage(hs, Crud.Update);
            ResultHandle result         = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 19
0
        public IActionResult Add(CsTransactionDetailModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            var checkExistMessage = CheckExist(model);

            if (checkExistMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = checkExistMessage
                }));
            }
            var          hs      = csTransactionDetailService.AddTransactionDetail(model);
            var          message = HandleError.GetMessage(hs, Crud.Insert);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value, Data = model.Id
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Add(OpsStageAssignedEditModel model)
        {
            string message = string.Empty;

            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            if (opsStageAssignedService.Any(x => x.JobId == model.JobId && x.StageId == model.StageId && x.MainPersonInCharge == model.MainPersonInCharge))
            {
                message = stringLocalizer[OperationLanguageSub.MSG_STAGE_ASSIGNED_EXISTED].Value;
                return(BadRequest(new ResultHandle {
                    Status = false, Message = message
                }));
            }
            var hs = opsStageAssignedService.Add(model);

            message = HandleError.GetMessage(hs, Crud.Insert);
            ResultHandle result = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 21
0
        public IActionResult Post(CatCommodityGroupEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var checkExistMessage = CheckExist(0, model);

            if (checkExistMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = checkExistMessage
                }));
            }
            var catCommodityGroup = mapper.Map <CatCommodityGroupModel>(model);

            catCommodityGroup.UserCreated     = currentUser.UserID;
            catCommodityGroup.DatetimeCreated = catCommodityGroup.DatetimeModified = DateTime.Now;
            catCommodityGroup.Active          = true;
            var          hs      = catComonityGroupService.Add(catCommodityGroup);
            var          message = HandleError.GetMessage(hs, Crud.Insert);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            catComonityGroupService.ClearCache();
            catComonityGroupService.Get();
            return(Ok(result));
        }
        public IActionResult Post(CatSaleManEditModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            string messageDuplicate = string.Empty;
            bool   checkExist       = catSaleManService.Any(x => x.Service == model.Service && x.Office == model.Office && x.PartnerId == model.PartnerId);

            if (checkExist)
            {
                messageDuplicate = stringLocalizer[LanguageSub.MSG_OBJECT_DUPLICATED].Value;
                return(BadRequest(new ResultHandle {
                    Status = false, Message = messageDuplicate
                }));
            }
            var          saleman = mapper.Map <CatSaleManModel>(model);
            var          hs      = catSaleManService.Add(saleman);
            var          message = HandleError.GetMessage(hs, Crud.Insert);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Update(CustomsDeclarationModel model)
        {
            ICurrentUser _user = PermissionExtention.GetUserMenuPermission(currentUser, Menu.opsCustomClearance);
            var          code  = CheckForbitUpdate(_user.UserMenuPermission.Write);

            if (code == 403)
            {
                return(Forbid());
            }
            var existedMessage = CheckExist(model, model.Id);

            if (existedMessage != null)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = existedMessage
                }));
            }
            var          hs      = customsDeclarationService.Update(model, x => x.Id == model.Id);
            var          message = HandleError.GetMessage(hs, Crud.Update);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
Ejemplo n.º 24
0
        public IActionResult Delete(string id)
        {
            //var item = sysUserService.Get(x => x.Id == id).FirstOrDefault();
            //if (item.Active == true)
            //{
            //    return BadRequest(new ResultHandle { Status = false, Message = stringLocalizer[LanguageSub.MSG_ITEM_IS_ACTIVE_NOT_ALLOW_DELETED].Value });
            //}
            //item.Active = false;
            if (sysUserLevelService.Any(x => x.UserId == id))
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = stringLocalizer[SystemLanguageSub.MSG_ITEM_IS_ACTIVE_NOT_ALLOW_DELETED].Value
                }));
            }
            var user     = sysUserService.Get(x => x.Id == id).FirstOrDefault();
            var employee = sysEmployeeService.Get(x => x.Id == user.EmployeeId).FirstOrDefault();

            if (employee != null)
            {
                var hsEmployee = sysEmployeeService.Delete(x => x.Id == employee.Id, true);
            }
            var          hs      = sysUserService.Delete(id);
            var          message = HandleError.GetMessage(hs, Crud.Delete);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Add([FromBody] List <CsShipmentSurchargeModel> list)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            var query = list.Where(x => !string.IsNullOrEmpty(x.InvoiceNo)).GroupBy(x => new { x.InvoiceNo, x.ChargeId })
                        .Where(g => g.Count() > 1)
                        .Select(y => y.Key);

            if (query.Any())
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = stringLocalizer[DocumentationLanguageSub.MSG_SURCHARGE_ARE_DUPLICATE_INVOICE].Value
                }));
            }
            var          hs      = csShipmentSurchargeService.AddAndUpate(list);
            var          message = HandleError.GetMessage(hs, Crud.Update);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult CheckAllowConvertJob([FromBody] List <OpsTransactionClearanceModel> list)
        {
            currentUser = PermissionExtention.GetUserMenuPermission(currentUser, Menu.opsCustomClearance);
            var          hs      = transactionService.CheckAllowConvertJob(list);
            var          message = HandleError.GetMessage(hs, Crud.Update);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = message
            };

            return(Ok(result));
        }
Ejemplo n.º 27
0
        public IActionResult Add(SysUserModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }
            model.Password = SystemConstants.Password;
            model.Password = BCrypt.Net.BCrypt.HashPassword(model.Password);
            var existedMessage = CheckExistCode(model.SysEmployeeModel.StaffCode, "0");
            var existedName    = CheckExistUserName(model.Username, "0");

            if (existedMessage.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = existedMessage
                }));
            }
            if (existedName.Length > 0)
            {
                return(BadRequest(new ResultHandle {
                    Status = false, Message = existedName
                }));
            }
            model.SysEmployeeModel.Active = true;
            model.SysEmployeeModel.Id     = Guid.NewGuid().ToString();
            var          hsEmloyee       = sysEmployeeService.Insert(model.SysEmployeeModel);
            var          messageEmployee = HandleError.GetMessage(hsEmloyee, Crud.Insert);
            ResultHandle resultEmployee  = new ResultHandle {
                Status = hsEmloyee.Success, Message = stringLocalizer[messageEmployee].Value
            };

            if (hsEmloyee.Success)
            {
                model.EmployeeId      = model.SysEmployeeModel.Id;
                model.UserCreated     = model.UserModified = currentUser.UserID;
                model.Id              = Guid.NewGuid().ToString();
                model.DatetimeCreated = model.DatetimeModified = DateTime.Now;
                var hs      = sysUserService.Insert(model);
                var message = HandleError.GetMessage(hs, Crud.Insert);

                ResultHandle result = new ResultHandle {
                    Status = hs.Success, Message = stringLocalizer[message].Value, Data = model.Id
                };
                if (!hs.Success)
                {
                    return(BadRequest(result));
                }
                return(Ok(result));
            }
            else
            {
                return(BadRequest(resultEmployee));
            }
        }
        public IActionResult Delete(Guid chargId)
        {
            var          hs      = csShipmentSurchargeService.DeleteCharge(chargId);
            var          message = HandleError.GetMessage(hs, Crud.Delete);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult RemoveExchangeCurrency(string currencyFrom)
        {
            var          hs      = catCurrencyExchangeService.RemoveExchangeCurrency(currencyFrom, currentUser.UserID);
            var          message = HandleError.GetMessage(hs, Crud.Delete);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }
        public IActionResult Delete(int id)
        {
            var          hs      = catCurrencyExchangeService.Delete(x => x.Id == id);
            var          message = HandleError.GetMessage(hs, Crud.Delete);
            ResultHandle result  = new ResultHandle {
                Status = hs.Success, Message = stringLocalizer[message].Value
            };

            if (!hs.Success)
            {
                return(BadRequest(result));
            }
            return(Ok(result));
        }