public IActionResult RegisterMatTransType([FromBody] MatTranTypes mattrantypes) { if (mattrantypes == null) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = $"{nameof(mattrantypes)} cannot be null" })); } try { var response = BillingHelpers.RegisterMatTransType(mattrantypes); if (response != null) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = response })); } return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = " Registration Failed." })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult GetFinanceList() { APIResponse apiResponse; try { var financeList = BillingHelpers.GetFinances(); if (financeList.Count > 0) { dynamic expando = new ExpandoObject(); expando.financeslist = financeList; return(Ok(apiResponse = new APIResponse() { status = APIStatus.PASS.ToString(), response = expando })); } else { return(Ok(apiResponse = new APIResponse() { status = APIStatus.FAIL.ToString(), response = "No Data Found." })); } } catch (Exception ex) { return(Ok(apiResponse = new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult RegisterCardType([FromBody] CardType cardType) { if (cardType == null) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = $"{nameof(cardType)} cannot be null" })); } try { var reponse = BillingHelpers.RegisterCardType(cardType); if (reponse != null) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = reponse })); } return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = "Registration Failed" })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult DeleteMatTranTypes(string seqid) { if (seqid == null) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = $"{nameof(seqid)}can not be null" })); } try { var result = BillingHelpers.DeleteMatTransType(Convert.ToInt32(seqid)); if (result != null) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = result })); } return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = "Deletion Failed." })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = ex.Message })); } }
public IActionResult GetcardtypeList() { try { var cardTypeList = BillingHelpers.GetCardTypeList(); if (cardTypeList.Count > 0) { dynamic expando = new ExpandoObject(); expando.cardtype = BillingHelpers.GetCardTypeList(); return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = expando })); } else { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = "No Data Found." })); } } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public async Task <string> AdjustStorageAsync(User user, short storageAdjustmentGb) { if (user == null) { throw new ArgumentNullException(nameof(user)); } if (!user.Premium) { throw new BadRequestException("Not a premium user."); } var secret = await BillingHelpers.AdjustStorageAsync(_paymentService, user, storageAdjustmentGb, StoragePlanId); await _referenceEventService.RaiseEventAsync( new ReferenceEvent(ReferenceEventType.AdjustStorage, user) { Storage = storageAdjustmentGb, PlanName = StoragePlanId, }); await SaveUserAsync(user); return(secret); }
public IActionResult DeleteCardType(string code) { if (code == null) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = $"{nameof(code)}can not be null" })); } try { var response = BillingHelpers.DeleteCardType(code); if (response != null) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = response })); } return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = "Deletion Failed" })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult GetBillingList(string branchCode) { try { var billingList = BillingHelpers.GetBillings(branchCode); if (billingList.Count > 0) { dynamic expando = new ExpandoObject(); expando.BillingList = billingList; return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = expando })); } return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = "No billing records Found." })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult UpdateFinance([FromBody] Finance finances) { if (finances == null) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = $"{nameof(finances)} cannot be null" })); } try { var response = BillingHelpers.UpdateFinance(finances); if (response != null) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = response })); } } catch (Exception) { } return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = "Updation Failed." })); }
public IActionResult DeleteCustomerReceipt(string seqID) { if (seqID == null) { return(BadRequest($"{nameof(seqID)}can not be null")); } try { var cardtype = BillingHelpers.DeleteCustomerReceipt(Convert.ToInt32(seqID)); if (cardtype != null) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = cardtype })); } return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = "Deletion Failed." })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = ex.Message })); } }
public IActionResult UpdateCustomerReceipt([FromBody] CustomerReceipts customerReceipts) { if (customerReceipts == null) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = $"{nameof(customerReceipts)} cannot be null" })); } try { var result = BillingHelpers.UpdateCustomerReceipt(customerReceipts); if (result != null) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = result })); } return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = " Updation Failed" })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = ex.Message })); } }
public async Task AdjustStorageAsync(User user, short storageAdjustmentGb) { if (user == null) { throw new ArgumentNullException(nameof(user)); } if (!user.Premium) { throw new BadRequestException("Not a premium user."); } await BillingHelpers.AdjustStorageAsync(_paymentService, user, storageAdjustmentGb, StoragePlanId); await SaveUserAsync(user); }
public IActionResult GetVoucherTypeList() { try { dynamic expando = new ExpandoObject(); expando.VoucherTypesList = BillingHelpers.GetVoucherTypesList().Select(x => new { ID = x, TEXT = x }); return(Ok(new APIResponse { status = APIStatus.PASS.ToString(), response = expando })); } catch (Exception ex) { return(Ok(new APIResponse { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult GetAsigAcctobranchGlAcc() { try { dynamic expando = new ExpandoObject(); expando.AsigAcctobranchGlAccList = BillingHelpers.GetAsigAcctobranchGlAcc(); return(Ok(new APIResponse { status = APIStatus.FAIL.ToString(), response = expando })); } catch (Exception ex) { return(Ok(new APIResponse { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult GetGLAccountsList(string accountType) { try { dynamic expando = new ExpandoObject(); expando.accounts = BillingHelpers.GetGlAccountsDRCR(accountType).Select(gl => new { ID = gl.Glcode, Text = gl.GlaccountName }); return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = expando })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult GetFinancesCutomerGLAccounts() { try { dynamic expando = new ExpandoObject(); expando.glaccts = BillingHelpers.GetFinancesCutomerGLAccounts(); return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = expando })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }
public IActionResult GetMatTranTypesList() { try { dynamic expando = new ExpandoObject(); expando.materialtratypes = BillingHelpers.GetMatTranTypesList(); return(Ok(new APIResponse() { status = APIStatus.PASS.ToString(), response = expando })); } catch (Exception ex) { return(Ok(new APIResponse() { status = APIStatus.FAIL.ToString(), response = ex.Message })); } }