Esempio n. 1
0
        public string AccountVinOnHoldReason(Absence absence)
        {
            string holdReason = "";

            AccountVinHold _holdsRepo = new AccountVinHold();

            if (absence.CustomerID != null)
            {
                List <AccountVinHold> holds = _holdsRepo.GetAccountVinHoldsByAccountID(absence.CustomerID);

                if (holds != null && holds.Count() > 0 && absence.Type != 4001)
                {
                    return(holds[0].Description.ToString() + " [" + GetUserByHRESID(holds[0].RequestedByID) + " " + holds[0].RequestedOn + "]");

                    foreach (AccountVinHold hold in holds)
                    {
                        //Dealer Account on Hold
                        if (hold.HoldType == 1)
                        {
                            return("Account on hold");

                            if (absence.CustomerID == hold.AccountNum)
                            {
                                holdReason = hold.Notes;
                                break;
                            }
                        }
                        //VIN on hold
                        else if (hold.HoldType == 2)
                        {
                            return("VIN on hold");

                            if (absence.VIN == hold.VIN)
                            {
                                holdReason = hold.Notes;
                                break;
                            }
                        }
                        //VRA on hold
                        else if (hold.HoldType == 3)
                        {
                            return("VRA on hold");
                            //might have to add VRA to absences in future?
                        }
                    }
                }
            }
            return(holdReason);
        }
Esempio n. 2
0
        public bool IsAccountVinOnHold(Absence absence)
        {
            bool isOnHold = false;

            AccountVinHold _holdsRepo = new AccountVinHold();

            if (absence.CustomerID != null)
            {
                List <AccountVinHold> holds = _holdsRepo.GetAccountVinHoldsByAccountID(absence.CustomerID);

                if (holds != null && holds.Count > 0 && absence.Type != 4001)
                {
                    foreach (AccountVinHold hold in holds)
                    {
                        //check to see if status is not 'released'
                        if (hold.Status == 1 && absence.Status != 3 /* closed */ && absence.Status != 2 /* rejected */)
                        {
                            //Dealer Account on Hold
                            if (hold.HoldType == 1)
                            {
                                if (absence.CustomerID == hold.AccountNum)
                                {
                                    return(true);
                                }
                            }
                            //VIN on hold
                            else if (hold.HoldType == 2)
                            {
                                if (absence.VIN == hold.VIN)
                                {
                                    return(true);
                                }
                            }
                            //VRA on hold
                            else if (hold.HoldType == 3)
                            {
                                //might have to add VRA to absences in future?

                                //return true
                            }
                        }
                    }
                }
            }
            return(isOnHold);
        }