Example #1
0
        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;
        }
Example #2
0
        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);
        }
Example #3
0
        public async Task <ActionResult <Funds> > PostFunds(Funds funds)
        {
            _context.Funds.Add(funds);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetFunds", new { id = funds.FundId }, funds));
        }
Example #4
0
        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"));
        }
Example #7
0
 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));
 }
Example #10
0
        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;
        }
Example #11
0
 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));
        }
Example #13
0
        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);
            }
        }
Example #14
0
 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);
 }
Example #15
0
        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();
        }
Example #16
0
        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;
        }
Example #17
0
        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;
            }
        }
Example #18
0
 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();
 }
Example #19
0
    public Funds()
    {
        if (instance != null)
        {
            Debug.LogError("Попытка создать еще второй экземпляр Game на сцене");
            instance = null;
        }
        instance = this;

        money = new Money(0, 0);

        ProductsController.Instance.ProductCreated += OnProductCreated;
    }
Example #20
0
        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();
            }
        }
Example #21
0
        // 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));
        }
Example #22
0
 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();
 }
Example #23
0
        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);
        }
Example #24
0
        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);
        }
Example #25
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();
 }
Example #26
0
        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.新增);
        }
Example #27
0
        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.编辑);
        }
Example #28
0
        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.查看);
        }