Beispiel #1
0
        public static bool Remove(MortgageApplication application)
        {
            bool removed = false;

            try
            {
                if (application.ApplicationId != Guid.Empty)
                {
                    var app = MortgageApplications.FirstOrDefault(k => k.ApplicationId == application.ApplicationId);
                    if (app != null)
                    {
                        removed = MortgageApplications.Remove(app);
                    }
                }
            }
            catch (Exception)
            {
                removed = false;
            }
            return(removed);
        }
Beispiel #2
0
        public static bool Update(MortgageApplication application)
        {
            bool updated = false;

            try
            {
                var app = MortgageApplications.FirstOrDefault(k => k.ApplicationId == application.ApplicationId);
                if (app != null)
                {
                    bool removed = MortgageApplications.Remove(app);
                    if (removed)
                    {
                        MortgageApplications.Add(application);
                        updated = true;
                    }
                }
            }
            catch (Exception)
            {
                updated = false;
            }
            return(updated);
        }
Beispiel #3
0
        public static bool Add(MortgageApplication application)
        {
            bool added = false;

            try
            {
                if (application.ApplicationId == Guid.Empty)
                {
                    application.ApplicationId = Guid.NewGuid();
                }
                var app = MortgageApplications.FirstOrDefault(k => k.ApplicationId == application.ApplicationId);
                if (app == null)
                {
                    MortgageApplications.Add(application);
                    added = true;
                }
            }
            catch (Exception)
            {
                added = false;
            }
            return(added);
        }