public bool UpdateIncomeAccounts(tbl_IncomeAccounts request) { try { using (var db = new SoneriCISEntities()) { var query = db.tbl_IncomeAccounts.FirstOrDefault(e => e.ID == request.ID); if (query == null) { return(false); } else { query.AccountMapping = request.AccountMapping; query.AccountType = request.AccountType; query.Category = request.Category; query.Classification = request.Classification; query.CodeGL = request.CodeGL; query.DescriptionGL = request.DescriptionGL; query.InternalAccount = request.InternalAccount; query.IsActive = request.IsActive; query.TakeOn = request.TakeOn; db.SaveChanges(); return(true); } } } catch (Exception ex) { return(false); } }
public bool AddIncomeAccounts(tbl_IncomeAccounts request) { try { using (var db = new SoneriCISEntities()) { db.tbl_IncomeAccounts.Add(request); db.SaveChanges(); return(true); } } catch (Exception ex) { return(false); } }
public ActionResult UpdateIncomeAccount(tbl_IncomeAccounts request) { var success = new IncomeAccountsDataAccess().UpdateIncomeAccounts(request); return(Json(new { IsSuccess = success, ErrorMessage = (success == true) ? CustomMessages.IncomeAccountSuccess : CustomMessages.IncomeAccountError, Response = success })); }