Exemplo n.º 1
0
        public ActionResult Delete(int id, StartingBalanceViewModel startingBalance)
        {
            try
            {
                // TODO: Add delete logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 2
0
        public ActionResult Edit(StartingBalanceViewModel startingBalance)
        {
            try
            {
                // TODO: Add update logic here

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 3
0
 public ActionResult Create(StartingBalanceViewModel startingBalance)
 {
     try
     {
         if (ModelState.IsValid)
         {
             // TODO: Add insert logic here
             var user = _userProfileService.GetUser(User.Identity.Name);
             _transactionService.SaveStartingBalanceTransaction(startingBalance, user);
             return(Json(true, JsonRequestBehavior.AllowGet));
         }
         return(View());
     }
     catch
     {
         return(View());
     }
 }
Exemplo n.º 4
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));
        }