public void createTransfer() { Funds funds = new Funds(); funds.SendAmount = 10; funds.SendCurrency = 810; funds.ReceiveAmount = 20; funds.ReceiveCurrency = 840; funds.Rate = 2; Models.Remittance _newRemittance = new Remittance(); _newRemittance.c_status_id = 1; _newRemittance.Code = "---"; _newRemittance.Receiver_id = 1; _newRemittance.Sender_id = 1; _newRemittance.lstFunds = new LinkedList <Funds>(); _newRemittance.lstFunds.AddFirst(funds); ResultRemittance resultOfCreateTransfer; if (_newRemittance == null) { resultOfCreateTransfer = new ResultRemittance(); resultOfCreateTransfer.code = -1; resultOfCreateTransfer.error = "Нет параметров для создания"; //return resultOfCreateTransfer; } ManagerTransfer transfer = new ManagerTransfer(); resultOfCreateTransfer = transfer.createNewTransfer(_newRemittance); //return resultOfCreateTransfer; }
ListViewItem AppendItemToList(Funds item, int index = -1) { ListView listView = listView1; ListViewItem listViewItem = null; if (index == -1) { listViewItem = listView.Items.Add("id_" + item.Id, item.Name, -1); listViewItem.SubItems.Add(item.Money.ToString()); listViewItem.SubItems.Add(item.Order.ToString()); listViewItem.SubItems.Add(item.IsBank ? (item.BankName + "," + item.CardNumber):""); if (!item.IsBank) { listViewItem.ForeColor = System.Drawing.Color.Blue; } } else { listViewItem = listView.Items[index]; listViewItem.Text = item.Name; listViewItem.SubItems[1].Text = item.Money.ToString(); listViewItem.SubItems[2].Text = item.Order.ToString(); listViewItem.SubItems[3].Text = item.IsBank ? (item.BankName + "," + item.CardNumber) : ""; } listViewItem.Tag = item; return(listViewItem); }
public async Task <ActionResult <Funds> > PostFunds(Funds funds) { _context.Funds.Add(funds); await _context.SaveChangesAsync(); return(CreatedAtAction("GetFunds", new { id = funds.FundId }, funds)); }
private async Task LoadFundData() { if (Constants.isFundLoaded) { goto ReflectValue; } Constants.isFundLoaded = true; Funds.Clear(); var funds = await _fundStore.GetFundsByUserId(Constants.curUserId); foreach (Fund fund in funds) { Funds.Add(new FundViewModel(fund)); } ReflectValue: if (Funds.Count != 0) { MyFundValue = Funds.Where(x => x.UserId == Constants.curUserId).Sum(x => x.Amount); } Constants.myTotalFund = (MyFundValue != 0) ? MyFundValue : 0; if (Constants.myTotalExpense != 0) { MyBalanceValue = MyFundValue - MyExpenseValue; } }
public async Task <ActionResult> FundDetailsPost(Funds _fundDetails) { var result = await new AzureCosmosDB <Funds>().Init(CollectionName.Funds); result.InsertFundDocuments(_fundDetails); return(View()); }
public ActionResult DeleteConfirmed(int id) { Funds funds = db.Funds.Find(id); db.Funds.Remove(funds); db.SaveChanges(); return(RedirectToAction("Index")); }
private void btnMovePrev_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count == 0) { Symbol.Forms.ProgramHelper.ShowInformation("请任意选中一行!"); return; } Funds item = listView1.SelectedItems[0].Tag as Funds; }
public JsonResult SaveFunds(Funds NewFunds) { _Context = new ApplicationDbContext(); _Context.Fundses.Add(NewFunds); _Context.SaveChanges(); return(new JsonResult()); }
public ActionResult Edit([Bind(Include = "FundId,DailyFunds,WeeklyFunds,MonthlyFunds,QuarterlyFunds,YearlyFunds")] Funds funds) { if (ModelState.IsValid) { db.Entry(funds).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(funds)); }
private void OnFundUpdated(FundDetailViewModel source, Fund fund) { var FundInList = Funds.Single(c => c.Id == fund.Id); FundInList.Id = fund.Id; FundInList.Amount = fund.Amount; FundInList.Source = fund.Source; FundInList.LastUpdateDate = fund.LastUpdateDate; FundInList.UserId = fund.UserId; }
public Form1() { InitializeComponent(); button14.Visible = false; dealer = new Hand("Dealer"); //initializes dealer hand player = new Hand("Player"); //initializes player hand this.Size = new Size(1100, 700); //sets the size of the playing space Button1.AutoSize = true; money = new Funds(funds); label19.Text = funds.ToString(); }
public ActionResult Create([Bind(Include = "FundId,DailyFunds,WeeklyFunds,MonthlyFunds,QuarterlyFunds,YearlyFunds")] Funds funds) { if (ModelState.IsValid) { db.Funds.Add(funds); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(funds)); }
private async Task DeleteFund(FundViewModel fundViewModel) { if (await _pageService.DisplayAlert("Warning", $"Are you sure you want to delete {fundViewModel.Source} : {fundViewModel.Amount}?", "YES", "NO")) { Funds.Remove(fundViewModel); var fund = await _fundStore.GetFund(fundViewModel.Id); await _fundStore.DeleteFund(fund); } }
protected virtual void draw_info(SpriteBatch sprite_batch) { // Labels InfoLabel.draw(sprite_batch); // Data //AvgRating.draw(sprite_batch); //Debug //EnemyAvgRating.draw(sprite_batch); AvgLvl.draw(sprite_batch); EnemyAvgLvl.draw(sprite_batch); Funds.draw(sprite_batch); Counter.draw(sprite_batch); }
public void AllFundsView() { Funds funds = _fundsService.GetAllFunds(); System.Console.WriteLine(); System.Console.WriteLine($"Stan funduszu wydatków nieregularnych (FWN): {funds.IrregularExpensesFund.Balance}"); System.Console.WriteLine($"Stan funduszu awaryjnego (FA): {funds.EmergencyFund.Balance}"); System.Console.WriteLine($"Stan funduszu bezpieczeństwa (FB): {funds.SecurityFund.Balance}"); System.Console.WriteLine($"Cel funduszu celowego: {funds.SpecialPurposeFund.Description}"); System.Console.WriteLine($"Stan funduszu celowego: {funds.SpecialPurposeFund.Balance}"); System.Console.WriteLine(); }
public override void OnActionExecuting(ActionExecutingContext filterContext) { Logger.Trace("OnActionExecuting"); var fundId = filterContext.ActionParameters["id"].ToString() .ToNullableInt32(); var fund = Funds.GetById(fundId.Value) .FirstOrDefault(); filterContext.Controller.ViewBag.FundContext = fund; }
private void ButtonShift_Click(object sender, RoutedEventArgs e) { if (FundClassifys.SelectedItem == null) { return; } var fundClassify = (FundClassify)FundClassifys.SelectedItem; if ((fundClassify.FundClassify1 != "课题组报支") && (fundClassify.FundClassify1 != "管理费")) { return; } if (dataGridFund.SelectedItem == null) { return; } if (dataContent == null) { dataContent = new DataClassesProjectClassifyDataContext(); } try { var contractFunds = (ContractFunds)dataGridFund.SelectedItem; var contract = dataContent.ProjectContracts.FirstOrDefault(c => c.ContractNo.Equals(contractFunds.ContractNo)); if (contract == null) { return; } var funds = new Funds { ContractNo = contractFunds.ContractNo, FundClassifyID = contractFunds.FundClassifyID, Date = contractFunds.Date, Handled = contractFunds.Handled, Money = contractFunds.Money, Source = contractFunds.Source, SubPrincipal = contractFunds.SubPrincipal }; dataContent.Funds.InsertOnSubmit(funds); dataContent.ContractFunds.DeleteOnSubmit(contractFunds); dataContent.SubmitChanges(); dataContent = new DataClassesProjectClassifyDataContext(); dataGridFund.DataContext = dataContent.ContractFunds.Where(f => f.ProjectContracts.ProjectID.Equals(ProjectID)).OrderBy(f => f.Date); SetTotalMoney(); } catch (Exception) { throw; } }
private void draw_gameplay_data(SpriteBatch sprite_batch, Vector2 offset) { // Turns/Funds panel sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); Game_Data_Window.draw(sprite_batch, offset); Turn_Label.draw(sprite_batch, offset); Funds_Label.draw(sprite_batch, offset); Gold_G.draw(sprite_batch, offset); Turn.draw(sprite_batch, offset); Funds.draw(sprite_batch, offset); Counter.draw(sprite_batch, offset); sprite_batch.End(); }
public Funds() { if (instance != null) { Debug.LogError("Попытка создать еще второй экземпляр Game на сцене"); instance = null; } instance = this; money = new Money(0, 0); ProductsController.Instance.ProductCreated += OnProductCreated; }
void OnEditClick() { if (listView1.SelectedItems.Count == 0) { Symbol.Forms.ProgramHelper.ShowInformation("请任意选中一行!"); return; } Funds item = listView1.SelectedItems[0].Tag as Funds; if (ShowEdit(this, item)) { FillList(); } }
// GET: FundsManager/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Funds funds = db.Funds.Find(id); if (funds == null) { return(HttpNotFound()); } return(View(funds)); }
public int ContributionCount(int days, object funds) { var f = new Funds(funds); var dt = DateTime.Now.AddDays(-days); var typs = new[] { 6, 7 }; var q = from c in db.Contributions where c.ContributionStatusId == ContributionStatusCode.Recorded where c.ContributionDate >= dt where c.ContributionTypeId != ContributionTypeCode.Pledge where f.Fundids.Count == 0 || f.Fundids.Contains(c.FundId) where f.ExFundIds.Count == 0 || !f.ExFundIds.Contains(c.FundId) where !typs.Contains(c.ContributionTypeId) select c; return q.Count(); }
public void TestFundsCRUD() { List<Funds> list = Funds.Query(); long count = list.Count; Funds fs = new Funds(); fs.Name = "test"; fs.Save(); Assert.IsTrue(fs.ID > 0); list = Funds.Query(); Assert.IsTrue(count + 1 == list.Count); Funds.Delete(fs.ID); list = Funds.Query(); Assert.IsTrue(count == list.Count); }
public double ContributionTotals(int days1, int days2, object funds) { var f = new Funds(funds); var dt1 = DateTime.Today.AddDays(-days1); var dt2 = DateTime.Today.AddDays(-days2); var typs = new[] { 6, 7 }; var q = from c in db.Contributions where c.ContributionStatusId == ContributionStatusCode.Recorded where c.ContributionDate.Value.Date >= dt1.Date where days2 == 0 || c.ContributionDate.Value.Date <= dt2.Date where c.ContributionTypeId != ContributionTypeCode.Pledge where f.Fundids.Count == 0 || f.Fundids.Contains(c.FundId) where f.ExFundIds.Count == 0 || !f.ExFundIds.Contains(c.FundId) where !typs.Contains(c.ContributionTypeId) select c; foreach(var c in q) Debug.WriteLine(c.ContributionId); return Convert.ToDouble(q.Sum(c => c.ContributionAmount) ?? 0); }
private void MyRefresh() { if (m_funds != null) { if (MessageBox.Show("刷新会导致当前的操作的数据丢失,是否要继续?", "注意", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.No) { return; } } m_funds = null; setWinStatus(winStatusEnum.查看); initTree(); ShowFunds2Grid(); }
private void tsbNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { m_funds = new Funds(); m_fundses.Add(m_funds); gridControl1.DataSource = null; gridControl1.DataSource = m_fundses; gridView1.OptionsBehavior.Editable = true; setWinStatus(winStatusEnum.新增); }
private void tsbEdit_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (gridView1.FocusedRowHandle < 0) return; // 找到要编辑的银行 long id = long.Parse(gridView1.GetRowCellValue(gridView1.FocusedRowHandle, "ID").ToString()); foreach (Funds bk in m_fundses) { if (bk.ID == id) m_funds = bk; } gridView1.OptionsBehavior.Editable = true; setWinStatus(winStatusEnum.编辑); }
private void tsbSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { // 更新数据 gridView1.CloseEditor(); gridView1.UpdateCurrentRow(); if (!m_funds.InsertUpdateVerify()) { MessageBox.Show(m_funds.ErrorString, "出错了!", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } m_funds.Save(); m_funds = null; gridView1.OptionsBehavior.Editable = false; setWinStatus(winStatusEnum.查看); }