예제 #1
0
        private BuyingCheque getBuyingChequeForFilter()
        {
            BuyingCheque buyingCheque = null;

            try {
                buyingCheque = new BuyingCheque();
                if (buyingChequeRreport.datePicker_from.SelectedDate != null || buyingChequeRreport.datePicker_to.SelectedDate != null)
                {
                    if (buyingChequeRreport.datePicker_from.SelectedDate != null && buyingChequeRreport.datePicker_to.SelectedDate != null)
                    {
                        buyingCheque.PayableDate = buyingChequeRreport.datePicker_from.SelectedValue;
                        buyingCheque.addDateCondition("date", "BETWEEN", buyingChequeRreport.datePicker_from.SelectedValue.ToString("yyyy-MM-dd"), buyingChequeRreport.datePicker_to.SelectedValue.ToString("yyyy-MM-dd"));
                    }
                    else if (buyingChequeRreport.datePicker_from.SelectedDate != null)
                    {
                        buyingCheque.PayableDate = buyingChequeRreport.datePicker_from.SelectedValue;
                    }
                    else
                    {
                        buyingCheque.PayableDate = buyingChequeRreport.datePicker_to.SelectedValue;
                    }
                }
                buyingCheque.Status = Convert.ToInt32(buyingChequeRreport.comboBox_status.SelectedValue);
                buyingCheque.Status = buyingChequeRreport.comboBox_status.Value;
            } catch (Exception) {
            }
            return(buyingCheque);
        }
예제 #2
0
 internal void populateUpdateForm()
 {
     try {
         int id = chequeManager.dataGrid.SelectedItemID;
         if (chequeManager.radioButton_buying_filter.IsChecked == true)
         {
             BuyingCheque buyingCheque = paymentManagerImpl.getBuyingChequeById(id);
             chequeManager.SelectedBuyingCheque = buyingCheque;
             chequeManager.datePicker_issuedDate_update.SelectedDate  = buyingCheque.IssuedDate;
             chequeManager.datePicker_payableDate_update.SelectedDate = buyingCheque.PayableDate;
             chequeManager.textBox_amount_update.DoubleValue          = buyingCheque.Amount;
             chequeManager.textBox_chequeNumber_update.Text           = buyingCheque.ChequeNumber;
             chequeManager.comboBox_bank_update.SelectedValue         = buyingCheque.BankId;
             chequeManager.textBox_notes_update.Text            = buyingCheque.Notes;
             chequeManager.comboBox_status_update.SelectedValue = buyingCheque.Status;
         }
         else
         {
             SellingCheque sellingCheque = paymentManagerImpl.getSellingChequeById(id);
             chequeManager.SelectedSellingCheque = sellingCheque;
             chequeManager.datePicker_issuedDate_update.SelectedDate  = sellingCheque.IssuedDate;
             chequeManager.datePicker_payableDate_update.SelectedDate = sellingCheque.PayableDate;
             chequeManager.textBox_amount_update.DoubleValue          = sellingCheque.Amount;
             chequeManager.textBox_chequeNumber_update.Text           = sellingCheque.ChequeNumber;
             chequeManager.comboBox_bank_update.SelectedValue         = sellingCheque.BankId;
             chequeManager.textBox_notes_update.Text            = sellingCheque.Notes;
             chequeManager.comboBox_status_update.SelectedValue = sellingCheque.Status;
         }
     } catch (Exception) {
     }
 }
예제 #3
0
 internal void setBuyingChequeRreportRowsCount()
 {
     try {
         BuyingCheque buyingCheque = getBuyingChequeForFilter();
         buyingCheque.RowsCount  = 1;
         buyingCheque.LimitStart = buyingChequeRreport.Pagination.LimitStart;
         buyingCheque.LimitEnd   = buyingChequeRreport.Pagination.LimitCount;
         List <BuyingCheque> list = paymentManagerImpl.getBuyingCheque(buyingCheque);
         buyingChequeRreport.Pagination.RowsCount = list[0].RowsCount;
     } catch (Exception) {
     }
 }
예제 #4
0
 internal void filterBuyingCheque()
 {
     try {
         BuyingCheque bc = getBuyingChequeForFilter();
         bc.LimitStart = buyingChequeRreport.Pagination.LimitStart;
         bc.LimitEnd   = buyingChequeRreport.Pagination.LimitCount;
         List <BuyingCheque> list = paymentManagerImpl.getBuyingCheque(bc);
         buyingChequeRreport.DataTable.Rows.Clear();
         foreach (BuyingCheque buyingCheque in list)
         {
             buyingChequeRreport.DataTable.Rows.Add(buyingCheque.Id, bankManagerImpl.getBankById(buyingCheque.BankId).Name, buyingCheque.ChequeNumber,
                                                    buyingCheque.IssuedDate.ToString("yyyy-MM-dd"), buyingCheque.PayableDate.ToString("yyyy-MM-dd"),
                                                    buyingCheque.Amount.ToString("#,##0.00"), CommonMethods.getStatusForCheque(buyingCheque.Status));
         }
     } catch (Exception) {
     }
 }
