예제 #1
0
        //
        // GET: /PSNP/RegionalPSNPPledge/

        public ActionResult Index()
        {
            ViewBag.DonorID     = new SelectList(_donorService.GetAllDonor(), "DonorID", "Name");
            ViewBag.CommodityID = new SelectList(_commodityService.GetAllCommodity(), "CommodityID", "Name");
            ViewBag.UnitID      = new SelectList(_unitService.GetAllUnit(), "UnitID", "Name");
            return(View());
        }
예제 #2
0
 public JsonResult GetResponsibleDonor()
 {
     return(Json(from c in _donorService.GetAllDonor()
                 .Where(p => p.IsResponsibleDonor == true)
                 .DefaultIfEmpty()
                 .OrderBy(p => p.Name)
                 select new DonorViewModel
     {
         DonorId = c.DonorID,
         Name = c.Name
     }, JsonRequestBehavior.AllowGet));
 }
예제 #3
0
        public ActionResult Create()
        {
            var contribution = new Contribution();
            var hrds         = _hrdService.GetAllHRD();
            var hrdName      = (from item in hrds
                                select new { item.HRDID, Name = string.Format("{0}-{1}", item.Season.Name, item.Year) }).ToList
                                   ();

            ViewBag.HRDID = new SelectList(hrdName, "HRDID", "Name");
            //ViewBag.HRDID = new SelectList(_hrdService.GetAllHRD(), "HRDID", "Year");
            ViewBag.DonorID = new SelectList(_donorService.GetAllDonor(), "DonorID", "Name");
            ViewBag.Year    = DateTime.Now.Year;
            return(View(contribution));
        }
예제 #4
0
        public ActionResult Allocation(int?id)
        {
            if (id == null)
            {
                return(Redirect(Url.Action("Index", "ReliefRequisition")));
            }

            var requisition =
                _reliefRequisitionService.Get(t => t.RequisitionID == id, null, "ReliefRequisitionDetails").
                FirstOrDefault();

            ViewData["donors"] = _donorService.GetAllDonor();
            //ViewBag.HRDID = new SelectList(_donorService.GetAllDonor(), "HRDID", "Year", donor.HRDID);

            if (requisition == null)
            {
                HttpNotFound();
            }
            if (requisition != null && requisition.ProgramID == (int)Programs.PSNP)
            {
                ViewBag.program = "PSNP";
            }
            var datePref             = _userAccountService.GetUserInfo(HttpContext.User.Identity.Name).DatePreference;
            var requisitionViewModel = RequisitionViewModelBinder.BindReliefRequisitionViewModel(requisition, _workflowStatusService.GetStatus(WORKFLOW.RELIEF_REQUISITION), datePref);

            if (requisition != null && (requisition.RationID != null && requisition.RationID > 0))
            {
                requisitionViewModel.Ration = _rationService.FindById((int)requisition.RationID).RefrenceNumber;
            }
            return(View(requisitionViewModel));
        }
예제 #5
0
        private ReceiptAllocationViewModel BindReceiptAllocaitonViewModel()
        {
            var user        = _userProfileService.GetUser(User.Identity.Name);
            var commodities = _commodityService.GetAllCommodity().DefaultIfEmpty().OrderBy(o => o.Name).ToList();
            var donors      = _donorService.GetAllDonor().DefaultIfEmpty().OrderBy(o => o.Name).ToList();
            var hubs        = new List <Hub>();

            if (user != null)
            {
                //Hubs = new List<Hub>() { user.DefaultHub };
                hubs = _hubService.GetAllWithoutId(user.DefaultHub.HubID).DefaultIfEmpty().OrderBy(o => o.Name)
                       .ToList();
            }
            else
            {
                hubs =
                    _hubService.GetAllHub().DefaultIfEmpty().OrderBy(o => o.Name).ToList();
            }
            var programs         = _programService.GetAllProgram().DefaultIfEmpty().OrderBy(o => o.Name).ToList();
            var commoditySources = _commoditySourceService.GetAllCommoditySource().DefaultIfEmpty().OrderBy(o => o.Name).ToList();
            var commodityTypes   = _commodityTypeService.GetAllCommodityType().DefaultIfEmpty().OrderBy(o => o.Name).ToList();
            var viewModel        = new ReceiptAllocationViewModel(commodities, donors, hubs, programs, commoditySources, commodityTypes, user);

            viewModel.HubID = user.DefaultHub.HubID;
            return(viewModel);
        }
