public ActionResult Index()
        {
            ContributorsViewModel vm = new ContributorsViewModel();

            vm.Contributors = _mgr.GetContributors();
            vm.Date         = DateTime.Now.ToString("yyyy-MM-dd");
            return(View(vm));
        }
예제 #2
0
        public ActionResult Index()
        {
            ContributorsDB            CDB          = new ContributorsDB(Properties.Settings.Default.ConStr);
            ContributorsViewModel     cvm          = new ContributorsViewModel();
            IEnumerable <Contributor> contributors = CDB.GetAllContributors();

            cvm.Contributors = ContributorToContributorPlus(contributors);
            return(View(cvm));
        }
예제 #3
0
        public ActionResult Contributors()
        {
            ContributorsViewModel cvm = new ContributorsViewModel();
            SimchaDb db = new SimchaDb(Properties.Settings.Default.ConStr);

            cvm.Contributors = db.GetContributors();
            cvm.Balance      = db.GetTotalBalance();
            return(View(cvm));
        }
예제 #4
0
        public ActionResult List(int SimchaId)
        {
            SimchasDB             SDB = new SimchasDB(Properties.Settings.Default.ConStr);
            ContributorsViewModel cvm = new ContributorsViewModel();

            cvm.Contributors = ContributorToContributorPlus(SDB.GetContributorsForSimcha(SimchaId));
            cvm.Simcha       = SDB.GetById(SimchaId);
            return(View(cvm));
        }
예제 #5
0
 public ActionResult AddContributor(Contributor contributor)
 {
     if (contributor.FirstName != null &&
         contributor.LastName != null &&
         contributor.CellNumber != null)
     {
         ContributorsViewModel vm      = new ContributorsViewModel();
         EventRepository       manager = new EventRepository(Properties.Settings.Default.ConnString);
         manager.AddContributor(contributor);
     }
     return(RedirectToAction("GetContributors", "Contributors"));
 }
예제 #6
0
        public ActionResult Index(int?stateId)
        {
            BsGridRepositorySettings <ContributorSearchModel> bsGridSettings = null;

            if (stateId.HasValue)
            {
                var state = _componentState.Get(stateId.Value);

                if (state != null)
                {
                    bsGridSettings = state.ToBsGridRepositorySettings <ContributorSearchModel>();
                }
            }

            if (bsGridSettings == null)
            {
                bsGridSettings = new BsGridRepositorySettings <ContributorSearchModel>()
                {
                    PageSize = 5,
                    Page     = 1
                };
            }

            bsGridSettings.Search = _gridRepository.GetSearchForm(bsGridSettings.Search);

            var gridModel = _gridRepository.ToBsGridViewModel(bsGridSettings);

            var model = new ContributorsViewModel
            {
                Grid    = gridModel,
                Toolbar = new BsToolbarModel <ContributorSearchModel, ContributorNewModel, List <ContributorOrderModel> >
                {
                    Search = bsGridSettings.Search,
                    New    = _gridRepository.GetNewForm(),
                    Order  = _gridRepository.GetOrderForm(true)
                }
            };

            var options = new Dictionary <string, object>
            {
                { "pagerUrl", Url.Action("Pager") },
                { "getRowsUrl", Url.Action("GetRows") },
                { "enableDisableUrl", Url.Action("EnableDisable") },
                { "exportExcelUrl", Url.Action("ExportExcel") },
                { "updateUrl", Url.Action("Update") },
                { "deleteUrl", Url.Action("Delete") },
                { "editComponents", RequireJsHtmlHelpers.ToJsonDictionary <EditComponents>() }
            };

            RequireJsOptions.Add("index", options);

            return(View(model));
        }
예제 #7
0
        public IActionResult Index()
        {
            SimchaFundDb          db = new SimchaFundDb(_connectionString);
            ContributorsViewModel vm = new ContributorsViewModel
            {
                Contributors = db.GetContributors()
            };

            if (!string.IsNullOrEmpty((string)TempData["message"]))
            {
                ViewBag.Message = (string)TempData["message"];
            }
            return(View(vm));
        }
예제 #8
0
        public ActionResult Contributors()
        {
            GetFromDB             db = new GetFromDB(Properties.Settings.Default.ConStr);
            ContributorsViewModel vm = new ContributorsViewModel();

            vm.Total        = db.GetTotalMoney();
            vm.Contributors = db.GetContributors().Select(c => new ContributorWithBalance()
            {
                Contributor = c,
                Balance     = db.GetBalance(c.Id)
            });

            return(View(vm));
        }
예제 #9
0
        //
        // GET: /Contributors/

        public ActionResult GetContributors(string query)
        {
            ContributorsViewModel vm      = new ContributorsViewModel();
            EventRepository       manager = new EventRepository(Properties.Settings.Default.ConnString);

            if (string.IsNullOrEmpty(query))
            {
                vm.Contributors = manager.GetContributors();
            }
            else
            {
                vm.Contributors = manager.GetContributors(query);
            }
            return(View(vm));
        }
