private void GetTaxes(string sVendorCode, string sLocationCode) { try { string errorMessage = string.Empty; string validationMessage = string.Empty; //TaxGroup tg = TaxApplication.GetApplicableTaxes(ItemID, "", m_fromStateId, m_toStateId, // Tax.TaxType.SOTAX.ToString(), "", m_isFormCApplicable, ref errorMessage, // ref validationMessage, sVendorCode, sLocationCode); TaxGroup tg = TaxApplication.GetApplicableTaxes(ItemID, "", m_fromStateId, m_toStateId, Tax.TaxType.POTAX.ToString(), "", m_isFormCApplicable, ref errorMessage, ref validationMessage, sVendorCode, sLocationCode); if (string.IsNullOrEmpty(errorMessage)) { //If no error message then process data if (tg != null && !(string.IsNullOrEmpty(tg.TaxGroupCode) && tg.TaxCodeList != null && tg.TaxCodeList.Count > 0)) { this.TaxGroupCode = tg.TaxGroupCode; this.PurchaseOrderTaxDetail = new List <PurchaseOrderTaxDetail>(); int rowno = 1; for (int i = 0; i < tg.TaxCodeList.Count; i++) { PurchaseOrderTaxDetail potd = new PurchaseOrderTaxDetail(); potd.TaxCode = tg.TaxCodeList[i].TaxCode; potd.TaxPercentage = tg.TaxCodeList[i].TaxPercent; potd.GroupOrder = tg.TaxCodeList[i].GroupOrder; potd.ItemID = ItemID; potd.Direction = (int)Tax.TaxDirection.In; potd.TaxGroup = tg.TaxGroupCode; potd.PONumber = PONumber; potd.RowNo = rowno++; potd.IsInclusive = tg.TaxCodeList[i].IsInclusive; this.PurchaseOrderTaxDetail.Add(potd); this.IsInclusive = potd.IsInclusive; } } } else { //Log error //Show message } } catch (Exception ex) { throw ex; } }
/// <summary> /// To Search Tax Application Record /// </summary> /// <param name="taxId"></param> /// <param name="taxCategoryId"></param> /// <param name="taxTypeId"></param> /// <param name="taxGroupId"></param> /// <param name="taxJurisdiction"></param> /// <param name="goodsDirection"></param> /// <param name="status"></param> /// <returns></returns> private List <TaxApplication> Search(int taxId, int taxCategoryId, int taxTypeId, int taxGroupId, List <int> taxJurisdiction, int goodsDirection, int status) { List <TaxApplication> m_listTaxApplication = new List <TaxApplication>(); TaxApplication tax = new TaxApplication(); //parentId = m_selectedParentId == Common.INT_DBNULL ? loc.ParentHierarchyId : m_selectedParentId; tax.TaxId = taxId; tax.TaxCategoryId = taxCategoryId; tax.TaxTypeId = taxTypeId; tax.TaxGroupId = taxGroupId; tax.States = taxJurisdiction; tax.GoodsDirection = goodsDirection; tax.Status = status; m_listTaxApplication = tax.Search(); return(m_listTaxApplication); }
public async Task <IActionResult> Put(int?id, [FromBody] TaxApplication model) { if (id == null) { return(NotFound("id not found")); } string Query = " {0},{1},{2},{3},{4},{5},{6},{7},{8},{9},{10} "; object[] Parameters = { id, model.CompanyAddress, model.CompanyPhoneNo, model.CompanyWebsite, model.CurrentPositon, model.CurrentSalary, model.Email, model.PaymentStatus, model.StaffId, model.TaxAmount, model.Bvn, model.CompanyName }; try { var Result = await Repo.TaxApp_Repository.ExecuteQuery(Query, Parameters); if (Result.Count() > 0) { return(Ok(Result)); } else { return(BadRequest()); } } catch (Exception Ex) { return(BadRequest(Ex)); } }
public async Task <IActionResult> Post([FromBody] TaxApplication model) { string Query = "[Add_Taxapplication] {0},{1},{2},{3},{4},{5},{6},{7},{8},{9} "; object[] Parameters = { model.CompanyAddress, model.CompanyPhoneNo, model.CompanyWebsite, model.CurrentPositon, model.CurrentSalary, model.Email, model.PaymentStatus, model.StaffId, model.Bvn, model.CompanyName }; try { var Result = await Repo.TaxApp_Repository.ExecuteCommand(Query, Parameters); if (Result > 0) { return(Ok()); } else { return(BadRequest()); } } catch (Exception Ex) { return(BadRequest(Ex)); } }
public async Task <IActionResult> GetCombinInfo([FromBody] TaxRegistration taxRegistration, TaxApplication taxApplication) { string Query = "[GET_All_TaxApplication] {0}"; int count = 10; object[] Parameters = { count }; try { List <TaxApplication> Result = await Repo.TaxApp_Repository.ExecuteQuery(Query, Parameters); if (Result.Count() > 0) { return(Ok(Result)); } else { return(null); } } catch (Exception Ex) { return(BadRequest(Ex)); } }
/// <summary> /// To Save Tax Application Record /// </summary> private void Save() { #region ValidateLocationControls ValidateControls(); #endregion #region Check Location Errors StringBuilder sbError = new StringBuilder(); sbError = GenerateError(); #endregion if (!sbError.ToString().Trim().Equals(string.Empty)) { MessageBox.Show(sbError.ToString(), Common.GetMessage("10001"), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } DialogResult saveResult = MessageBox.Show(Common.GetMessage("INF0027"), Common.GetMessage("10001"), MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (saveResult == DialogResult.Yes) { if ((m_taxId == Common.INT_DBNULL) && (Convert.ToInt32(cmbStatus.SelectedValue) == 2)) { MessageBox.Show(Common.GetMessage("VAL0020"), Common.GetMessage("10001"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } TaxApplication objtaxApplication = new TaxApplication(); objtaxApplication.TaxCategoryId = Convert.ToInt32(cmbTaxCategory.SelectedValue); objtaxApplication.TaxTypeId = Convert.ToInt32(cmbTaxType.SelectedValue); objtaxApplication.TaxGroupId = Convert.ToInt32(cmbTaxGroup.SelectedValue); List <int> taxJurisdiction = new List <int>(); taxJurisdiction = GetCheckedJurisdictionIds(); if (taxJurisdiction.Count == 0) { MessageBox.Show(Common.GetMessage("VAL0019", lblState.Text.Substring(0, lblState.Text.Length - 2)), Common.GetMessage("10001"), MessageBoxButtons.OK, MessageBoxIcon.Information); return; } objtaxApplication.States = taxJurisdiction; objtaxApplication.GoodsDirection = Convert.ToInt32(cmbGoodsDirection.SelectedValue); objtaxApplication.Status = Convert.ToInt32(cmbStatus.SelectedValue); objtaxApplication.ModifiedBy = intUserId; objtaxApplication.TaxId = m_taxId; objtaxApplication.ModifiedDate = m_ModifiedDate; objtaxApplication.TaxAuthority = txtAuthority.Text.Trim(); objtaxApplication.FormCTax = chkFormCTax.Checked == true ? 1 : 0; DateTime startDate = dtpStartDate.Checked == true?Convert.ToDateTime(dtpStartDate.Value) : Common.DATETIME_NULL; objtaxApplication.StartDate = Convert.ToDateTime(startDate).ToString(Common.DATE_TIME_FORMAT); string errorMesage = string.Empty; bool recordSaved = objtaxApplication.Save(ref errorMesage); if (errorMesage.Equals(string.Empty)) { BindGridOnSave(); ResetControlOnSave(); MessageBox.Show(Common.GetMessage("8001"), Common.GetMessage("10001"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (errorMesage.IndexOf("INF0032") >= 0) { BindGridOnSave(); MessageBox.Show(Common.GetMessage("INF0032", "Jurisdiction(s)- " + errorMesage.Substring("INF0032".Length + 1)), Common.GetMessage("10001"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else if (errorMesage.IndexOf("INF0033") >= 0) { BindGridOnSave(); MessageBox.Show(Common.GetMessage("INF0033", "Jurisdiction(s)- " + errorMesage.Substring("INF0033".Length + 1)), Common.GetMessage("10001"), MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(Common.GetMessage(errorMesage), Common.GetMessage("10001"), MessageBoxButtons.OK, MessageBoxIcon.Error); } } }