예제 #6
0
        //
        // GET: /GiftCertificate/Create

        public ActionResult Create()
        {
            ViewBag.Commodities       = _commodityService.GetAllCommodity().OrderBy(o => o.Name);
            ViewBag.CommodityTypes    = new SelectList(_commodityTypeService.GetAllCommodityType().OrderBy(o => o.Name), "CommodityTypeID", "Name");
            ViewBag.DCurrencies       = _detailService.GetAllDetail().Where(d => d.MasterID == Master.Constants.CURRENCY).OrderBy(o => o.SortOrder);
            ViewBag.DFundSources      = _detailService.GetAllDetail().Where(d => d.MasterID == Master.Constants.FUND_SOURCE).OrderBy(o => o.SortOrder);
            ViewBag.DBudgetTypes      = _detailService.GetAllDetail().Where(d => d.MasterID == Master.Constants.BUDGET_TYPE).OrderBy(o => o.SortOrder);
            ViewBag.Donors            = new SelectList(_donorService.GetAllDonor().OrderBy(o => o.Name), "DonorID", "Name");
            ViewBag.Programs          = new SelectList(_programService.GetAllProgram(), "ProgramID", "Name");
            ViewBag.DModeOfTransports = new SelectList(_detailService.GetAllDetail().Where(d => d.MasterID == Master.Constants.TRANSPORT_MODE).OrderBy(o => o.SortOrder), "DetailID", "Name");

            List <GiftCertificateDetailsViewModel> GiftCertificateDetails = new List <GiftCertificateDetailsViewModel>();

            ViewBag.GiftCertificateDetails = GiftCertificateDetails;

            return(View(new GiftCertificateViewModel()));
        }
        public void loadListItems()
        {
            // commodityService.FindById(1).CommodityID;

            ViewBag.DonorId     = new SelectList(donorService.GetAllDonor(), "DonorID", "Name");
            ViewBag.HubId       = new SelectList(hubService.GetAllHub(), "HubID", "Name");
            ViewBag.CommodityId = new SelectList(commodityService.GetAllCommodity(), "CommodityID", "Name");
        }
예제 #8
0
        public ActionResult Allocation(int id)
        {
            var requisition =
                _reliefRequisitionService.Get(t => t.RequisitionID == id, null, "ReliefRequisitionDetails").
                FirstOrDefault();

            ViewData["donors"] = _donorService.GetAllDonor();
            //ViewBag.HRDID = new SelectList(_donorService.GetAllDonor(), "HRDID", "Year", donor.HRDID);

            if (requisition == null)
            {
                HttpNotFound();
            }
            var datePref             = _userAccountService.GetUserInfo(HttpContext.User.Identity.Name).DatePreference;
            var requisitionViewModel = RequisitionViewModelBinder.BindReliefRequisitionViewModel(requisition, _workflowStatusService.GetStatus(WORKFLOW.RELIEF_REQUISITION), datePref);

            return(View(requisitionViewModel));
        }
예제 #9
0
        //
        // GET: /StartingBalance/Create

        public ActionResult Create()
        {
            List <Commodity> Commodities;
            List <Program>   Programs;
            List <Store>     Stores;
            List <Unit>      Units;
            List <Donor>     Donors;

            var user = _userProfileService.GetUser(User.Identity.Name);

            Commodities = _commodityService.GetAllCommodity().Where(c => c.ParentID != null).ToList();
            Programs    = _programService.GetAllProgram().ToList();
            Stores      = _storeService.GetAllStore().Where(h => h.HubID == user.DefaultHub.HubID).ToList();
            Units       = _unitService.GetAllUnit().ToList();
            Donors      = _donorSerivce.GetAllDonor().ToList();



            StartingBalanceViewModel startingBalanceViewModel = new StartingBalanceViewModel(Commodities, Stores, Units, Programs, Donors, user);

            return(PartialView(startingBalanceViewModel));
        }
예제 #10
0
        public ActionResult Index()
        {
            var donor = _donorService.GetAllDonor();

            return(View(donor));
        }
예제 #11
0
 public ViewResult Index()
 {
     return(View(_donorService.GetAllDonor().OrderBy(o => o.Name).ToList()));
 }