public IActionResult Details(int Id)
        {
            MctGLSetup mctGLSetup = new MctGLSetup();

            mctGLSetup = _unitOfWork.MctGLSetupRepo.GetById(Id);
            return(View(mctGLSetup));
        }
        public IActionResult Edit(int id, [Bind("ID,MerchantId,TerminalId,GLNumber,AccountNo,AccountName,Descriptions,IsActive")] MctGLSetup mctGLSetup)
        {
            if (id != mctGLSetup.ID)
            {
                return(NotFound());
            }

            mctGLSetup.IsApprove   = false;
            mctGLSetup.IsDeleted   = false;
            mctGLSetup.EntryBy     = 1;
            mctGLSetup.EntryDate   = Convert.ToDateTime(DateTime.Now);
            mctGLSetup.UpdatedBy   = 1;
            mctGLSetup.UpdatedDate = Convert.ToDateTime(DateTime.Now);

            if (ModelState.IsValid)
            {
                using (var transaction = _unitOfWork.MTDBContext.Database.BeginTransaction())
                {
                    try
                    {
                        _unitOfWork.MctGLSetupRepo.Edit(mctGLSetup);
                        _unitOfWork.Save();
                        transaction.Commit();
                    }
                    catch
                    {
                        transaction.Rollback();
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }

            return(View(mctGLSetup));
        }
        public IActionResult Edit(int?id)
        {
            MctGLSetup mctGLSetup = null;

            if (id != null)
            {
                mctGLSetup = _unitOfWork.MctGLSetupRepo.GetById(id);
            }
            return(View(mctGLSetup));
        }
        public IActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }
            MctGLSetup mctGLSetup = _unitOfWork.MctGLSetupRepo.GetById(id);

            if (mctGLSetup == null)
            {
                return(NotFound());
            }
            return(View(mctGLSetup));
        }
 public IActionResult ActiveDeactiveConfirmed(int?id)
 {
     using (var transaction = _unitOfWork.MTDBContext.Database.BeginTransaction())
     {
         if (ModelState.IsValid)
         {
             try
             {
                 MctGLSetup mctGLSetup = _unitOfWork.MctGLSetupRepo.GetById(id);
                 mctGLSetup.IsActive    = mctGLSetup.IsActive ? false : true;
                 mctGLSetup.UpdatedBy   = 1;
                 mctGLSetup.UpdatedDate = Convert.ToDateTime(DateTime.Now);
                 _unitOfWork.MctGLSetupRepo.Edit(mctGLSetup);
                 _unitOfWork.Save();
                 transaction.Commit();
             }
             catch (Exception ex)
             {
                 transaction.Rollback();
             }
         }
     }
     return(RedirectToAction(nameof(Index)));
 }
 public void Delete(MctGLSetup mctGLSetup)
 {
     this._dBContext.Attach(mctGLSetup);
     this._dBContext.Entry(mctGLSetup).State = EntityState.Modified;
 }
 public void Add(MctGLSetup mctGLSetup)
 {
     this._dBContext.Add(mctGLSetup);
 }