Esempio n. 1
0
 /// <summary>
 /// Function to edit the Pricing level
 /// </summary>
 public void EditFunction()
 {
     try
     {
         PricingLevelSP   spPricingLevel   = new PricingLevelSP();
         PricingLevelInfo infoPricingLevel = new PricingLevelInfo();
         infoPricingLevel.PricinglevelName = txtPricingLevelName.Text.Trim();
         infoPricingLevel.Narration        = txtNarration.Text.Trim();
         infoPricingLevel.Extra1           = string.Empty;
         infoPricingLevel.Extra2           = string.Empty;
         infoPricingLevel.PricinglevelId   = Convert.ToDecimal(dgvPricingLevel.CurrentRow.Cells[1].Value.ToString());
         if (txtPricingLevelName.Text.ToString() != strPricingLevel)
         {
             if (spPricingLevel.PricingLevelCheckIfExist(txtPricingLevelName.Text.Trim().ToString(), decPricingLevel) == false)
             {
                 if (spPricingLevel.PricingLevelEditParticularFields(infoPricingLevel))
                 {
                     Messages.UpdatedMessage();
                     Clear();
                 }
                 else if (infoPricingLevel.PricinglevelId == 1)
                 {
                     Messages.InformationMessage("Cannot update");
                     Clear();
                     txtPricingLevelName.Focus();
                 }
             }
             else
             {
                 Messages.InformationMessage("Pricing level name already exist");
                 txtPricingLevelName.Focus();
             }
         }
         else
         {
             spPricingLevel.PricingLevelEditParticularFields(infoPricingLevel);
             Messages.UpdatedMessage();
             Clear();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PL2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Esempio n. 2
0
        public bool PricingLevelEditParticularFields(PricingLevelInfo pricinglevelinfo)
        {
            bool isEdit = false;

            try
            {
                isEdit = spPricingLevel.PricingLevelEditParticularFields(pricinglevelinfo);
            }
            catch (Exception ex)
            {
                MessageBox.Show("PRL3:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(isEdit);
        }