/// <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);
     }
 }
Example #2
0
 /// <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);
     }
 }