コード例 #1
0
        internal bool updateCheque()
        {
            bool b = false;

            try {
                if (isValidateUpdateForm())
                {
                    if (chequeManager.radioButton_buying_filter.IsChecked == true)
                    {
                        BuyingCheque buyingCheque = chequeManager.SelectedBuyingCheque;
                        buyingCheque.IssuedDate   = Convert.ToDateTime(chequeManager.datePicker_issuedDate_update.SelectedDate);
                        buyingCheque.PayableDate  = Convert.ToDateTime(chequeManager.datePicker_payableDate_update.SelectedDate);
                        buyingCheque.Amount       = chequeManager.textBox_amount_update.DoubleValue;
                        buyingCheque.ChequeNumber = chequeManager.textBox_chequeNumber_update.Text;
                        buyingCheque.BankId       = Convert.ToInt32(chequeManager.comboBox_bank_update.SelectedValue);
                        buyingCheque.Notes        = chequeManager.textBox_notes_update.Text;
                        buyingCheque.Status       = Convert.ToInt32(chequeManager.comboBox_status_update.SelectedValue);
                        CommonMethods.setCDMDForUpdate(buyingCheque);
                        paymentManagerImpl.updBuyingCheque(buyingCheque);
                        b = true;
                    }
                    else
                    {
                        SellingCheque sellingCheque = chequeManager.SelectedSellingCheque;
                        sellingCheque.IssuedDate   = Convert.ToDateTime(chequeManager.datePicker_issuedDate_update.SelectedDate);
                        sellingCheque.PayableDate  = Convert.ToDateTime(chequeManager.datePicker_payableDate_update.SelectedDate);
                        sellingCheque.Amount       = chequeManager.textBox_amount_update.DoubleValue;
                        sellingCheque.ChequeNumber = chequeManager.textBox_chequeNumber_update.Text;
                        sellingCheque.BankId       = Convert.ToInt32(chequeManager.comboBox_bank_update.SelectedValue);
                        sellingCheque.Notes        = chequeManager.textBox_notes_update.Text;
                        sellingCheque.Status       = Convert.ToInt32(chequeManager.comboBox_status_update.SelectedValue);
                        CommonMethods.setCDMDForUpdate(sellingCheque);
                        paymentManagerImpl.updSellingCheque(sellingCheque);
                        b = true;
                    }
                }
            } catch (Exception) {
            }
            return(b);
        }