예제 #5
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);
        }
예제 #6
0
        private BuyingCheque getBuyingChequeForFilter()
        {
            BuyingCheque buyingCheque = new BuyingCheque();

            try {
                if (chequeManager.datePicker_issuedDate_filter.SelectedDate != null)
                {
                    buyingCheque.IssuedDate = Convert.ToDateTime(chequeManager.datePicker_issuedDate_filter.SelectedDate);
                }
                if (chequeManager.datePicker_payable_filter.SelectedDate != null)
                {
                    buyingCheque.PayableDate = Convert.ToDateTime(chequeManager.datePicker_payable_filter.SelectedDate);
                }
                buyingCheque.Amount       = chequeManager.textBox_amount_filter.DoubleValue > 0 ? chequeManager.textBox_amount_filter.DoubleValue : -1;
                buyingCheque.ChequeNumber = chequeManager.textBox_chequeNumber_filter.Text + "%";
                buyingCheque.BankId       = Convert.ToInt32(chequeManager.comboBox_bank_filter.SelectedValue);
                buyingCheque.Notes        = "%" + chequeManager.textBox_notes_filter.Text + "%";
                buyingCheque.Status       = Convert.ToInt32(chequeManager.comboBox_status_filter.SelectedValue);
            } catch (Exception) {
            }
            return(buyingCheque);
        }
예제 #7
0
 internal void setRowsCount()
 {
     try {
         if (chequeManager.radioButton_buying_filter.IsChecked == true)
         {
             BuyingCheque buyingCheque = getBuyingChequeForFilter();
             buyingCheque.RowsCount             = 1;
             buyingCheque.LimitStart            = chequeManager.Pagination.LimitStart;
             buyingCheque.LimitEnd              = chequeManager.Pagination.LimitCount;
             chequeManager.Pagination.RowsCount = paymentManagerImpl.getBuyingCheque(buyingCheque)[0].RowsCount;
         }
         else
         {
             SellingCheque sellingCheque = getSellingChequeForFilter();
             sellingCheque.RowsCount            = 1;
             sellingCheque.LimitStart           = chequeManager.Pagination.LimitStart;
             sellingCheque.LimitEnd             = chequeManager.Pagination.LimitCount;
             chequeManager.Pagination.RowsCount = paymentManagerImpl.getSellingCheque(sellingCheque)[0].RowsCount;
         }
     } catch (Exception) {
     }
 }
예제 #8
0
 internal void filter()
 {
     try {
         if (chequeManager.radioButton_buying_filter.IsChecked == true)
         {
             BuyingCheque bc = getBuyingChequeForFilter();
             bc.LimitStart = chequeManager.Pagination.LimitStart;
             bc.LimitEnd   = chequeManager.Pagination.LimitCount;
             List <BuyingCheque> list = paymentManagerImpl.getBuyingCheque(bc);
             chequeManager.DataTable.Rows.Clear();
             foreach (BuyingCheque buyingCheque in list)
             {
                 chequeManager.DataTable.Rows.Add(
                     buyingCheque.Id, bankManagerImpl.getBankById(buyingCheque.BankId).Name, buyingCheque.ChequeNumber,
                     buyingCheque.IssuedDate.ToString("yyyy-MM-dd"), buyingCheque.PayableDate.ToString("yyyy-MM-dd"),
                     buyingCheque.Amount.ToString("#,##0.00"), buyingCheque.Notes, CommonMethods.getStatusForCheque(buyingCheque.Status)
                     );
             }
         }
         else
         {
             SellingCheque sc = getSellingChequeForFilter();
             sc.LimitStart = chequeManager.Pagination.LimitStart;
             sc.LimitEnd   = chequeManager.Pagination.LimitCount;
             List <SellingCheque> list = paymentManagerImpl.getSellingCheque(sc);
             chequeManager.DataTable.Rows.Clear();
             foreach (SellingCheque sellingCheque in list)
             {
                 chequeManager.DataTable.Rows.Add(
                     sellingCheque.Id, bankManagerImpl.getBankById(sellingCheque.BankId).Name, sellingCheque.ChequeNumber,
                     sellingCheque.IssuedDate.ToString("yyyy-MM-dd"), sellingCheque.PayableDate.ToString("yyyy-MM-dd"),
                     sellingCheque.Amount.ToString("#,##0.00"), sellingCheque.Notes, CommonMethods.getStatusForCheque(sellingCheque.Status)
                     );
             }
         }
     } catch (Exception) {
     }
 }