/// <summary> /// Function to save the new pricelist for the product /// </summary> public void SaveFunction() { try { PriceListSP spPriceList = new PriceListSP(); PriceListInfo infoPriceList = new PriceListInfo(); infoPriceList.ProductId = decProductMain; infoPriceList.PricinglevelId = decPricingLevelMain; infoPriceList.UnitId = decUnitId; infoPriceList.BatchId = Convert.ToDecimal(cmbBatch.SelectedValue.ToString()); infoPriceList.Rate = Convert.ToDecimal(txtRate.Text); infoPriceList.Extra1 = string.Empty; infoPriceList.Extra2 = string.Empty; if (spPriceList.PriceListCheckExistence(0, decPricingLevelMain, Convert.ToDecimal(cmbBatch.SelectedValue.ToString()), decProductMain) == true) { spPriceList.PriceListAdd(infoPriceList); Messages.SavedMessage(); Clear(); } else { Messages.InformationMessage("Price List already exist for selected product and batches"); Clear(); } } catch (Exception ex) { MessageBox.Show("PLP2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Function to insert values to PriceList Table /// </summary> /// <param name="pricelistinfo"></param> public void PriceListAdd(PriceListInfo pricelistinfo) { try { spPriceList.PriceListAdd(pricelistinfo); } catch (Exception ex) { MessageBox.Show("PL6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information); } }