/// <summary> /// Get All Tax Type Detail /// </summary> /// <returns></returns> private List <TaxManagementViewModel> GetAllTaxs() { TaxManagementViewModel taxViewModel = new TaxManagementViewModel() { }; HttpResponseMessage response = new APIHelper.APICallMethod().GetHttpResponseMessage("GetAllTaxType", "AdminPanel", taxViewModel); if (response.IsSuccessStatusCode) { var data = response.Content.ReadAsStringAsync().Result; ViewModel.ResponseModel.ResponseViewModel <List <ViewModel.TaxManagementViewModel> > dbBookingDetails = JsonConvert.DeserializeObject <ViewModel.ResponseModel.ResponseViewModel <List <ViewModel.TaxManagementViewModel> > >(data); if (dbBookingDetails.IdentityResult.Status == true) { return(dbBookingDetails.Content); } else { return(new List <TaxManagementViewModel>()); } } else { return(new List <TaxManagementViewModel>()); } }
/// <summary> /// Save Tax Type Detail /// </summary> /// <param name="memberTypeName"></param> /// <param name="memberTypeValue"></param> /// <returns></returns> public JsonResult SaveTaxType(string taxTypeName, decimal percentage) { TaxManagementViewModel taxManagementViewModel = new TaxManagementViewModel() { Name = taxTypeName, Percentage = percentage }; HttpResponseMessage response = new APIHelper.APICallMethod().GetHttpResponseMessage("SaveTaxTypeDetails", "AdminPanel", taxManagementViewModel); if (response.IsSuccessStatusCode) { var data = response.Content.ReadAsStringAsync().Result; ViewModel.ResponseModel.ResponseViewModel <Dictionary <string, bool> > dbBookingDetails = JsonConvert.DeserializeObject <ViewModel.ResponseModel.ResponseViewModel <Dictionary <string, bool> > >(data); if (dbBookingDetails.IdentityResult.Status == true) { return(Json(new { code = 0, message = "Success" })); } else { if (dbBookingDetails.IdentityResult.Message == "Invalid access details, Please log-out.") { return(Json(new { code = -99, message = "Please Login Again" })); } else { return(Json(new { code = -1, message = dbBookingDetails.IdentityResult.Message })); } } } else { return(Json(new { code = -2, message = "failed" })); } }
/// <summary> /// Delete Pop Up For Tax Type /// </summary> /// <param name="id"></param> /// <returns></returns> public JsonResult DeletePopUp(long id) { TaxManagementViewModel taxManagementViewModel = new TaxManagementViewModel() { TaxId = id }; string convertedData = Common.HtmlHelper.RenderViewToString(this.ControllerContext, "~/Views/TaxTypeDetail/_Delete.cshtml", taxManagementViewModel); return(Json(new { code = 0, message = convertedData })); }
/// <summary> /// Update Pop Up For Tax Type /// </summary> /// <param name="id"></param> /// <param name="memberType"></param> /// <param name="valueToShow"></param> /// <returns></returns> public JsonResult UpdatePopUp(long id, string taxTypeName, decimal percentage) { TaxManagementViewModel taxManagementViewModel = new TaxManagementViewModel() { TaxId = id, Name = taxTypeName, Percentage = percentage }; string convertedData = Common.HtmlHelper.RenderViewToString(this.ControllerContext, "~/Views/TaxTypeDetail/_Update.cshtml", taxManagementViewModel); return(Json(new { code = 0, message = convertedData })); }