public Task <bool> UpdateEmpLedgerTitle(EmpLedgerTitle empLedgerTitle)
        {
            _context.Update(empLedgerTitle);
            var IsUpdate = SaveChanges();

            return(IsUpdate);
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(int id, [Bind("LedgerTitleID,LedgerTitle,CreatedDate")] EmpLedgerTitle empLedgerTitle)
        {
            if (id != empLedgerTitle.LedgerTitleID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    var data = await MainEmpRepo.UpdateEmpLedgerTitle(empLedgerTitle);

                    ViewBag.Msg = "Employee Ledger Title Updated Successfully";
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MainEmpRepo.EmpLedgerTitleExists(empLedgerTitle.LedgerTitleID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(empLedgerTitle));
        }
        public Task <bool> AddEmpLedgerTitle(EmpLedgerTitle empLedgerTitle)
        {
            _context.Add(empLedgerTitle);
            var IsSave = SaveChanges();

            return(IsSave);
        }
Beispiel #4
0
        public async Task <IActionResult> Create([Bind("LedgerTitleID,LedgerTitle,CreatedDate")] EmpLedgerTitle empLedgerTitle)
        {
            if (ModelState.IsValid)
            {
                var isAdd = MainEmpRepo.AddEmpLedgerTitle(empLedgerTitle);
                if (await isAdd)
                {
                    ViewBag.Msg = "Employee Ledger Title Added Successfully";
                }
                return(RedirectToAction(nameof(Index)));

                //_context.Add(empLedgerTitle);
                //await _context.SaveChangesAsync();
            }
            return(View(empLedgerTitle));
        }