public ICffCustomer GetCustomerDetails()
        {
            if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["Customer"]))
            {
                string customerId = HttpContext.Current.Request.QueryString["Customer"];
                if (!string.IsNullOrEmpty(customerId))
                {
                    customerId = customerId.Replace("(", "").Replace(")", "");

                    //cleanup - for cases where querystring duplicates
                    if (customerId.Contains(","))
                    {
                        customerId = customerId.Split(',')[0];
                    }

                    if (customerDetails == null)
                    {
                        customerDetails = (ICffCustomer)((CffCustomerExt)RepositoryFactory.CreateCustomerRepository().GetCffCustomerByCustomerIdNew((Convert.ToInt32(customerId))));
                    }
                    else
                    {
                        if (customerDetails.Id.ToString() != customerId)
                        {
                            customerDetails = (ICffCustomer)((CffCustomerExt)RepositoryFactory.CreateCustomerRepository().GetCffCustomerByCustomerIdNew((Convert.ToInt32(customerId))));
                        }
                    }
                    return(customerDetails);
                }
                return(null);
            }

            return(null);
        }
Beispiel #2
0
        protected void SaveButton_Click(object sender, ImageClickEventArgs e)
        {
            int          employeeId = CurrentPrincipal.CffUser.EmployeeId;
            ICffCustomer xCustomer  = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.CustomerFromQueryString :
                                      (!string.IsNullOrWhiteSpace(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).CustomerFromQueryString : null;

            if (PermanentNoteCheckBox.Checked)
            {
                var permanentNote = new PermanentCustomerNote(CommentTextBox.EncodedText, ((xCustomer == null)?0:xCustomer.Id), employeeId);
                presenter.SavePermanentNote(permanentNote);
            }
            else
            {
                if (!string.IsNullOrEmpty(NextCallDueTextBox.EncodedText))
                {
                    var calendar        = new Calendar();
                    var nextCallDueDate = new Date(DateTime.Parse(NextCallDueTextBox.EncodedText));

                    presenter.UpdateCustomerNextCallDue(nextCallDueDate, ((xCustomer == null) ? 0 : xCustomer.Id), calendar.Now, employeeId);

                    if (NextCallDueUpdated != null)
                    {
                        NextCallDueUpdated(nextCallDueDate, new EventArgs());
                    }
                }
                ActivityType activityType = ActivityType.Parse(int.Parse(ActivityTypeDropDownList.SelectedValue));
                NoteType     noteType     = NoteType.Parse(int.Parse(NoteTypeDropDownList.SelectedValue));

                var customerNote = new CustomerNote(activityType, noteType, CommentTextBox.EncodedText, ((xCustomer == null) ? 0 : xCustomer.Id), employeeId);
                presenter.SaveCustomerNote(customerNote);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            presenter = new CustomerWatchPresenter(this, ReportsService.Create(), ReportManagerFactory.Create(this.CurrentScope(), Context.User as CffPrincipal));

            ICffClient xClient = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.ClientFromQueryString :
                                 (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString : null;

            if (xClient != null)
            {
                targetName = ": " + xClient.Name;
            }

            ICffCustomer xCustomer = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.CustomerFromQueryString :
                                     (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).CustomerFromQueryString : null;

            if (xCustomer != null)
            {
                if (targetName != null || !targetName.Equals(""))
                {
                    targetName += " / ";
                    targetName  = string.Concat(targetName, xCustomer.Name);
                }
                else
                {
                    targetName = ": " + xCustomer.Name;
                }
            }

            if (!IsPostBack)
            {
                presenter.ConfigureView(this.CurrentScope());
                presenter.ShowReport(this.CurrentScope(), true);
            }
        }
Beispiel #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            presenter.ConfigureView(SessionWrapper.Instance.Scope);

            ICffClient xClient = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.ClientFromQueryString :
                                 (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString : null;

            if (xClient != null)
            {
                targetName = ": " + xClient.Name;
            }

            ICffCustomer xCustomer = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.CustomerFromQueryString :
                                     (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).CustomerFromQueryString : null;

            if (xCustomer != null)
            {
                if (targetName != null || !targetName.Equals(""))
                {
                    targetName += " / ";
                    targetName  = string.Concat(targetName, xCustomer.Name);
                }
                else
                {
                    targetName = ": " + xCustomer.Name;
                }
            }

            // end
            if (!IsPostBack)
            {
                presenter.ShowReport(this.CurrentScope(), true);
            }
        }
Beispiel #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            InitializeCurrentPathForJavaScript();

            ICffClient xClient = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.ClientFromQueryString :
                                 (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString : null;

            if (xClient != null)
            {
                targetName = ": " + xClient.Name;
            }

            ICffCustomer xCustomer = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.CustomerFromQueryString :
                                     (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).CustomerFromQueryString : null;

            if (xCustomer != null)
            {
                if (targetName != null || !targetName.Equals(""))
                {
                    targetName += " / ";
                    targetName  = string.Concat(targetName, xCustomer.Name);
                }
                else
                {
                    targetName = ": " + xCustomer.Name;
                }
            }

            Master.ShowReportViewer();
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            presenter = new OverpaymentsPresenter(this, TransactionReportsService.Create(), ReportManagerFactory.Create(this.CurrentScope(), Context.User as CffPrincipal));
            presenter.ConfigureView(this.CurrentScope());

            ICffClient xClient = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.ClientFromQueryString :
                                 (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString : null;

            if (xClient != null)
            {
                targetName = ": " + xClient.Name;
            }

            ICffCustomer xCustomer = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.CustomerFromQueryString :
                                     (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).CustomerFromQueryString : null;

            if (xCustomer != null)
            {
                if (targetName != null || !targetName.Equals(""))
                {
                    targetName += " / ";
                    targetName  = string.Concat(targetName, xCustomer.Name);
                }
                else
                {
                    targetName = ": " + xCustomer.Name;
                }
            }

            presenter.ShowReport(this.CurrentScope(), true);
            UpdateTitle((TransactionStatusTypesFilterControl.Controls[1] as System.Web.UI.WebControls.DropDownList).Text);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            presenter = new PromptReportPresenter(this, RepositoryFactory.CreateReportRepository(), ReportManagerFactory.Create(this.CurrentScope(), Context.User as CffPrincipal));

            ICffClient xClient = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.ClientFromQueryString :
                                 (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString : null;

            if (xClient != null)
            {
                targetName = ": " + xClient.Name;
            }

            ICffCustomer xCustomer = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.CustomerFromQueryString :
                                     (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).CustomerFromQueryString : null;

            if (xCustomer != null)
            {
                if (targetName != null || !targetName.Equals(""))
                {
                    targetName += " / ";
                    targetName  = string.Concat(targetName, xCustomer.Name);
                }
                else
                {
                    targetName = ": " + xCustomer.Name;
                }
            }

            if (!IsPostBack)
            {
                if (xClient != null)
                {
                    presenter.LoadDefaultPromptDays(xClient.Id);
                }

                LoadReport(); //as per marty's suggestions

                //if (this.CurrentScope() != Scope.AllClientsScope) {
                //    LoadReport();
                //} else {
                //    HideReportContent();
                //}
            }
        }
Beispiel #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            DatePicker.Update += DatePickerUpdated;

            presenter = new StatementPresenter(this, RepositoryFactory.CreateReportRepository(),
                                               ReportManagerFactory.Create(SessionWrapper.Instance.Scope,
                                                                           Context.User as CffPrincipal));

            ICffClient xClient = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.ClientFromQueryString :
                                 (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString : null;

            if (xClient != null)
            {
                targetName = ": " + xClient.Name;
            }

            ICffCustomer xCustomer = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.CustomerFromQueryString :
                                     (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).CustomerFromQueryString : null;

            if (xCustomer != null)
            {
                if (targetName != null || !targetName.Equals(""))
                {
                    targetName += " / ";
                    targetName  = string.Concat(targetName, xCustomer.Name);
                }
                else
                {
                    targetName = ": " + xCustomer.Name;
                }
            }
            // end
            if (!IsPostBack)
            {
                presenter.InitializeForScope();
                presenter.LoadStatementReport();
            }
            else
            {
                ShowReport(ViewState["StatementReport"] as StatementReport);
            }
        }
        public ICffCustomer GetCffCustomerByCustomerIdNew(int customerId)
        {
            ICffCustomer customer = null;

            using (SqlConnection connection = CreateConnection())
            {
                using (SqlDataReader dataReader = SqlHelper.ExecuteReader(connection,
                                                                          CommandType.StoredProcedure,
                                                                          "Customers_GetCustomerByID",
                                                                          CreateCustomerIdParameter(customerId, false)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    if (!cleverReader.IsNull && cleverReader.Read())
                    {
                        customer = new CffCustomerBuilderNew(cleverReader).BuildNew();
                    }
                }
            }
            return(customer);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            reportPanelContainer.ReportParameterUpdated += ReportParameterUpdated;

            presenter = new CreditBalanceTransfersPresenter(this, TransactionReportsService.Create(), ReportManagerFactory.Create(this.CurrentScope(), Context.User as CffPrincipal));
            presenter.ConfigureView(this.CurrentScope());

            // start related ref:CFF-18
            ICffClient xClient = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.ClientFromQueryString :
                                 (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).ClientFromQueryString : null;

            if (xClient != null)
            {
                targetName = ": " + xClient.Name;
            }

            ICffCustomer xCustomer = (SessionWrapper.Instance.Get != null) ? SessionWrapper.Instance.Get.CustomerFromQueryString :
                                     (!string.IsNullOrEmpty(QueryString.ViewIDValue)) ? SessionWrapper.Instance.GetSession(QueryString.ViewIDValue).CustomerFromQueryString : null;

            if (xCustomer != null)
            {
                if (targetName != null || !targetName.Equals(""))
                {
                    targetName += " / ";
                    targetName  = string.Concat(targetName, xCustomer.Name);
                }
                else
                {
                    targetName = ": " + xCustomer.Name;
                }
            }
            // end
            //if (!IsPostBack)
            //{
            presenter.ShowReport(this.CurrentScope(), true);
            UpdateTitle((reportPanelContainer.FindControl("TransactionStatusTypesFilterControl").Controls[1] as System.Web.UI.WebControls.DropDownList).Text);
            //}
        }