예제 #10
0
        public IActionResult DisplayContributors()
        {
            ContributorsViewModel vm = new ContributorsViewModel
            {
                Contributors = _repo.GetAllContributors(),
                TotalBalance = _repo.GetTotalBalance()
            };

            foreach (Contributor c in vm.Contributors)
            {
                c.Balance = c.Deposits.Sum(con => con.Amount) - c.Contributions.Sum(con => con.Amount);
            }

            return(View(vm));
        }
예제 #11
0
        public ActionResult Contributors()
        {
            Manager mgr = new Manager(Properties.Settings.Default.ConStr);
            ContributorsViewModel     vm           = new ContributorsViewModel();
            IEnumerable <Contributor> contributors = mgr.GetAllContributors();

            vm.Contributors = contributors.Select((c) =>
            {
                return(new ContributorViewModel
                {
                    Id = c.Id,
                    FirstName = c.FirstName,
                    LastName = c.LastName,
                    CellNumber = c.CellNumber,
                    AlwaysInclude = c.AlwaysInclude,
                    Date = c.Date,
                    Balance = mgr.GetBalance(c.Id)
                });
            });
            vm.Message = (string)TempData["Message"];
            vm.Total   = mgr.GetTotal();
            return(View(vm));
        }
예제 #12
0
        public ActionResult Index(int? stateId)
        {
            BsGridRepositorySettings<ContributorSearchModel> bsGridSettings = null;

            //HttpContext.Items["RequestTheme"] = BsTheme.Black;

            if (stateId.HasValue)
            {
                var state = _componentState.Get(stateId.Value);

                if (state != null)
                {
                    bsGridSettings = state.ToBsGridRepositorySettings<ContributorSearchModel>();
                }
            }

            bsGridSettings = new BsGridRepositorySettings<ContributorSearchModel>()
            {
                PageSize = 5,
                Page = 1,
                //GoTo = BsDirectionType.First
            };

            bsGridSettings.Search = _gridRepository.GetSearchForm(bsGridSettings.Search);

            bsGridSettings.OrderableColumns = new List<BsColumnOrder>{new BsColumnOrder
            {
                Name = "Name",
                Type = BsOrderType.Descending
            }};

            var gridModel = _gridRepository.ToBsGridViewModel(bsGridSettings, x => x.Id);

            var model = new ContributorsViewModel
            {
                Grid = gridModel,
                Toolbar = new BsToolbarModel<ContributorSearchModel, ContributorNewModel, List<ContributorOrderModel>>
                {
                    Search = bsGridSettings.Search,
                    New = _gridRepository.GetNewForm(),
                    Order = _gridRepository.GetOrderForm(true)
                }
            };

            var options = new Dictionary<string, object>
            {
                {"pagerUrl", Url.Action("Pager")},
                {"getRowsUrl", Url.Action("GetRows")},
                {"enableDisableUrl", Url.Action("EnableDisable")},
                {"exportExcelUrl", Url.Action("ExportExcel")},
                {"updateUrl", Url.Action("Update")},
                {"deleteUrl", Url.Action("Delete")},
                {"editComponents", RequireJsHtmlHelpers.ToJsonDictionary<EditComponents>()},
                {"countUrl", Url.Action("Count")}
            };

            RequireJsOptions.Add("index", options);

            return View(model);
        }
예제 #13
0
        public ActionResult Index(int?stateId)
        {
            BsGridRepositorySettings <ContributorSearchModel> bsGridSettings = null;

            //HttpContext.Items["RequestTheme"] = BsTheme.Black;

            if (stateId.HasValue)
            {
                var state = _componentState.Get(stateId.Value);

                if (state != null)
                {
                    bsGridSettings = state.ToBsGridRepositorySettings <ContributorSearchModel>();
                }
            }


            bsGridSettings = new BsGridRepositorySettings <ContributorSearchModel>()
            {
                PageSize = 5,
                Page     = 1,
                //GoTo = BsDirectionType.First
            };

            bsGridSettings.Search = _gridRepository.GetSearchForm(bsGridSettings.Search);

            bsGridSettings.OrderableColumns = new List <BsColumnOrder> {
                new BsColumnOrder
                {
                    Name = "Name",
                    Type = BsOrderType.Descending
                }
            };

            var gridModel = _gridRepository.ToBsGridViewModel(bsGridSettings, x => x.Id);

            var model = new ContributorsViewModel
            {
                Grid    = gridModel,
                Toolbar = new BsToolbarModel <ContributorSearchModel, ContributorNewModel, List <ContributorOrderModel> >
                {
                    Search = bsGridSettings.Search,
                    New    = _gridRepository.GetNewForm(),
                    Order  = _gridRepository.GetOrderForm(true)
                }
            };

            var options = new Dictionary <string, object>
            {
                { "pagerUrl", Url.Action("Pager") },
                { "getRowsUrl", Url.Action("GetRows") },
                { "enableDisableUrl", Url.Action("EnableDisable") },
                { "exportExcelUrl", Url.Action("ExportExcel") },
                { "updateUrl", Url.Action("Update") },
                { "deleteUrl", Url.Action("Delete") },
                { "editComponents", RequireJsHtmlHelpers.ToJsonDictionary <EditComponents>() },
                { "countUrl", Url.Action("Count") }
            };

            RequireJsOptions.Add("index", options);

            return(View(model));
        }