Example #1
0
        private void FrmModifyProject_Load(object sender, EventArgs e)
        {
            contractorTableAdapter.Fill(auditorDataSet.Contractor);
            locationTableAdapter.Fill(auditorDataSet.Location);
            projectTableAdapter.Fill(auditorDataSet.Project);

            //Formatting Data:
            ComboDocNo.Text          = "";
            TxtPredicationOrder.Text = "";
            ComboLocation.Text       = "";
            ComboContractor.Text     = "";
            BtnUpdate.Enabled        = false;
            BtnDelete.Enabled        = false;

            //Calculate discounts While loading the form //
            MathOperations.Percent(TxtAmount, TxtTaxRate, TxtTaxAmount);
            MathOperations.Percent(TxtAmount, TxtTransRate, TxtTransAmount);
            MathOperations.Percent(TxtAmount, TxtInsurRate, TxtInsurAmount);
            MathOperations.Percent(TxtAmount, TxtReservedRate, TxtReservedAmount);
            MathOperations.OPerationFees(TxtAmount, TxtBusinessFees);
            MathOperations.ActualPeriod(DateStart, DateEnd, TxtActualPeriod, "Project");
            MathOperations.CountPenalty(TxtPeriod, TxtActualPeriod, TxtAmount, TxtPenalty);
            MathOperations.NetAmount(TxtAmount, TxtTaxAmount, TxtTransAmount, TxtInsurAmount, TxtReservedAmount,
                                     TxtBusinessFees, TxtPenalty, TxtTotalDiscount, TxtNetAmount);
            MathOperations.AfterPayProject(ComboReservedRefund, TxtAmount, TxtReservedAmount, TxtResDiscountPercentage,
                                           TxtResDiscountAmount, TxtReservedPaid);
            MathOperations.AfterPayProject(ComboInsuranceRefund, TxtAmount, TxtInsurAmount, TxtInsurDiscountPercentage,
                                           TxtInsuranceDiscountAmount, TxtInsurancePaid);
        }
Example #2
0
 private void TxtAmount_TextChanged(object sender, EventArgs e)
 {
     //Formatting Form:
     if (TxtPredicationOrder.Text == "" || ComboLocation.Text == "" || ComboContractor.Text == "" ||
         TxtExcuteOrder.Text == "" || TxtPeriod.Text == "0" || ComboDocNo.Text == "" ||
         TxtOperation.Text == "" || TxtAmount.Text == "0" || ComboReservedRefund.Text == "" ||
         ComboInsuranceRefund.Text == "" || TxtJustAmount.Text == "")
     {
         BtnUpdate.Enabled = false;
     }
     else
     {
         BtnUpdate.Enabled = true;
     }
     //Calculate discounts While loading the form
     MathOperations.Tax(TxtAmount, TxtTaxRate, TxtTaxAmount);
     MathOperations.Percent(TxtAmount, TxtTransRate, TxtTransAmount);
     MathOperations.Percent(TxtAmount, TxtInsurRate, TxtInsurAmount);
     MathOperations.Percent(TxtAmount, TxtReservedRate, TxtReservedAmount);
     MathOperations.OPerationFees(TxtAmount, TxtBusinessFees);
     MathOperations.ActualPeriod(DateStart, DateEnd, TxtActualPeriod, "Project");
     MathOperations.CountPenalty(TxtPeriod, TxtActualPeriod, TxtAmount, TxtPenalty);
     MathOperations.NetAmount(TxtAmount, TxtTaxAmount, TxtTransAmount, TxtInsurAmount, TxtReservedAmount,
                              TxtBusinessFees, TxtPenalty, TxtTotalDiscount, TxtNetAmount);
     MathOperations.AfterPayProject(ComboReservedRefund, TxtAmount, TxtReservedAmount, TxtResDiscountPercentage,
                                    TxtResDiscountAmount, TxtReservedPaid);
     MathOperations.AfterPayProject(ComboInsuranceRefund, TxtAmount, TxtInsurAmount, TxtInsurDiscountPercentage,
                                    TxtInsuranceDiscountAmount, TxtInsurancePaid);
 }
Example #3
0
 private void TxtActualPeriod_TextChanged(object sender, EventArgs e)
 {
     //Calculate discounts While loading the form
     MathOperations.Percent(TxtAmount, TxtTaxRate, TxtTaxAmount);
     MathOperations.Percent(TxtAmount, TxtTransRate, TxtTransAmount);
     MathOperations.Percent(TxtAmount, TxtInsurRate, TxtInsurAmount);
     MathOperations.Percent(TxtAmount, TxtReservedRate, TxtReservedAmount);
     MathOperations.OPerationFees(TxtAmount, TxtBusinessFees);
     MathOperations.ActualPeriod(DateStart, DateEnd, TxtActualPeriod, "Project");
     MathOperations.CountPenalty(TxtPeriod, TxtActualPeriod, TxtAmount, TxtPenalty);
     MathOperations.NetAmount(TxtAmount, TxtTaxAmount, TxtTransAmount, TxtInsurAmount, TxtReservedAmount,
                              TxtBusinessFees, TxtPenalty, TxtTotalDiscount, TxtNetAmount);
 }
 private void CalculateDiscounts()
 {
     //Calculate discounts by rates:
     try
     {
         MathOperations.Tax(TxtAmount, TxtTaxRate, TxtTaxAmount);
         MathOperations.Percent(TxtAmount, TxtTransRate, TxtTransAmount);
         MathOperations.Percent(TxtAmount, TxtInsurRate, TxtInsurAmount);
         MathOperations.Percent(TxtAmount, TxtReservedRate, TxtReservedAmount);
         MathOperations.OPerationFees(TxtAmount, TxtBusinessFees);
         MathOperations.ActualPeriod(DateStart, DateEnd, TxtActualPeriod, "Project");
         MathOperations.CountPenalty(TxtPeriod, TxtActualPeriod, TxtAmount, TxtPenalty);
         MathOperations.NetAmount(TxtAmount, TxtTaxAmount, TxtTransAmount, TxtInsurAmount, TxtReservedAmount,
                                  TxtBusinessFees, TxtPenalty, TxtTotalDiscount, TxtNetAmount);
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message);
     }
 }