Exemple #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);
     }
 }
 /// <summary>
 /// Function to save the Pricinglevel
 /// </summary>
 public void SaveFunction()
 {
     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;
         if (spPricingLevel.PricingLevelCheckIfExist(txtPricingLevelName.Text.Trim().ToString(), 0) == false)
         {
             decPricingLevelId = spPricingLevel.PricingLevelAddWithoutSamePricingLevel(infoPricingLevel);
             Messages.SavedMessage();
             Clear();
             decIdforOtherForms = decPricingLevelId;
             if (frmCustomerObj != null)
             {
                 this.Close();
             }
             if (frmSalesReturnObj != null)
             {
                 this.Close();
             }
             if (frmSalesInvoiceObj != null)
             {
                 this.Close();
             }
         }
         else
         {
             Messages.InformationMessage("Pricing level name already exist");
             txtPricingLevelName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PL1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemple #3
0
 /// <summary>
 /// Function to save the Pricinglevel
 /// </summary>
 public void SaveFunction()
 {
     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;
         if (spPricingLevel.PricingLevelCheckIfExist(txtPricingLevelName.Text.Trim().ToString(), 0) == false)
         {
             decPricingLevelId = spPricingLevel.PricingLevelAddWithoutSamePricingLevel(infoPricingLevel);
             Messages.SavedMessage();
             Clear();
             decIdforOtherForms = decPricingLevelId;
             if (frmCustomerObj != null)
             {
                 this.Close();
             }
             if (frmSalesReturnObj != null)
             {
                 this.Close();
             }
             if (frmSalesInvoiceObj != null)
             {
                 this.Close();
             }
         }
         else
         {
             Messages.InformationMessage("Pricing level name already exist");
             txtPricingLevelName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("PL1" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <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);
     }
 }