Example #1
0
        public ActionResult EditLedger(int id, FormCollection form, EXPENSESHEAD ledger)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(View());
                }
                if (id > 0)
                {
                    if (MasterModels.UpdateLedger(id, ledger) > 0)
                    {
                        ViewData["Message"] = "Ledger Details Updated Successfully.";
                    }
                    else
                    {
                        ViewData["Message"] = "Failed to Update Ledger Details.";
                    }
                }
                else
                {
                    ViewData["Message"] = "Failed to Update Ledger Details.";
                }
                // TODO: Add update logic here

                EXPENSESHEAD newledger = MasterModels.GetLedgerDetailsByLedgerId(id);
                ViewData.Model          = newledger;
                ViewData["LedgerTypes"] = Utilities.GetLedgerNameList((int)newledger.LedgerTypeId);
                return(View());
            }
            catch
            {
                return(View());
            }
        }
Example #2
0
        public ActionResult EditLedger(int id)
        {
            EXPENSESHEAD ledger = MasterModels.GetLedgerDetailsByLedgerId(id);

            ViewData.Model = ledger;
            if (ledger != null)
            {
                ViewData["LedgerTypes"] = Utilities.GetLedgerNameList((int)ledger.LedgerTypeId);
            }
            return(View());
        }