Esempio n. 1
0
 /// <summary>
 /// Edit function
 /// </summary>
 public void EditFunction()
 {
     try
     {
         StandardRateInfo infoStandardRate = new StandardRateInfo();
         StandardRateSP   spStandardRate   = new StandardRateSP();
         infoStandardRate.StandardRateId = decStandardRate;
         infoStandardRate.ApplicableFrom = Convert.ToDateTime(txtFromDate.Text.ToString());
         infoStandardRate.ApplicableTo   = Convert.ToDateTime(txtToDate.Text.ToString());
         infoStandardRate.ProductId      = decProduct;
         infoStandardRate.UnitId         = decUnitId;
         infoStandardRate.BatchId        = Convert.ToDecimal(cmbBatch.SelectedValue);
         infoStandardRate.Rate           = Convert.ToDecimal(txtRate.Text.ToString());
         infoStandardRate.Extra1         = string.Empty;
         infoStandardRate.Extra2         = string.Empty;
         if (spStandardRate.StandardrateCheckExistence(decStandardRateId, Convert.ToDateTime(txtFromDate.Text.ToString()), Convert.ToDateTime(txtToDate.Text.ToString()), decProduct, infoStandardRate.BatchId) == false)
         {
             spStandardRate.StandardRateEdit(infoStandardRate);
             Messages.UpdatedMessage();
             GridFill(decProduct);
             Clear();
         }
         else
         {
             Messages.InformationMessage("Standard rate already exist for selected product and dates");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SRP6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Function to check existence of StandardRate based on the parameter
        /// </summary>
        /// <param name="decstandardRateId"></param>
        /// <param name="dtapplicableFrom"></param>
        /// <param name="dtapplicableTo"></param>
        /// <param name="decProductId"></param>
        /// <param name="decBatchId"></param>
        /// <returns></returns>
        public bool StandardrateCheckExistence(decimal decstandardRateId, DateTime dtapplicableFrom, DateTime dtapplicableTo, decimal decProductId, decimal decBatchId)
        {
            bool isExist = false;

            try
            {
                isExist = spStandaredRate.StandardrateCheckExistence(decstandardRateId, dtapplicableFrom, dtapplicableTo, decProductId, decBatchId);
            }
            catch (Exception ex)
            {
                MessageBox.Show("AL6:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(isExist);
        }