public ActionResult GetDatabyPeriod(long periodId) { PaymentViewModel model = new PaymentViewModel(); SessionHelper.Calendar = CalendarHelper.GetCalendar(PayablePeriodHelper.GetPayablePeriod(periodId.ToString()).CalendarId.ToString()); if (model.Vendor == null) { model.Vendor = VendorHelper.GetVendorList(SessionHelper.Calendar.StartDate, SessionHelper.Calendar.EndDate); model.VendorId = model.Vendor.Any() ? Convert.ToInt32(model.Vendor.First().Value) : 0; if (model.VendorId > 0) { model.VendorSite = VendorHelper.GetVendorSiteList(model.VendorId); model.VendorSiteId = model.VendorSite.Any() ? Convert.ToInt64(model.VendorSite.First().Value) : 0; } } if (model.Bank == null) { model.Bank = BankHelper.GetBankList(model.SOBId); model.BankId = model.Bank.Any() ? Convert.ToInt32(model.Bank.First().Value) : 0; if (model.BankId > 0) { model.BankAccount = BankHelper.GetBankAccountList(model.BankId); model.BankAccountId = model.BankAccount.Any() ? Convert.ToInt64(model.BankAccount.First().Value) : 0; } } return(Json(model, JsonRequestBehavior.AllowGet)); }
public ActionResult Edit(string id) { PaymentViewModel model = PaymentHelper.GetPayment(id); SessionHelper.PeriodId = model.PeriodId; SessionHelper.Calendar = CalendarHelper.GetCalendar(PayablePeriodHelper.GetPayablePeriod(model.PeriodId.ToString()).CalendarId.ToString()); if (model.BankAccount == null) { model.BankAccount = BankHelper.GetBankAccountList(model.BankId); model.BankAccountId = model.BankAccount.Any() ? Convert.ToInt32(model.BankAccount.First().Value) : 0; } if (model.VendorSite == null) { model.VendorSite = VendorHelper.GetAllSites(model.VendorId) .Select(x => new SelectListItem { Text = x.Name, Value = x.Id.ToString() }).ToList(); model.VendorSiteId = model.VendorSite.Any() ? Convert.ToInt32(model.VendorSite.First().Value) : 0; } model.PaymentInvoiceLines = PaymentHelper.GetPaymentLines(id).ToList(); model.SOBId = SessionHelper.SOBId; SessionHelper.Payment = model; return(View("Create", model)); }
public ActionResult Edit(string id) { ReceiptViewModel model = ReceiptHelper.GetReceipt(id); if (model.CustomerSites == null) { model.CustomerSites = CustomerHelper.GetCustomerSites(model.CustomerId).Select(a => new SelectListItem { Text = a.SiteName.ToString(), Value = a.Id.ToString() }).ToList(); } if (model.Banks == null) { model.Banks = BankHelper.GetBankList(model.SOBId); } if (model.BankAccounts == null) { model.BankAccounts = BankHelper.GetBankAccountList(model.BankId); } SessionHelper.Calendar = CalendarHelper.GetCalendar(model.PeriodId.ToString()); SessionHelper.PrecisionLimit = CurrencyHelper.GetCurrency(model.CurrencyId.ToString()).Precision; return(View("Create", model)); }
public void AtmWithdrawMoney(IPlayer player, int amount) { //int amount = (int)(long)args[0]; BankHelper.WithdrawFromBank(player, amount); player.SendNativeNotify(null, NotificationNativeType.Bank, 1, "Przyjęto wypłatę", "~g~ Bank Los Santos", $"Twoja wypłata {amount}$ została przyjęta poprawnie"); }
private BankHelper GetHelper(Bank Bank) { var helper = new BankHelper(Bank); helper.ServiceUserId = GetUserId(); return(helper); }
private BankHelper GetHelper(int BankId) { BankHelper helper = new BankHelper(BankId); helper.ServiceUserId = GetUserId(); return(helper); }
public void PayCredit(double amount) { if (!BankHelper.CheckDebt(Debt, amount)) { throw new PaymentException("Amount is greater than debt.!"); } Debt -= amount; }
public ActionResult Edit(BankModel model) { if (ModelState.IsValid) { string result = BankHelper.SaveBank(model); return(RedirectToAction("Index")); } return(View(model)); }
static void Main(string[] args) { Driver driver = new Driver(Environments.Staging); BankHelper bankHelper = new BankHelper(); string response = bankHelper.AllBanks(driver).Result; Console.WriteLine(response); Console.ReadKey(); }
public void OnPlayerAtmTakeHandler(Client sender, params object[] arguments) { if (decimal.TryParse(arguments[0].ToString(), out decimal money)) { ChatScript.SendMessageToNearbyPlayers(sender.GetAccountEntity().CharacterEntity, $"wkłada {(money >= 3000 ? "gruby" : "chudy")} plik gotówki do bankomatu i po przetworzeniu operacji zabiera kartę.", ChatMessageType.ServerMe); BankHelper.DepositMoney(sender, money); } }
public void OnPlayerAtmGiveHandler(Client sender, params object[] arguments) { if (decimal.TryParse(arguments[0].ToString(), out decimal money)) { ChatScript.SendMessageToNearbyPlayers(sender.GetAccountEntity().CharacterEntity, $"wyciąga z bankomatu {(money >= 3000 ? "gruby" : "chudy")} plik gotówki, oraz kartę.", ChatMessageType.ServerMe); BankHelper.WithdrawMoney(sender, money); } }
public void Organize(Worker[] workers) { if (workers == null) { throw new NotEmployeeException("There is no workers!"); } Console.WriteLine($"Employees on the list must be in the CEO’s meeting room at {DateTime.Now.AddHours(1)} p.m."); BankHelper.PrintWorkers(workers); }
public ActionResult CashToBank() { ViewBag.CashBalance = AccountingRptHelper.GetBankCashRpt().Where(a => a.AccountId == "194").ToList(); ViewBag.BankList = BankHelper.GetAllBankAndAccountList(); CashBankTransferVm currVm = new CashBankTransferVm(); currVm.IsCashToBank = true; currVm.Notes = "Cash To Bank "; return(View(currVm)); }
public void ChangePercentage(double percent, Bank bank) { var newBankPercent = bank.Percentage + percent; if (!BankHelper.CheckBankPercentage(newBankPercent)) { throw new BankPercentException(newBankPercent); } bank.Percentage = newBankPercent; }
public void GiveCredit(Credit credit) { if (!BankHelper.CheckBankBudget(credit.Amount, Budget)) { throw new NotEnoughMoneyException("There is not enough money in the bank!"); } credit.CalculatePayment(); Budget -= credit.Amount; Credits.Add(credit); }
public ActionResult Delete(string id) { try { BankHelper.Delete(id); return(RedirectToAction("Index")); } catch (Exception ex) { return(RedirectToAction("Index", new { message = ex.Message })); } }
public ActionResult Create(long bankId) { BankAccountViewModel bankAccount = new BankAccountViewModel(); if (bankAccount.CodeCombinition == null) { BankModel bank = BankHelper.GetBank(bankId.ToString()); bankAccount.CodeCombinition = CodeCombinationHelper.GetAccounts(SessionHelper.SOBId, bank.StartDate, bank.EndDate).ToList(); } bankAccount.BankId = bankId; return(View(bankAccount)); }
public ActionResult Delete(string id, long bankId) { try { BankHelper.DeleteBankAccount(id); return(RedirectToAction("Index", new { Id = bankId })); } catch (Exception ex) { return(RedirectToAction("Index", new { Id = bankId, message = ex.Message })); } }
public ActionResult BankToCash() { var accountRpt = AccountingRptHelper.GetBankCashRpt().Where(a => a.AccountId != "194").ToList(); ViewBag.CashBalance = accountRpt; ViewBag.BankList = BankHelper.GetAllBankAndAccountList();//.Where(a => accountRpt.Any(s=>s.AccountId == a.AccountId)).ToList(); CashBankTransferVm currVm = new CashBankTransferVm(); currVm.IsCashToBank = false; currVm.Notes = "Bank To Cash "; return(View(currVm)); }
public void MakeMeeting(Worker[] workers) { if (workers == null) { throw new NotEmployeeException("There is no workers!"); } Console.ForegroundColor = ConsoleColor.Blue; Console.WriteLine("Meeting created."); Console.ResetColor(); Console.WriteLine("Participants: "); BankHelper.PrintWorkers(workers); }
public ActionResult Create(long periodId, long customerId, long currencyId) { ReceiptViewModel receipt = new ReceiptViewModel(); SessionHelper.Calendar = CalendarHelper.GetCalendar(ReceivablePeriodHelper.GetReceivablePeriod(periodId.ToString()).CalendarId.ToString()); receipt.PeriodId = SessionHelper.Calendar.Id; receipt.SOBId = SessionHelper.SOBId; receipt.CustomerId = customerId; receipt.CurrencyId = currencyId; receipt.ConversionRate = 1; receipt.ReceiptDate = SessionHelper.Calendar.StartDate; SessionHelper.PrecisionLimit = CurrencyHelper.GetCurrency(currencyId.ToString()).Precision; if (receipt.CustomerSites == null) { receipt.CustomerSites = CustomerHelper.GetCustomerSites(receipt.CustomerId).Select(a => new SelectListItem { Text = a.SiteName.ToString(), Value = a.Id.ToString() }).ToList(); } else { receipt.CustomerSites = new List <SelectListItem>(); } if (receipt.Banks == null) { receipt.Banks = BankHelper.GetBankList(receipt.SOBId); } else { receipt.Banks = new List <SelectListItem>(); } receipt.BankId = receipt.Banks.Count() > 0 ? Convert.ToInt64(receipt.Banks.FirstOrDefault().Value) : 0; if (receipt.BankAccounts == null) { receipt.BankAccounts = BankHelper.GetBankAccountList(receipt.BankId); } else { receipt.BankAccounts = new List <SelectListItem>(); } return(View(receipt)); }
public ActionResult DeleteBank(int id) { #region Check Rights bool hasRights = false; hasRights = AdminHelper.CheckUserAction(ScreenEnum.Bank, ActionEnum.Delete); if (!hasRights) { return(Json("You are UnAuthorized to do this action")); } #endregion string isDeleted = BankHelper.DeleteBank(id); return(Json(isDeleted)); }
public async Task <Result> List() { var userId = HttpContext.GetUserId(); var bankCards = await _bankCardRepository.Query().Where(e => e.CustomerId == userId).ToListAsync(); var responses = _mapper.Map <List <BankCardResponse> >(bankCards); foreach (var item in responses) { item.BankNo = Regex.Replace(item.BankNo, @"(\w{4})\d{10}(\w{4})", "$1*****$2"); item.BankName = BankHelper.GetBankName(item.BankCode); } return(Result.Ok(responses)); }
public ResponseModel GetCurrencies() { try { XmlTextReader rdr = new XmlTextReader(Url); XmlDocument myxml = new XmlDocument(); myxml.Load(rdr); var result = BankHelper.Deserialize <ResponseModel>(myxml.OuterXml); return(result); } catch { throw; } }
public ActionResult Edit(string remitNo, long bankId, long bankAccountId) { RemittanceModel model = RemittanceHelper.GetRemittance(remitNo); SessionHelper.Bank = BankHelper.GetBank(bankId.ToString()); SessionHelper.BankAccount = BankHelper.GetBankAccount(bankAccountId); model.Remittances = RemittanceHelper.GetRemittanceDetail(remitNo); model.SOBId = SessionHelper.SOBId; model.BankId = bankId; model.BankAccountId = bankAccountId; SessionHelper.DocumentDate = model.RemitDate; SessionHelper.Remittance = model; return(View(model)); }
public ActionResult BankToCash(CashBankTransferVm currVm) { var currentBalance = AccountingRptHelper.GetBankCashRpt().Where(a => a.AccountId == currVm.AccountId).FirstOrDefault(); if (currentBalance == null) { return(Json("Sorry there is no balance in the selected bank ")); } var bankAcc = BankHelper.GetBankAccountInfo(currVm.BankAccId); bool isvalid = true; if (bankAcc.CurrencyId == currVm.CurrentCurrencyId) { if (currVm.CurrentCurrencyId == 1) { isvalid = currVm.CurrentAmount <= currentBalance.EGP ? true : false; } if (currVm.CurrentCurrencyId == 2) { isvalid = currVm.CurrentAmount <= currentBalance.USD ? true : false; } if (currVm.CurrentCurrencyId == 3) { isvalid = currVm.CurrentAmount <= currentBalance.EUR ? true : false; } if (currVm.CurrentCurrencyId == 4) { isvalid = currVm.CurrentAmount <= currentBalance.GBP ? true : false; } if (!isvalid) { return(Json("Sorry the Transfear amount must be equal or less to current balance")); } else { string result = CashMovementHelper.SaveTransfer(currVm); return(Json(result)); } } else { return(Json("Sorry the transfear currency must be match the bank account")); } }
public JsonResult CheckEndDate(DateTime endDate, long bankId) { bool returnData = true; if (bankId > 0) { BankModel bank = BankHelper.GetBank(bankId.ToString()); if (endDate <= bank.EndDate) { returnData = true; } else { returnData = false; } } return(Json(returnData)); }
public ActionResult Edit(string id) { BankAccountViewModel model = BankHelper.GetBankAccount(id); CodeCombinitionCreateViewModel cashCode = CodeCombinationHelper.GetCodeCombination(model.Cash_CCID.ToString()); CodeCombinitionCreateViewModel remitCode = CodeCombinationHelper.GetCodeCombination(model.RemitCash_CCID.ToString()); CodeCombinitionCreateViewModel confirmCode = CodeCombinationHelper.GetCodeCombination(model.Confirm_CCID.ToString()); model.Cash_CCIDString = Utility.Stringize(".", cashCode.Segment1, cashCode.Segment2, cashCode.Segment3, cashCode.Segment4, cashCode.Segment5, cashCode.Segment6, cashCode.Segment7, cashCode.Segment8); model.RemitCash_CCIDString = Utility.Stringize(".", remitCode.Segment1, remitCode.Segment2, remitCode.Segment3, remitCode.Segment4, remitCode.Segment5, remitCode.Segment6, remitCode.Segment7, remitCode.Segment8); model.Confirm_CCIDString = Utility.Stringize(".", confirmCode.Segment1, confirmCode.Segment2, confirmCode.Segment3, confirmCode.Segment4, confirmCode.Segment5, confirmCode.Segment6, confirmCode.Segment7, confirmCode.Segment8); //if (model.CodeCombinition == null) //{ // BankModel bank = BankHelper.GetBank(model.BankId.ToString()); // model.CodeCombinition = CodeCombinationHelper.GetAccounts(SessionHelper.SOBId, bank.StartDate, bank.EndDate).ToList(); //} return(View("Create", model)); }
public Guid GetAvailableItemLocker(Guid cabinetId, string userId, Guid itemType, string TradeId) { var targetCabinet = Cabinets.First(c => c.CabinetId == cabinetId); var targetCategory = targetCabinet.Categories.First(cat => cat.ItemType == itemType); if (targetCategory == null) { Logger.LogWarning($"No Available Category When Borrow, Cabinet Id :{targetCabinet.CabinetId}, Expect Item Type:{itemType}"); return(new Guid()); } var expectedAmount = targetCategory.Deposit; var paidAmount = BankHelper.CheckStatusAndAmount(TradeId); if (expectedAmount == paidAmount) { var lockerid = targetCabinet.Lockers.First(l => LockerHelper.IsLockerAvailable(l)).LockerId; targetCategory.AvailableLocker.Remove(lockerid); targetCategory.AvailableItem--; var id = Guid.NewGuid(); Logger.LogMessage($"Assigned Locker:Cabinet Id :{cabinetId}, Locker Id:{lockerid}, Generated Bill:{id}"); Bills.Add(new HiBoxBill() { BillId = id, BillType = Constants.BillType.Deposit, CabinetId = cabinetId, DisplayName = targetCategory.DisplayName, UserId = userId, ItemType = itemType, LockerId = lockerid, Rent = targetCategory.Rent }); Console.WriteLine("Opening Gate" + lockerid); return(id); } else { return(new Guid()); } }
public ActionResult Create(BankAccountViewModel model) { if (ModelState.IsValid) { string result = ""; BankModel bank = BankHelper.GetBank(model.BankId.ToString()); if ((model.StartDate >= bank.StartDate && model.EndDate <= bank.EndDate) || (model.StartDate == null && bank.StartDate == null || model.EndDate == null && bank.EndDate == null)) { result = BankHelper.SaveBankAccount(model); return(RedirectToAction("Index", new { Id = model.BankId })); } else { ModelState.AddModelError("Error", "Bank Account Dates should be within the range of Bank Dates."); } } return(View(model)); }