Пример #1
0
        private void MatchBalanceButton_Click(object sender, EventArgs e)
        {
            if (CustomerDoNotHaveAccount)
            {
                MessageBox.Show("Please Select Valid User WHO HAVE ACCOUNT");
            }
            else
            {
                UnRevisedChkBox.Checked = true;

                CreditBillsChkBox.Checked = true;

                ListDCBtn.PerformClick();
                double currentbalance  = 0;
                double totalbillsprice = 0;
                double totalpayments   = 0;
                if (double.TryParse(VendorAccountBalanceTxtBox.Text, out currentbalance))
                {
                    currentbalance = Math.Round(currentbalance, 3);
                }
                if (double.TryParse(TotalDebitPriceTxtBox.Text, out totalbillsprice))
                {
                    totalbillsprice = Math.Round(totalbillsprice, 3);
                }
                if (double.TryParse(TotalCreditTxtBox.Text, out totalpayments))
                {
                    totalpayments = Math.Round(totalpayments, 3);
                }

                if (currentbalance == (totalbillsprice - totalpayments))
                {
                    MessageBox.Show("الحساب مطابق");
                }
                else if (currentbalance > (totalbillsprice - totalpayments))
                {
                    MessageBox.Show("الحساب غير مطابق , يجب على التاجر دفع مبلغ    " + ((totalbillsprice - totalpayments)));
                }
                else
                {
                    MessageBox.Show("الحساب غير مطابق , يجب ان تدفع للتاجر  مبلغ    " + ((totalbillsprice - totalpayments)));
                }
            }
        }
Пример #2
0
        private void ItemsPerPageBtnCredit_Click(object sender, EventArgs e)
        {
            ListDCBtn.PerformClick();
            if (ItemsPerPageTxtBoxCredit.Text != "" && CreditDGView.Rows.Count > 0)
            {
                ItemsPerPageCredit = int.Parse(ItemsPerPageTxtBoxCredit.Text.ToString());
                if (ItemsPerPageCredit < 100)
                {
                    pagesnumberCredit = (int)aVendorPaymentTable.Rows.Count / ItemsPerPageCredit;
                    if ((double.Parse(aVendorPaymentTable.Rows.Count.ToString()) / ItemsPerPageCredit - int.Parse(aVendorPaymentTable.Rows.Count.ToString()) / ItemsPerPageCredit) > 0)
                    {
                        pagesnumberCredit++;
                    }

                    PageOfTotalTxtBoxCredit.Text = "1/" + pagesnumberCredit.ToString();
                    pageCredit(1);
                }
                else
                {
                    MessageBox.Show("Number should be less than 100");
                }
            }
        }