public IActionResult RegisterAssetMaster([FromBody] AssetMaster assetMaster) { try { APIResponse apiResponse = null; if (AssetHelper.GetList(assetMaster.AssetNo) != null) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = $"AssetNo ={assetMaster.AssetNo} Aready Exists." })); } var result = AssetHelper.RegisterAssetMaster(assetMaster); if (result != null) { apiResponse = new APIResponse() { status = APIStatus.PASS.ToString(), response = result }; } else { apiResponse = new APIResponse() { status = APIStatus.FAIL.ToString(), response = "Registration Failed." }; } return(Ok(apiResponse)); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult GetAssetMasterList() { try { var assetmasterList = AssetHelper.GetList(); if (assetmasterList.Count > 0) { dynamic expdoObj = new ExpandoObject(); expdoObj.assetmasterList = assetmasterList; return(Ok(new APIResponse { status = APIStatus.PASS.ToString(), response = expdoObj })); } else { return(Ok(new APIResponse { status = APIStatus.PASS.ToString(), response = "No Data Found" })); } } catch (Exception ex) { return(Ok(new APIResponse { status = APIStatus.PASS.ToString(), response = ex.Message })); } //return Ok( new { // assetmasterlist=AssetHelper.GetList() // //glAssetAccts=_unitOfWork.GLAccounts.GetAll().Where(x=>x.Nactureofaccount == "FIXEDASSETS"), // //noSeriesAssetRcd =(from nos in _unitOfWork.NoSeries.GetAll() // // join pt in _unitOfWork.PartnerType.GetAll() // // on nos.PartnerType equals pt.Code // // where pt.AccountType == "FIXEDASSETS" // // select nos), // ////branch =BrancheHelper.GetBranches(), // //company =CompaniesHelper.GetListOfCompanies() //}); }