Ejemplo n.º 1
0
        public static LoanApplicationStatu CreateOrUpdateCurrent(LoanApplication loanApplication, LoanApplicationStatusType statusType, DateTime today)
        {
            LoanApplicationStatu loanAppStatus = GetActive(loanApplication);
            if (loanAppStatus != null && loanAppStatus.LoanApplicationStatusType.Id != statusType.Id)
                loanAppStatus.IsActive = false;

            if (loanAppStatus == null || loanAppStatus.LoanApplicationStatusType.Id != statusType.Id)
            {
                LoanApplicationStatu loanStatus = new LoanApplicationStatu();
                loanStatus.LoanApplication = loanApplication;
                loanStatus.LoanApplicationStatusType = statusType;
                loanStatus.Remarks = null;
                loanStatus.TransitionDateTime = today;
                loanStatus.IsActive = true;

                Context.LoanApplicationStatus.AddObject(loanStatus);
                Context.SaveChanges();
                return loanStatus;
            }
            return loanAppStatus;
        }
Ejemplo n.º 2
0
        private static LoanApplicationStatu CreateOrUpdateCurrent(LoanApplicationStatu current, LoanApplicationStatusType statusType, DateTime today)
        {
            if (current != null && current.LoanApplicationStatusType.Id != statusType.Id)
                current.IsActive = false;

            if (current == null || current.LoanApplicationStatusType.Id != statusType.Id)
            {
                LoanApplicationStatu loanStatus = new LoanApplicationStatu();
                loanStatus.LoanApplication = current.LoanApplication;
                loanStatus.LoanApplicationStatusType = statusType;
                loanStatus.Remarks = null;
                loanStatus.TransitionDateTime = today;
                loanStatus.IsActive = true;

                Context.LoanApplicationStatus.AddObject(loanStatus);
                return loanStatus;
            }
            return current;
        }