Пример #1
0
        private void SumBankExports(BankExportSet bankExports)
        {
			//decimal clientToCurrent = 0;
			//decimal currentToClient = 0;
			//decimal clientToPromoter = 0;
			decimal currentToPromoter = 0;
            
            if (bankExports != null)
            {




                bankExports.Reset();
                foreach (Bobs.BankExport be in bankExports)
                {
					currentToPromoter += be.Amount;


					//if (be.Type == Bobs.BankExport.Types.ExternalBACSRefundToPromoter || be.Type == Bobs.BankExport.Types.InternalTransferRefundToPromoter)
					//    currentToPromoter += be.Amount;
					//else if (be.Type == Bobs.BankExport.Types.ExternalBACSTicketFundsToPromoter || be.Type == Bobs.BankExport.Types.InternalTransferTicketFundsToPromoter)
					//    clientToPromoter += be.Amount;
					//else
					//{
					//    if (be.BankAccountNumber == Vars.DSI_CLIENT_BANK_ACCOUNT_NUMBER && be.BankAccountSortCode == Vars.DSI_CLIENT_BANK_SORT_CODE)
					//        currentToClient += be.Amount;
					//    else
					//        clientToCurrent += be.Amount;
					//}
                }
            }

            //this.FundsClientToCurrentLabel.Text = clientToCurrent.ToString("c");
            //this.FundsClientToPromoterLabel.Text = clientToPromoter.ToString("c");
            //this.FundsCurrentToClientLabel.Text = currentToClient.ToString("c");
            this.FundsCurrentToPromoterLabel.Text = currentToPromoter.ToString("c");
        }
Пример #2
0
        private void LoadGridViewOfSearchBankExport()
        {
            Query searchBankExportQuery = new Query();

            List<Q> QueryConditionList = new List<Q>();

            searchBankExportQuery.OrderBy = new OrderBy(new OrderBy(Bobs.BankExport.Columns.Type, OrderBy.OrderDirection.Descending), new OrderBy(Bobs.BankExport.Columns.ReferenceDateTime), new OrderBy(Bobs.BankExport.Columns.K, OrderBy.OrderDirection.Descending));

            if (this.BankExportRadioButtonList.SelectedValue == Convert.ToInt32(Options.NextBatch).ToString())
            {
                QueryConditionList.Add(new Or(new Q(Bobs.BankExport.Columns.Status, Bobs.BankExport.Statuses.Added),
                                              new Q(Bobs.BankExport.Columns.Status, Bobs.BankExport.Statuses.AwaitingConfirmation),
                                              new Q(Bobs.BankExport.Columns.Status, Bobs.BankExport.Statuses.Failed)));
            }
            else if (this.BankExportRadioButtonList.SelectedValue == Convert.ToInt32(Options.AwaitingConfirmation).ToString())
            {
                QueryConditionList.Add(new Q(Bobs.BankExport.Columns.Status, Bobs.BankExport.Statuses.AwaitingConfirmation));
            }
            else
            {
                searchBankExportQuery.OrderBy = new OrderBy(new OrderBy(Bobs.BankExport.Columns.ReferenceDateTime), new OrderBy(Bobs.BankExport.Columns.K, OrderBy.OrderDirection.Descending));

				if (this.uiPromoterHtmlAutoComplete.Value != null && !uiPromoterHtmlAutoComplete.Value.Equals(""))
					QueryConditionList.Add(new Q(Bobs.BankExport.Columns.PromoterK, Convert.ToInt32(uiPromoterHtmlAutoComplete.Value)));
                if (this.StatusDropDownList.SelectedValue != "")
                {
                    QueryConditionList.Add(new Q(Bobs.BankExport.Columns.Status, Convert.ToInt32(this.StatusDropDownList.SelectedValue)));
                }
                if (this.TypeDropDownList.SelectedValue != "")
                    QueryConditionList.Add(new Q(Bobs.BankExport.Columns.Type, Convert.ToInt32(this.TypeDropDownList.SelectedValue)));
                if (this.ExportDateCal.Date != DateTime.MinValue)
                {
                    QueryConditionList.Add(new And(new Q(Bobs.BankExport.Columns.OutputDateTime, QueryOperator.GreaterThanOrEqualTo, this.ExportDateCal.Date),
                                                   new Q(Bobs.BankExport.Columns.OutputDateTime, QueryOperator.LessThan, this.ExportDateCal.Date.AddDays(1))));
                }
                if (this.BatchRefTextBox.Text.Trim().Length > 0)
                    QueryConditionList.Add(new Q(Bobs.BankExport.Columns.BatchRef, QueryOperator.TextContains, this.BatchRefTextBox.Text.Trim()));
            }
            searchBankExportQuery.QueryCondition = new And(QueryConditionList.ToArray());      

            BankExportSet searchBankExports = new BankExportSet(searchBankExportQuery);

            
                if (this.BankExportRadioButtonList.SelectedValue == Convert.ToInt32(Options.NextBatch).ToString())
                {
                    try
                    {
                        foreach (Bobs.BankExport be in searchBankExports)
                        {
                            be.Validate();
                        }
                    }
                    catch (Exception ex)
                    {
                        SearchBankExportHeader.InnerHtml = ex.Message;
                        SearchBankExportHeader.Style["color"] = "Red";
                        BankExportLinkP.Visible = false;
                    }
                    searchBankExports.Reset();
                }
                this.SearchBankExportGridView.DataSource = searchBankExports;
                this.SearchBankExportGridView.DataBind();

                SearchResultsMessageLabel.Visible = searchBankExports.Count == 0;
                if (searchBankExports.Count == 0)
                {
                    SearchResultsMessageLabel.Text = "<br>* Zero search results returned.";
                }
                SumBankExports(searchBankExports);
            
        }