/// <summary> /// 获取所有页面的头部导航菜单 /// </summary> /// <returns></returns> public ActionResult GetHeader() { var account = Session["Account"] as AccountInfo; if (account != null) { if (account.IsAdmin) { var repairService = new RepairService(); ViewData["RepairUnFinishCount"] = repairService.GetUnFinishCount(); var adviceService = new AdviceService(); ViewData["AdviceUnReplyCount"] = adviceService.GetUnReplyCount(); } else { var feeService = new FeeService(); ViewData["FeeUnFinishCount"] = feeService.GetUnFinishCountForOwner(account.Id); var announService = new AnnouncementService(); ViewData["AnnounUnReadCount"] = announService.GetUnReadCountForOwner(account.Id); var ownerService = new OwnerService(); ViewData["NewReplyCount"] = ownerService.GetNewReplyCount(account.Id); } } return(PartialView("Header")); }
/// <summary> /// 所有购买信息 /// </summary> /// <returns></returns> public static IList <BuyInfo> GetAllBuyInfo() { return(new CacheUtility <IList <BuyInfo> >().Get(KEY_ALLBUYNINFO, delegate() { FeeService feeDal = new FeeService(); return feeDal.SelectAllBuy(); }, 60 * 12)); }
private void Save() { IFeeService feeService = new FeeService(); Boolean ret = false; string message = String.Empty; string dis = txtDiscount.Text.ToString(); float discount = (float.Parse(dis)) / 100f; Fee fee = new Fee() { NumPay = Int32.Parse(txtNumPay.Text), FeeDescription = txtDescription.Text, Amount = double.Parse(txtAmount.Text), SYImplemented = cmbSY.SelectedValue.ToString(), GradeLevel = cmbGradeLevel.SelectedValue.ToString(), DiscountFullPay = discount }; if (Op.Equals("new")) { if (ExistingFees.Exists(t => t.FeeDescription == fee.FeeDescription && t.GradeLevel == fee.GradeLevel && t.SYImplemented == fee.SYImplemented)) { MessageBox.Show(this, "Fee for the Grade Level already Exists", "Fee Exists"); } else { ret = feeService.CreateFee(ref fee, ref message); } Log("C", "Fees", fee); if (ret) { MessageBox.Show(this, "Saved Successfully"); } else { MessageBox.Show(this, "Error Saving"); } this.Close(); } else if (Op.Equals("edit")) { fee.FeeID = SelectedFee.FeeID; ret = feeService.UpdateFee(ref fee, ref message); Log("U", "Fees", fee); if (ret) { MessageBox.Show(this, "Saved Successfully"); } else { MessageBox.Show(this, "Error Saving"); } this.Close(); } }
public AcademicsController(InfrastructureService infraService, StudentService studentService, InquiryService inquiryService, InstitutionService institutionService, FeeService feeService, StudentProgramService studentprogramService) { this._infraService = infraService; this._studentService = studentService; this._inquiryService = inquiryService; this._institutionService = institutionService; this._feeService = feeService; this._studentprogramService = studentprogramService; }
public async Task CanCalculateFeeForTx() { var feePerByte = 100; var feeRateService = CreateFeeRateFacade(feePerByte); var feeFacade = new FeeService(feeRateService.Object, 100, 1000); var txBuilder = GetTestTx(NBitcoin.Altcoins.BGold.Instance.Testnet); await feeFacade.CalcFeeForTransaction(txBuilder.BuildTransaction(true)); }
public async Task CanCalculateFeeForTxBuilder() { var feePerByte = 100; var feeRateService = CreateFeeRateFacade(feePerByte); var feeFacade = new FeeService(feeRateService.Object); var txBuilder = GetTestTx(Network.RegTest); await feeFacade.CalcFeeForTransactionAsync(txBuilder); }
public async Task CanCalculateFeeForTx() { PrepareNetworks.EnsureVertcoinPrepared(); var feePerByte = 100; var feeRateService = CreateFeeRateFacade(feePerByte); var feeFacade = new FeeService(feeRateService.Object, 100, 1000); var txBuilder = GetTestTx(Network.RegTest); await feeFacade.CalcFeeForTransaction(txBuilder.BuildTransaction(true)); }
public async Task ReturnsFeeMaxValueIfCalculatedFeeBiggerThanMaxValue() { var feePerByte = 9999; var feeRateService = CreateFeeRateFacade(feePerByte); var feeMaxValue = 1000; var feeFacade = new FeeService(feeRateService.Object, 100, feeMaxValue); var txBuilder = GetTestTx(NBitcoin.Altcoins.BGold.Instance.Testnet); var fee = await feeFacade.CalcFeeForTransaction(txBuilder.BuildTransaction(true)); Assert.True(fee.Satoshi == feeMaxValue); }
public async Task ReturnsFeeMinValueIfCalculatedFeeLessThanMinValue() { var feePerByte = 1; var feeRateService = CreateFeeRateFacade(feePerByte); var feeMaxValue = 1000; var feeMinValue = 300; var feeFacade = new FeeService(feeRateService.Object, feeMinValue, feeMaxValue); var txBuilder = GetTestTx(Network.RegTest); var fee = await feeFacade.CalcFeeForTransaction(txBuilder.BuildTransaction(true)); Assert.True(fee.Satoshi == feeMinValue); }
private void LoadMe(object sender, EventArgs e) { IFeeService feeService = new FeeService(); gradeLevels = new List <GradeLevel>(feeService.GetAllGradeLevels()); schoolYears = new List <SchoolYear>(feeService.GetLastFiveSY()); cmbGradeLevel.DataSource = gradeLevels; cmbGradeLevel.ValueMember = "GradeLev"; cmbGradeLevel.DisplayMember = "Description"; cmbSY.DataSource = schoolYears; cmbSY.ValueMember = "SY"; cmbSY.DisplayMember = "SY"; }
public OpenpayAPI( string api_key, string merchant_id,bool production = false) { this.httpClient = new OpenpayHttpClient(api_key, merchant_id, production); CustomerService = new CustomerService(this.httpClient); CardService = new CardService(this.httpClient); BankAccountService = new BankAccountService(this.httpClient); ChargeService = new ChargeService(this.httpClient); PayoutService = new PayoutService(this.httpClient); TransferService = new TransferService(this.httpClient); FeeService = new FeeService(this.httpClient); PlanService = new PlanService(this.httpClient); SubscriptionService = new SubscriptionService(this.httpClient); OpenpayFeesService = new OpenpayFeesService(this.httpClient); WebhooksService = new WebhookService (this.httpClient); }
public async Task ReturnsFeeMaxValueIfCalculatedFeeBiggerThanMaxValue() { PrepareNetworks.EnsureVertcoinPrepared(); var feePerByte = 9999; var feeRateService = CreateFeeRateFacade(feePerByte); var feeMaxValue = 1000; var feeFacade = new FeeService(feeRateService.Object, 100, feeMaxValue); var txBuilder = GetTestTx(Network.RegTest); var fee = await feeFacade.CalcFeeForTransaction(txBuilder.BuildTransaction(true)); Assert.True(fee.Satoshi == feeMaxValue); }
public OpenpayAPI(string api_key, string merchant_id, bool production = false) { this.httpClient = new OpenpayHttpClient(api_key, merchant_id, production); CustomerService = new CustomerService(this.httpClient); CardService = new CardService(this.httpClient); BankAccountService = new BankAccountService(this.httpClient); ChargeService = new ChargeService(this.httpClient); PayoutService = new PayoutService(this.httpClient); TransferService = new TransferService(this.httpClient); FeeService = new FeeService(this.httpClient); PlanService = new PlanService(this.httpClient); SubscriptionService = new SubscriptionService(this.httpClient); OpenpayFeesService = new OpenpayFeesService(this.httpClient); WebhooksService = new WebhookService(this.httpClient); PayoutReportService = new PayoutReportService(this.httpClient); MerchantService = new MerchantService(this.httpClient); }
public ActionResult GetFeePage(int page = 1, int pageSize = 10, int feeItemId = 0, string beginDate = "", string endDate = "", int isFinish = 2) { var feeService = new FeeService(); var where = PredicateBuilder.True <Fee>(); var ownerId = (Session["Account"] as AccountInfo).Id; where = where.And(f => f.OwnerId == ownerId); if (feeItemId > 0) { where = where.And(f => f.FeeItemId == feeItemId); } if (!string.IsNullOrEmpty(beginDate)) { DateTime begin; if (DateTime.TryParse(beginDate, out begin)) { where = where.And(f => f.Date >= begin); } } if (!string.IsNullOrEmpty(endDate)) { DateTime end; if (DateTime.TryParse(endDate, out end)) { where = where.And(f => f.Date <= end); } } if (isFinish == 1) { where = where.And(f => f.FinishDate != null); } else if (isFinish == 0) { where = where.And(f => f.FinishDate == null); } return(Json(feeService.QueryToPageByOwner(where, page, pageSize))); }
private void LoadMe() { IFeeService feeService = new FeeService(); ExistingFees = new List <Fee>(feeService.GetAllFees()); gradeLevels = new List <GradeLevel>(feeService.GetAllGradeLevels()); schoolYears = new List <SchoolYear>(feeService.GetLastFiveSY()); cmbGradeLevel.DataSource = gradeLevels; cmbGradeLevel.ValueMember = "GradeLev"; cmbGradeLevel.DisplayMember = "Description"; cmbSY.DataSource = schoolYears; cmbSY.ValueMember = "SY"; cmbSY.DisplayMember = "SY"; txtAmount.Text = "0.00"; txtDescription.Text = String.Empty; txtDiscount.Text = "0"; txtNumPay.Text = "1"; }
public void LoadStudentFees() { IFeeService feeService = new FeeService(); string message = String.Empty; try { var fees = feeService.GetAllFees(); feeList = new List <Fee>(fees); gvFees.DataSource = feeList; gvFees.Refresh(); if (gvFees.RowCount != 0) { gvFees.Rows[0].IsSelected = true; } } catch (Exception ex) { message = "Error Loading Fees List"; MessageBox.Show(ex.ToString()); } }
public Fee Get(decimal InputAmount) { return(FeeService.GetFee(InputAmount)); }
public FinanceController(FeeService feeService, StudentProgramInvoiceService studentprogramInvoiceService, StudentProgramService studentprogramService) { this._feeService = feeService; this._studentprogramInvoiceService = studentprogramInvoiceService; this._studentprogramService = studentprogramService; }