예제 #1
0
        private SellingCheque getSellingChequeForFilter()
        {
            SellingCheque sellingCheque = null;

            try {
                sellingCheque = new SellingCheque();
                if (sellingChequeReport.datePicker_from.SelectedDate != null || sellingChequeReport.datePicker_to.SelectedDate != null)
                {
                    if (sellingChequeReport.datePicker_from.SelectedDate != null && sellingChequeReport.datePicker_to.SelectedDate != null)
                    {
                        sellingCheque.PayableDate = sellingChequeReport.datePicker_from.SelectedValue;
                        sellingCheque.addDateCondition("date", "BETWEEN", sellingChequeReport.datePicker_from.SelectedValue.ToString("yyyy-MM-dd"), sellingChequeReport.datePicker_to.SelectedValue.ToString("yyyy-MM-dd"));
                    }
                    else if (sellingChequeReport.datePicker_from.SelectedDate != null)
                    {
                        sellingCheque.PayableDate = sellingChequeReport.datePicker_from.SelectedValue;
                    }
                    else
                    {
                        sellingCheque.PayableDate = sellingChequeReport.datePicker_to.SelectedValue;
                    }
                }
                sellingCheque.Status = Convert.ToInt32(sellingChequeReport.comboBox_status.SelectedValue);
                sellingCheque.Status = sellingChequeReport.comboBox_status.Value;
            } catch (Exception) {
            }
            return(sellingCheque);
        }
예제 #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 setSellingChequeRreportRowsCount()
 {
     try {
         SellingCheque sellingCheque = getSellingChequeForFilter();
         sellingCheque.RowsCount  = 1;
         sellingCheque.LimitStart = sellingChequeReport.Pagination.LimitStart;
         sellingCheque.LimitEnd   = sellingChequeReport.Pagination.LimitCount;
         List <SellingCheque> list = paymentManagerImpl.getSellingCheque(sellingCheque);
         sellingChequeReport.Pagination.RowsCount = list[0].RowsCount;
     } catch (Exception) {
     }
 }
예제 #4
0
 internal void filterSellingCheque()
 {
     try {
         SellingCheque sc = getSellingChequeForFilter();
         sc.LimitStart = sellingChequeReport.Pagination.LimitStart;
         sc.LimitEnd   = sellingChequeReport.Pagination.LimitCount;
         List <SellingCheque> list = paymentManagerImpl.getSellingCheque(sc);
         sellingChequeReport.DataTable.Rows.Clear();
         foreach (SellingCheque sellingCheque in list)
         {
             sellingChequeReport.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"), CommonMethods.getStatusForCheque(sellingCheque.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 SellingCheque getSellingChequeForFilter()
        {
            SellingCheque sellingCheque = new SellingCheque();

            try {
                if (chequeManager.datePicker_issuedDate_filter.SelectedDate != null)
                {
                    sellingCheque.IssuedDate = Convert.ToDateTime(chequeManager.datePicker_issuedDate_filter.SelectedDate);
                }
                if (chequeManager.datePicker_payable_filter.SelectedDate != null)
                {
                    sellingCheque.PayableDate = Convert.ToDateTime(chequeManager.datePicker_payable_filter.SelectedDate);
                }
                sellingCheque.Amount       = chequeManager.textBox_amount_filter.DoubleValue > 0 ? chequeManager.textBox_amount_filter.DoubleValue : -1;
                sellingCheque.ChequeNumber = chequeManager.textBox_chequeNumber_filter.Text + "%";
                sellingCheque.BankId       = Convert.ToInt32(chequeManager.comboBox_bank_filter.SelectedValue);
                sellingCheque.Notes        = "%" + chequeManager.textBox_notes_filter.Text + "%";
                sellingCheque.Status       = Convert.ToInt32(chequeManager.comboBox_status_filter.SelectedValue);
            } catch (Exception) {
            }
            return(sellingCheque);
        }
예제 #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) {
     }
 }