public ActionResult FilterAuthorizeAccountTypeScreen(FilterAccountTypeVM request, string RequestType) { if (RequestType == "Add") { List <AccountTypeVM> viewModel = ReviewMethods.FilterAccountTypeRequestDetails(request, "R"); return(PartialView("_partialReviewAuthorizeAccountTypeAddView", viewModel)); } else { //fetch from system requests List <tbl_System_Requests> lst = new SystemRequestDataAccess().GetAllSystemRequests("R", Constants.RequestTypes.AccountTypes_SystemRequest); List <AccountTypeVM> lstData = new List <AccountTypeVM>(); for (int i = 0; i < lst.Count; i++) { AccountTypeVM item = new AccountTypeVM(); item = CustomHelper.ParseJson <AccountTypeVM>(lst[i].UpdatedData); item.Code = lst[i].ID.ToString();//setting code as ID so it could be used at hyperlink item.AuthorizationComments = lst[i].AuthorizationComments; lstData.Add(item); } return(PartialView("_partialReviewAuthorizeAccountTypeUpdateView", lstData)); } }
public async Task <IHttpActionResult> delete([FromBody] AccountTypeVM entity) { var result = await accountTypesService.DeleteAsync(entity); await LogData(null, entity.ACC_TYPE_ID.ToString()); return(Ok(result)); }
public bool Delete(AccountTypeVM entity) { ACCOUNTS_TYPES accType = new ACCOUNTS_TYPES { ACC_TYPE_ID = entity.ACC_TYPE_ID }; _ACCOUNTS_TYPESRepo.Delete(accType, entity.ACC_TYPE_ID); return(true); }
public Task <bool> DeleteAsync(AccountTypeVM entity) { return(Task.Run <bool>(() => { ACCOUNTS_TYPES accType = new ACCOUNTS_TYPES { ACC_TYPE_ID = entity.ACC_TYPE_ID }; _ACCOUNTS_TYPESRepo.Delete(accType, entity.ACC_TYPE_ID); return true; })); }
public async Task <IHttpActionResult> add([FromBody] AccountTypeVM entity) { var result = await accountTypesService.InsertAsync(entity); await LogData(null, result.ToString()); if (result != 0) { return(Ok(true)); } return(Ok(false)); }
public bool Update(AccountTypeVM entity) { ACCOUNTS_TYPES accType = new ACCOUNTS_TYPES { ACC_TYPE_ID = entity.ACC_TYPE_ID, AddedBy = entity.AddedBy, AddedOn = entity.AddedOn, ACC_TYPE_AR_NAME = entity.ACC_TYPE_AR_NAME, ACC_TYPE_EN_NAME = entity.ACC_TYPE_EN_NAME, disable = entity.disable, UpdatedOn = entity.UpdatedOn, UpdatedBy = entity.UpdatedBy }; _ACCOUNTS_TYPESRepo.Update(accType, accType.ACC_TYPE_ID); return(true); }
public Task <bool> UpdateAsync(AccountTypeVM entity) { return(Task.Run <bool>(() => { ACCOUNTS_TYPES accType = new ACCOUNTS_TYPES { ACC_TYPE_ID = entity.ACC_TYPE_ID, AddedBy = entity.AddedBy, AddedOn = entity.AddedOn, ACC_TYPE_AR_NAME = entity.ACC_TYPE_AR_NAME, ACC_TYPE_EN_NAME = entity.ACC_TYPE_EN_NAME, disable = entity.disable, UpdatedOn = entity.UpdatedOn, UpdatedBy = entity.UpdatedBy }; _ACCOUNTS_TYPESRepo.Update(accType, accType.ACC_TYPE_ID); return true; })); }
public Task <int> InsertAsync(AccountTypeVM entity) { return(Task.Run <int>(() => { ACCOUNTS_TYPES accType = new ACCOUNTS_TYPES { ACC_TYPE_ID = entity.ACC_TYPE_ID, AddedBy = entity.AddedBy, AddedOn = entity.AddedOn, ACC_TYPE_AR_NAME = entity.ACC_TYPE_AR_NAME, ACC_TYPE_EN_NAME = entity.ACC_TYPE_EN_NAME, disable = entity.disable, UpdatedOn = entity.UpdatedOn, UpdatedBy = entity.UpdatedBy }; _ACCOUNTS_TYPESRepo.Add(accType); return accType.ACC_TYPE_ID; })); }
// GET: AddUpdateAccountTypes public ActionResult AddUpdateAccountType(int?Id) { AccountTypeVM viewModel = new AccountTypeVM(); ViewBag.RequestId = Id ?? 0; if (Id.HasValue) { viewModel = AccountTypeMethods.GetAccountTypeById(Id.GetValueOrDefault(), "R"); ViewBag.AccountTypes = new AccountTypeDataAccess().GetAccountTypesActiveInActive("R"); if (Id.GetValueOrDefault() > 0 && viewModel == null) { return(RedirectToAction("ReviewAccountTypeScreen", "Review")); } } else { ViewBag.AccountTypes = new AccountTypeDataAccess().GetAccountTypesActiveInActive("A"); } ViewBag.RequestType = "Add"; return(View(viewModel)); }
// GET: AddUpdateAccountTypes public ActionResult AddUpdateAccountTypeForUpdateRequest(int?Id) { AccountTypeVM viewModel = new AccountTypeVM(); ViewBag.RequestId = Id ?? 0; if (Id.HasValue) { var getSystemRequest = new SystemRequestDataAccess().GetSystemRequest(Id.GetValueOrDefault(), "R"); viewModel = getSystemRequest == null ? null : CustomHelper.ParseJson <AccountTypeVM>(getSystemRequest.UpdatedData); ViewBag.AccountTypes = new AccountTypeDataAccess().GetAccountTypesActiveInActive("A"); if (Id.GetValueOrDefault() > 0 && viewModel == null) { return(RedirectToAction("ReviewAccountTypeScreen", "Review")); } } else { ViewBag.AccountTypes = new AccountTypeDataAccess().GetAccountTypesActiveInActive("A"); } ViewBag.RequestType = "Update"; return(View("AddUpdateAccountType", viewModel)); }