Ejemplo n.º 1
0
 /// <summary>
 /// Function to edit the pricelist
 /// </summary>
 public void EditFunction()
 {
     try
     {
         if (txtRate.Text.Trim() == String.Empty)
         {
             Messages.InformationMessage("Enter rate");
             txtRate.Focus();
         }
         else if (Convert.ToDecimal(txtRate.Text) == 0)
         {
             PriceListSP spPriceList = new PriceListSP();
             spPriceList.PriceListDelete(deca);
             Messages.UpdatedMessage();
             if (frmPriceListobj != null)
             {
                 this.Close();
             }
         }
         else
         {
             PriceListSP   spPriceList   = new PriceListSP();
             PriceListInfo infoPriceList = new PriceListInfo();
             infoPriceList.ProductId      = decProductMain;
             infoPriceList.PricelistId    = Convert.ToDecimal(dgvProductGroup.CurrentRow.Cells["dgvtxtPriceListId"].Value.ToString());
             infoPriceList.PricinglevelId = decPricingLevelMain;
             infoPriceList.UnitId         = decUnitId;
             infoPriceList.BatchId        = decBatchId;
             infoPriceList.Rate           = Convert.ToDecimal(txtRate.Text);
             infoPriceList.Extra1         = string.Empty;
             infoPriceList.Extra2         = string.Empty;
             spPriceList.PriceListEdit(infoPriceList);
             Messages.UpdatedMessage();
             Clear();
             if (frmPriceListobj != null)
             {
                 this.Close();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Function to delete the pricelist for the product
 /// </summary>
 public void DeleteFunction()
 {
     try
     {
         PriceListSP spPriceList = new PriceListSP();
         if (spPriceList.PriceListCheckReferenceAndDelete(decPricingLevelId) <= 0)
         {
             Messages.ReferenceExistsMessage();
         }
         else
         {
             spPriceList.PriceListDelete(decpriceListId);
             Messages.DeletedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PLP7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }