Example #1
0
 //MSarza [20150730]
 public CffClientInformation(CffClient cffClient, short noCalls, string cffLegalEntity, string clientSignature)
 {
     this.noCalls         = noCalls;
     this.cffClient       = cffClient;
     this.cffLegalEntity  = cffLegalEntity;
     this.clientSignature = clientSignature;
 }
Example #2
0
        public string GetClientIdByCustomerId(string customerId)
        {
            string clientId = "";

            try
            {
                if (customerId.Contains("("))
                {
                    //this is customer number, we should be able to get the correct customer id based from cust# and clientid
                    customerId = customerId.Substring(customerId.IndexOf("(") + 1);
                    customerId = customerId.Replace(")", "");
                }

                if (!string.IsNullOrEmpty(customerId))
                {
                    CffClient cffclient = RepositoryFactory.CreateClientRepository().GetCffClientByCustomerId(Convert.ToInt32(customerId));
                    clientId = cffclient.Id.ToString();
                }
            }
            catch (HttpException ex)
            {
                Logger logger = new Logger();
                logger.LogError(ex.GetBaseException());
                clientId = "-1";
            }
            return(clientId);
        }
        public void SelectCustomer(int customerId)
        {
            if (securityManager.CanChangeSelectedCustomer())
            {
                if (securityManager.CanChangeSelectedClient())
                {
                    CffClient   client   = clientRepository.GetCffClientByCustomerId(customerId);
                    CffCustomer customer = customerRepository.GetCffCustomerByCustomerId(customerId);

                    if (client != null && customer != null)
                    {
                        // view.Client = client;
                        // view.Customer = customer;
                    }
                }
                else
                {
                    CffCustomer customer = customerRepository.GetCffCustomerByClientIdAndCustomerId(view.Client.Id, customerId);
                    if (customer != null)
                    {
                        // view.Customer = customer;
                    }
                }
            }
        }
Example #4
0
        public ICffClient GetCffClientByClientId(int clientId)
        {
            ICffClient cffClient = null;

            using (SqlConnection connection = CreateConnection())
            {
                using (
                    SqlDataReader dataReader = SqlHelper.ExecuteReader(connection, CommandType.StoredProcedure,
                                                                       "Client_GetClientByCleintID",
                                                                       CreateClientIdParameter(clientId)))
                {
                    CleverReader cleverReader = new CleverReader(dataReader);
                    if (!cleverReader.IsNull && cleverReader.Read())
                    {
                        if (cleverReader.FromBigInteger("ClientID") == -1)
                        {
                            cffClient = AllClients.Create();
                        }
                        else
                        {
                            cffClient = new CffClient(cleverReader.ToString("ClientName"),
                                                      cleverReader.FromBigInteger("ClientID"),
                                                      cleverReader.FromBigInteger("ClientNum"),
                                                      cleverReader.ToSmallInteger("FacilityType"),
                                                      cleverReader.ToString("CollectionsBankAccount"),
                                                      cleverReader.ToSmallInteger("CFFDebtorAdmin"),        //MSazra [20151006]
                                                      cleverReader.ToBoolean("ClientHasLetterTemplates")    //MSazra [20151006]
                                                      );
                        }
                    }
                }
            }
            return(cffClient);
        }
Example #5
0
 public CffClientInformation Build(CffClient client)
 {
     return(new CffClientInformation(client,
                                     reader.ToSmallInteger("ClientNoCalls"),
                                     reader.ToString("CffLegalEntity"), //MSarza [20150730]
                                     reader.ToString("ClientSignature") //MSarza [20150810]
                                     ));
 }
        public void CheckClientAndCustomerMatchAndSelectCustomer(int clientId, int customerId)
        {
            if (securityManager.CanChangeSelectedCustomer())
            {
                if (securityManager.CanChangeSelectedClient())
                {
                    ICffClient client             = clientRepository.GetCffClientByClientId(clientId);
                    CffClient  clientBycustomerId = clientRepository.GetCffClientByCustomerId(customerId);


                    if (SessionWrapper.Instance.Get != null)
                    {
                        if (SessionWrapper.Instance.Get.UserIdentity == 1)
                        {
                            if (SessionWrapper.Instance.Get.ClientFromQueryString != null)
                            {
                                System.Web.HttpContext.Current.Response.Redirect(DashBoardUri + "?Client=" + SessionWrapper.Instance.Get.ClientFromQueryString.Id + "&Customer=" + customerId);
                                return;
                            }
                        }
                        else
                        {
                            if (client != null && clientBycustomerId != null)
                            {
                                if (client.Id != clientBycustomerId.Id)
                                {
                                    System.Web.HttpContext.Current.Response.Redirect(DashBoardUri + "?Client=" + clientBycustomerId.Id + "&Customer=" + customerId);
                                }
                            }
                        }
                    }
                    else
                    {
                        if (client != null && clientBycustomerId != null)
                        {
                            if (client.Id != clientBycustomerId.Id)
                            {
                                System.Web.HttpContext.Current.Response.Redirect(DashBoardUri + "?Client=" + clientBycustomerId.Id + "&Customer=" + customerId);
                            }
                        }
                    }
                }
                else
                {
                    CffCustomer customer = customerRepository.GetCffCustomerByClientIdAndCustomerId(view.Client.Id, customerId);
                    if (customer != null)
                    {
                        // view.Customer = customer;
                    }
                }
            }
        }
Example #7
0
        private readonly string clientSignature;     //MSarza [20150810]

        public CffClientInformation(CffClient cffClient, short noCalls)
        {
            this.noCalls   = noCalls;
            this.cffClient = cffClient;
        }