Пример #1
0
 /// <summary>
 /// Function to delete the salesquatation
 /// </summary>
 public void Delete()
 {
     SalesQuotationMasterSP SpSalesQuotationMaster = new SalesQuotationMasterSP();
     SalesQuotationDetailsSP SpSalesQuotationDetails = new SalesQuotationDetailsSP();
     try
     {
         decimal decResult2 = SpSalesQuotationMaster.SalesQuotationMasterDelete(decSalesquotationMasterId);
         decimal decResult1 = 0;
         if (decResult2 == 1)
         {
             for (int inI = 0; inI < dgvProduct.Rows.Count - 1; inI++)
             {
                 if (Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtquotationDetailsId"].Value) != 0)
                 {
                     decResult1 = SpSalesQuotationDetails.SalesQuotationDetailsDelete(Convert.ToDecimal(dgvProduct.Rows[inI].Cells["dgvtxtquotationDetailsId"].Value));
                 }
             }
         }
         if (decResult1 > 0 && decResult2 > 0)
         {
             Messages.DeletedMessage();
             if (frmSalesQuotationRegisterObj != null)
             {
                 this.Close();
                 frmSalesQuotationRegisterObj.Enabled = true;
             }
             if (frmSalesQuotationReportObj != null)
             {
                 this.Close();
                 frmSalesQuotationReportObj.Enabled = true;
             }
             if (objVoucherSearch != null)
             {
                 this.Close();
                 objVoucherSearch.Enabled = true;
             }
             if (frmDayBookObj != null)
             {
                 this.Close();
                 frmDayBookObj.Enabled = true;
             }
         }
         else
         {
             Messages.ReferenceExistsMessage();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(" SQ:34" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }